Scenario:
We need to create a report using the Direct Database Request and also have to create a prompt to dynamically enter the values by the users. We all know that Direct Database Request is nothing but writing the query which hits the database directly through the RPD Connection Pool. This post explains you how to create the prompts in the database query itself. Though it is almost similar to creating a prompt on the database query minor tweaking has to be done to append this to Obiee.
1) Create one Dashborad prompt with presentation variable
as shown in the below screenshot and assign a default value in this presentation variable.
then Click on Ok
Save the Prompt with the desired name.
2)
Click on New--->Select Analysis---> click on Create Direct data base request as shown in the below screenshot
Give the Connection pool name (It should match with the connection pool name in the RPD and no two connection pools should have the same name)
and SQL statement as per requirement.
In the SQL query statement pass the presentation
variable name information as follows.
Query:
select products.prod_id ,products.prod_category , products.prod_name
, sum(amount_sold) from products,
sales where
products.prod_id=sales.prod_id and products.PROD_ID
IN( @{VAR}{'13'}) group by products.prod_id ,products.prod_category , products.prod_name
3) Now Create one Dashboard and place the report and Dashboard prompt on the dashboard
4) Now select the values from the prompt,click on apply and see the values on the report are changing as per the selected prompt values.
Exactly what I was looking for..
ReplyDeleteWhat if you don't want to default to a specified value but want all the values to initially appear?
Hi Amy,
DeletePlease take a look at this post and see if it helps. I am sure that there is a way to display all the values by default. I will create a new post for this requirement soon.
http://obiee11gtips.blogspot.com/2015/10/how-to-work-with-multiple-value-select.html
Thanks,
Nagarjuna
Hi Amy,
DeleteTry this syntax given in the query. Its working fine. I have created the presentation variable (Brand), when no value is selected in the prompt then the reports renders all the values, if any value is selected in the prompt then the report will get only the selected value results.
Select * from SAMP_PRODUCTS_D where brand IN (@{Brand.isAllColumnValues?NULL:Brand}['@']{"SAMP_PRODUCTS_D"."BRAND"})
Thanks,
Nagarjuna
Hi Venkata
ReplyDeleteWhat if I want to prompt for date value, for example. If I want to use the between on two dates using a calender operator. how do I go about doing that?
Try the syntax of Date or Datetime as per your requirement. It should work.
DeleteDate Time column:
Select T1.C1 from SA where T1.DateTimeColumn in (@{myDateTimeVar}{timestamp '2000-01-21 00:00:00'})
Date-Only column:
Select T1.C1 from SA where T1.DateColumn in (@{myDateVar}{date '2000-01-21'})
thank you!
ReplyDeleteit works!
If I am only using OBIEE for Direct Database Request and have no tables for creating dashboard prompts, can I use SQL for the Prompt as well? Please advise.
ReplyDeleteYes, you can use the sql for prompt as well but in your case creating the presentation variable would be mandatory as you are creating the prompt from OBIEE with out using tables from database.
DeleteThanks,
Nagarjuna
Hi Venkata,
ReplyDeleteYours tips and trics are really helpful for me while my work on obiee.
Need a help from you. I want to select all column choice values from one prompt and assign those values to another one.
right now when i select all column (without all column values) its working, but as i select all column values its not.
please help
little modification..
Deleteright now when i select all values (without all column values) its working, but as i select all column values its not.
Hi Rahul,
DeleteCheck the below sql it should work for all column values.
Select * from SAMP_PRODUCTS_D where brand IN (@{Brand.isAllColumnValues?NULL:Brand}['@']{"SAMP_PRODUCTS_D"."BRAND"})
Thanks,
Nagarjuna
Hi Venkata, having issue with following Prompt in OBIEE 11G version 11.1.1.9.160419, AND TRUNC(rcv.creation_date) >= TRUNC(to_date(@{VAR}{'2017-01-01 12:00:00 AM'},'YYYY-MM-DD HH:MI:SS AM'))
ReplyDeleteHi Ronald,
DeleteCan give more details about your issue like the error message or error codes, what is your expected result and the business scenario etc.
Thanks,
Nagarjuna
Hi Venkata, how do we use call_from_date and call_to_date dashboard prompt for direct database request report
ReplyDeleteHello,
ReplyDeleteThank you for the blog. This is extremely helpful. My question is since obiee prompts pass value1,value2, . . . when using a prompt with multiple selections. What happens when your data has a comma within the data. A perfect example is a name. i.e. Wayne,Bruce. This will pass through as two different values since there is a comma in the data set.
Thanks,
Rico
ReplyDeleteGreat Article. As I read the blog I felt a tug on the heartstrings. it exhibits how much effort has been put into this.
IEEE Projects for CSE in Big Data
Spring Framework Corporate TRaining
Final Year Project Centers in Chennai
JavaScript Training in Chennai
This comment has been removed by the author.
ReplyDeleteHow do we do the all column values with a date?
ReplyDelete