Friday, March 31, 2017

Default values to current date, month or year on OBIEE 11.1.1.7

To day I show you how to setup the Default value to current date/month/year for prompts on OBIEE 11.1.1.7. A requirement with report/dashboard is that, end user always want to see current date/month/year data when the report/dashboard is opened.
Go into Catalog, open the edit screen for the prompt that you want to setup default value.

In my case, my prompt is Prompt_year_month is used to filter data by Month and Year(Time Dimension). Select the row and click pencial button to open the Edit Prompt window.
To set the current month/year as default value of prompts, you chose “SQL Result” at Default selection. Then enter the select statement that returns the current month/year. Note that “select extract(YEAR from sysdate) from dual” is not a valid SQL statement.
In my demostration, my SQL statement is as below:

Now, how to write the SQL statement. Don’t worry, let’s go.
In the SQL statement you can realize that the table is the Present Layer Name from Repository. And Columns is also from table columns(Time dimension) of the Present Layer Name.
The last one is that the functions. They are not sql functions. They are OBIEE functions. Oh my god, where are they! How to get them! So easy, see below!
In the Edit Column Formula windows you click f(…) button to open Insert Function. All of them are here.

That is all thing you need to write your SQL statement for the “SQL Result Default selection”.