Reference variable expressions within Oracle BI Answers

Variables such as System or Session can be referenced witin Oracle BI Answers. To reference a variable with a expression, the following syntax is available for referencing the Login User Name:



This can be used within a Narrative View to display information about the current User or Session:


The following can be used as example:

[b]User Name:[/b] @{user.displayName}{default} <BR>
[b]User Name:[/b] @{biServer.variables['NQ_SESSION.USER']} <BR>
[b]Roles:[/b] @{biServer.variables['NQ_SESSION.ROLES']} <BR>
[b]Group:[/b] @{biServer.variables['NQ_SESSION.GROUP']} <BR>
[b]Group:[/b] @{biServer.variables['NQ_SESSION.WEBGROUPS']} <BR>


For further reference, check the official Documentation:


Tip: Using Row-wise variables and Initialization Blocks


Tip: Using Row-wise variables and Initialization Blocks

It is often required to use row-wise variables (array’s) to store a list of items. E.g. For the security/visibility it may be required to store the Organization a User has access to. This can be achieved using row-wise variables and Initialization Blocks from OBIEE.

SELECT ‘ActiveOrgs’, OrganizationTable.Name
FROM OrganizationTable
WHERE OrganizationTable.Use = ‘:USER’

This will initialize the Variable ActiveOrgs with the results of the Initialization Blocks. This variable can than be used at other places to filter the respective Organizations.


Correct syntax to access variables from Oracle BI Answers

For debugging it can be useful to access session variables of the Oracle BI Server. E.g. to display the current login user Id and the current loglevel of that user:

The syntax is not everywhere the same in the Oracle BI Server. The correct syntax to access the variables from Answers is the following:

current user: @{biServer.variables['NQ_SESSION.USER']} 
current loglevel: @{biServer.variables['NQ_SESSION.LOGLEVEL']}