Session Variables

You can use the following guidelines for referencing session variables in expressions.

  • Include the session variable as an argument of the VALUEOF function.
  • Enclose the variable name in double quotes.
  • Precede the session variable by NQ_SESSION and a period.
  • Enclose NQ_SESSION in double quotes.
  • Enclose both the NQ_SESSION portion and the session variable name in parentheses.

For example:

"Market"."Region"=VALUEOF("NQ_SESSION"."SalesRegion")

System Session Variables

There are several system session variables that you can use in your reports and dashboards.

The system session variables have reserved names so you can’t use them for any other kind of variable.

Modelers can define values for these session variables in Data Modeler. See Create Variables to Use in Expressions. Note that in Data Modeler, a session variable is defined with the Update Value set to On sign in.

System Session Variable Description Example SQL Query Value (Variable dialog)

PORTALPATH

Identifies the default dashboard a user sees when they sign in (they can override this preference after signing in).

To display ‘mydashboard’ when a user signs in:

 select ‘/shared/_portal/mydashboard’ from dual;

TIMEZONE

Specifies the default time zone for a user when they sign in.

A user’s time zone is typically populated from the user’s profile. Users can change their default time zone through preferences (My Account).

To set the time zone when a user signs in:

select ‘(GMT-08:00) Pacific Time (US & Canada)’ from dual;

DATA_TZ

Specifies an offset from the original time zone for data.

This variable enables you to convert a time zone so that users see the appropriate zone.

To convert time data to Eastern Standard Time (EST):

select ‘GMT-05:00’ from dual;

This example means Greenwich Mean Time (GMT) - 5 hours

DATA_DISPLAY_TZ

Specifies the time zone for displaying data.

To display Eastern Standard Time (EST):

select ‘GMT-05:00’ from dual;

This example means Greenwich Mean Time (GMT) - 5 hours

Non-System Session Variables

The non-system session variables are named and created in your semantic model.

For example, your data modeler might create a SalesRegion variable that initializes to the name of a user's sales region when they sign in.

Modelers can define values for these session variables in Data Modeler. See Create Variables to Use in Expressions.