Oracle Analytics Cloud and Server

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

Using system session variables in RPD formulas

Received Response
291
Views
6
Comments
mthompson
mthompson Rank 2 - Community Beginner

In Answers, I can create this formula to return the user's time zone: '@{session.timeZone}'

Is there a way to create that formula, or something similar, in the Business Model layer of the RPD, so that it can become a simple selectable column in the subject area, and thereby avoid having to build the custom formula in an analysis? I've tried every type of syntax I can think of to reference a system session variable within a logical column in the RPD, none of which work.

I am able to create a logical formula such as VALUEOF(NQ_SESSION.LOGLEVEL), which references the LOGLEVEL system session variable, and that one works, but only because I am setting LOGLEVEL in an initialization block, which makes it appear in the list of selectable session variables on the Expression Builder. The timeZone is set in the user interface under My Account, and therefore doesn't show up in that list. The formula VALUEOF(NQ_SESSION.TIMEZONE) returns 'The session variable NQ_SESSION.TIMEZONE has no value definition.'

Thanks!

Answers

  • [Deleted User]
    [Deleted User] Rank 2 - Community Beginner
  • mthompson
    mthompson Rank 2 - Community Beginner

    Thank you for the reply, Christian. I think I see that I should be using DATA_TZ. But I'm still not finding the right syntax to reference it in a business model layer column. For example, VALUEOF(NQ_SESSION.DATA_TZ) returns "The session variable NQ_SESSION.DATA_TZ has no value definition."

    (Also, the 2nd screenshot appears to indicate that we can create a new variable that is one of several different types, but when I right-click the right-hand side of the Variable Manager dialog and select New...TimeZone, the Name field in the subsequent dialog is grayed out. )

  • [Deleted User]
    [Deleted User] Rank 2 - Community Beginner

    It may not have no value definition by default but you can fill it yourself with an init block.

  • mthompson
    mthompson Rank 2 - Community Beginner

    An init block would be just fine as well. My problem is the syntax: When a user has set their timezone using the My Account option at the top right of the OBIEE screen, I don't know how to write the correct syntax, in an RPD object, to refer to that. In an analysis, I can refer to it using the Presentation Services syntax, which is  '@{session.timeZone}'. But I'm not finding the correct syntax for referring to it in an RPD object, such as an init block or a logical column formula.

    I have tried many different methods, such as:

    select :USER.DATA_TZ from dual

    select ':USER.DATA_TZ' from dual

    select :DATA_TZ from dual

    select DATA_TZ from dual

    select ':DATA_TZ' from dual

    select valueof(NQ_SESSION.DATA_TZ) from dual

  • While not being what you are asking, what about saving your analysis column for now as workaround?

    Users will find it in the catalog and can easily add it to any analysis where they need it just with a double-click (or drag & drop). It will contain whatever formula you save in it.


  • mthompson
    mthompson Rank 2 - Community Beginner

    Gianni, yes, that will work. And it that's what I must do, then I will But I would still like to know that there either is, or absolutely is not, a way to refer to system session variables in the RPD. Thanks for the reply and the suggestion.