Manohar Paleti

My photo
Hyderabad, AP, India
Working as a BI Consultant, Served for various organizations as an OBIEE Developer by building the BI Solutions for Business Decision Making..

Tuesday, January 11, 2011

OBIEE Variables

A repository variable has a single value at any point in time. Repository variables can be used instead of literals or constants in expression builders in the Administration Tool. The Oracle BI Server will substitute the value of the repository variable for the variable itself in the metadata.
This section includes the following topics:
  • Static Repository Variables Dynamic Repository Variables
Static Repository Variables: 
The value of a static repository value is initialized in the Variable dialog box. This value persists, and does not change until an Oracle BI Administrator decides to change it. 

Example : 
Creating a Static Variable : Open Rpd-->Tools-->Variables--->Under Repository section --->Static-->Right click on Right Pane-->New Repository Variable








In the above picture in Default initializer used 'C:\oracelBI' we can that value in connection pool refer below screen shot In DataSource name : VALUEOF(BI_EE_HOME)/server/Sample/samplesales Where VALUEOF(BI_EE_HOME) = C:\OracleBI 



Suppose you want to create an expression to group times of day into different day segments. If Prime Time were one of those segments and corresponded to the hours between 5:00 PM and 10:00 PM, you could create a CASE statement like the following:
CASE WHEN "Hour" >= 17 AND "Hour" <>
where Hour is a logical column, perhaps mapped to a timestamp physical column using the date-and-time Hour(<>) function.
Rather than entering the numbers 17 and 23 into this expression as constants, you could use the Variable tab of the Variable dialog box to set up a static repository variable named prime_begin and initialize it to a value of 17, and create another variable named prime_end and initialize it to a value of 23.
We can use the same syntax in Expression Builder which will be like this 
CASE WHEN "Hour" >= VALUEOF("prime_begin")AND "Hour" <>
Declare the static variable how i showed in above screen shot with respective to default initializer
Dynamic Repository Variables:
You initialize dynamic repository variables in the same way as static variables, but the values are refreshed by data returned from queries. When defining a dynamic repository variable, you will create an initialization block or use a pre-existing one that contains a SQL query. You will also set up a schedule that the Oracle BI Server will follow to execute the query and periodically refresh the value of the variable.
NOTE: When the value of a dynamic repository variable changes, all cache entries associated with a business model that reference the value of that variable will be purged automatically.
Each query can refresh several variables—one variable for each column in the query. You schedule these queries to be executed by the Oracle BI Server.
Example
You can refer
http://gerardnico.com/wiki/dat/obiee/server_variable_date
or 
http://mithil-tech.blogspot.com/2010/07/obiee-using-dynamic-repository-variable.html 

No comments:

Post a Comment