Tuesday, 26 June 2012

OBIEE 11g6: Variables in Oracle OBIEE 11g

There are basically 4 different types of variables in OBIEE 11g.

Session Variables
Repository Variables
Presentation Variables
Request Variables.

Session Variables:

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.
There are two types of session variables
System (which are defined by OBIEE and are reserved)
Non-System which are defined by developers.
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

Repository Variables:

A repository variable is a variable that has a single value at any point
in time.
There are two types of repository variables
Static (which changes only if admin or developer changes it value)
Dynamic ( value is refreshed using a query)
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:

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.
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

@{variables.VariableName}[Format]{DefaultValue} or
Format and DefaultValue are optional
Format is useful to format the data for e.g., for Date, format can be
MM/DD/YYYY. Note: Default Value is not formatted.
Scope should be used if you create variables with same name.
Scope can be analyses, dashboard etc.
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:

Request Variable is used to overwrite the value of session variable and
it happens only during request initiation to the database from column
Can be created only during the creation of column prompt.

1 comment: