Oracle Analytics Cloud and Server

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

Using Session Variables in Data Filters for Datasets - OAC

Accepted answer
258
Views
21
Comments

We are getting inconsistent behavior trying to use Session Variables in Datasets Expression Filters.

Anyone have success?

image.png image.png

Best Answer

«13

Answers

  • [Deleted User]
    [Deleted User] Rank 7 - Analytics Coach

    Hi Wayne,

    How did you get the first one to parse in the first place? In all test cases I tried it is shown as unsupported.

  • Hi,

    I never managed to get a valid validation, always got the "Invalid Expression. Session variables are not supported".

    And I tried a number of times…

  • Wayne Van Sluys
    edited Feb 17, 2025 5:42PM

    @Christian Berg-0racle - got lucky. I can get you in a zoom call to show you.

    First one was done by one of my colleagues and he nor I cannot replicate (my second screen cap) in different dataset.

    His first one actually works which is great.

  • Interesting…

    We were able to copy the reference to Session Variable out of working into different Dataset and it Validated.

  • Now I'm curious: when it validate, does it work as expected?

    Because if it does, I'm very much curious to know why the not-validating message is that the session variables are not supported there.

  • [Deleted User]
    [Deleted User] Rank 7 - Analytics Coach

    "His first one actually works which is great."

    No it's not it's rather extremely preoccupying 🤣 I'll try to use the copy+paste approach in a sample.

  • [Deleted User]
    [Deleted User] Rank 7 - Analytics Coach
    edited Feb 18, 2025 12:37PM

    Update: It works when you write it without any space. h/t to @Gianni Ceresa

    image.png

    Imagine how great it would be if we could still see the raw object definition to find out just how that JSON is written and what the interface tries to write today…

  • Thanks Wayne for the 'space' hint, that is the key to get it validated.

    The fun thing is that the validation error doesn't come from the backend, it's a front-end limitation.

    With a space after the '=' the front-end javascript doesn't even send a request to /ui/dv/ui/api/v1/queryvalidation/wheresto check for validation, it does display the error directly. I'm quite sure that if I send a validation request to that URL (it's a POST call to that URL) with the space, it will probably return result: 'pass'as well.

    Therefore, I would say it's a bug: a front-end javascript check isn't aligned with the back-end check.

  • And confirmed!

    /ui/dv/ui/api/v1/queryvalidation/whereswill happily validate the usage of a session variable there, even spaces around the = .

    It's really just the front-end blocking the validation, and not even sending the async call to the back-end for it.