Monday, October 15, 2012

[OBIEE 11g] Variables in Oracle


Variables in Oracle OBIEE 11g  
There are basically 4 different types of variables in OBIEE 11g.
1.      Session Variables
2.      Repository Variables
3.      Presentation Variables
4.      Request Variables

Session Variables:
1.      As the name suggests, session variables are created during the creation of session i.e., as soon as a user logs into the BI server.  So, Every login has its own session variable.
2.      There are two types of session variables
1.       System (which are defined by OBIEE and are reserved)
2.      Non-System which are defined by developers.
3.      Session Variables can be created only through Oracle BI Administration Tool.

Referencing session variable:
For displaying session variables, we should use @{biServer.variables['NQ_SESSION.VariableName']} .
For using session variables in expression, we should use VALUEOF(NQ_SESSION.VariableName).
Repository Variables:
1.       A repository variable is a variable that has a single value at any point in time.
2.      There are two types of repository variables
1.      Static (which changes only if admin or developer changes it value)
2.      Dynamic ( value is refreshed using a query)
3.      Repository variables can be created only through Oracle BI Administration Tool.

Referencing repository variable:
For displaying repository variables, we should use @{biServer.variables.VariableName} or @{biServer.variables['VariableName']}.
For using repository variables in expression, we should use VALUEOF(VariableName) for static variable and for dynamic variable VALUEOF(Dynamic Initialization Block Name.VariableName).
Presentation Variable:
1.      A presentation variable is a variable which can be created as a part of creation of dashboard prompts. Dashboard prompts must be either Column Prompt or Variable Prompt.
2.      The value of presentation variable is set by the prompt for which it is created (upon user selection).

Referencing presentation variable:
For displaying presentation variables, we should use either
1.      @{variables.VariableName}[Format]{DefaultValue}  or
1.      Format and DefaultValue are optional
2.      Format is useful to format the data for e.g., for Date, format can be MM/DD/YYYY. Note: Default Value is not formatted.
3.      @{scope.variables['VariableName']}.
1.      Scope should be used if you create variables with same name.
2.      Scope can be analyses, dashboard etc.
3.      Order of precedence is analyses, dashboard pages, dashboards.
For using presentation variables in expression, we should use @{VariableName}{DefaultValue}. Default value is optional.
Request Variable:
1.      Request Variable is used to overwrite the value of session variable and it happens only during request initiation to the database from column prompt.
Can be created only during the creation of column prompt.


No comments:

Post a Comment