Saturday, October 13, 2012

Variables in OBIEE 10.1.3.x

Definition:  Variable is created and managed by Variable Manager,It contains values in memory that are used by OBIEE Server during process.
The variable manager has two panes ,right one shows all the varaibles and Init blocks and left one shows the detail information about the item which you have selected.











Variables:

Types of Variables:

1.Repository Variables -- Static and Dynamic Variables.

2.Session Varibales- System and Non-system Variables.

3.Request Variable.

4.Presentation Variable.

Explanation :

Repository Variable: It has a single value at any point in time.Repository variable can used instead of literals or constants in expression builders in Admin Tool.
OBIEE Server will substitute the value of the repository variable for the variable itself in the metadata.

Static Variable is initialized in the variable dialog box.This value presists  and does not change until  an Oracle BI Administrator decides to change it.
Example: Suppose if we want to create expression to group times of day into different day segments.
If prime time were one of those segments and correspond to the hours between 5:00pm and 10:00pm .
Case statement:
Case when 'Hour' >=17  and 'Hour' < 23  Then 'Prime Time' When  ..Else ... End.

where Hour is logical column which is mapped to a timestamp physical column using the date and time Hour function.

Rather than entering numbers we can enter the static  repository variables 'Prime Begin' and 'Prime End'

Variables should be use as arguments of the function VALUEOF( ).
CASE when 'Hour' >= VALUEOF('Prime Begin') and 'Hour' < VALUEOF('Prime End')
THEN
'Prime Time' Else ' ' END

Uses of Repository Varaibles:
1.BI Server.
2.BI Presentation services.
3.BI Delivers.

Dynamic Repository Variables: Dynamic Repository Variables are very useful for defining the content of logical table sources.The values are  refreshed by data returned from queries.
When defining the  dynamic repository variable,we will create init block or use pre-existing one that contains sql query.When the value of a dynamic repository variable changes,all cache entries  associated  with a business model  that refrernce the value of that varible will be purged automatically.