Scenario - You have a query pasted in the RPD and there is a inline query in it, which needs to be filtered based on one of the prompt on the dashboard.
Solution - Suppose you want to filter a column named status in your inline query. Now we create a session variable sStatus. Provide the following sql in the session variable select '@{status}' from dual; Where status in '@{status}' is your presentation variable. Provide a default initializer '@{status}'. Default initializer is required, this way your if you use it for adhoc reporting, the view wont error out becuase session variable is not containing any value definition. Now place this session variable in physical query (inline query) and use a decode statement e.g (decode (session_variable,'@{status}',status,session_variable). Status column in this decode is the status column from actual table. This is helpfull when you are not providing any value to the variable, the column will self join to itself and the report wont error out and the data will also be correct. Now in your report create a prompt and set a presentation varianble status. Now open the report, go to advance tab and in prefix mention following command set variable sSession = '@{status}'; What happens now is ..presentation variable is set first and the set variable command set the session variable. This all hapens before the execution of your query and the query data filters out based on the value you have selected from the prompt.
Sunday, June 27, 2010
Passing report prompts to inline query in physical layer
Labels:
business intelligence,
obiee,
oracle,
parameters,
prompts,
variables
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment