Oracle Analytics Cloud and Server

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

An "is between" prompt which sets a presentation variable: how to reference values in the filter?

Received Response
41
Views
2
Comments
Dimitry F.
Dimitry F. Rank 3 - Community Apprentice

Hello,

I have a "Fiscal Year" column prompt with an "is between" operator. Obviously, an user has to enter two values - "beginning of range" and "end of range". And there's also a presentation variable varRange being set by this prompt.

Now, I want to put a filter which is basically to only use Fiscal year between those "beginning of range" and "end of range" values entered by user. I know I don't need to have a presentation variable for this, and simply use "is prompted". But still, if I were to use the presentation variable's value for this filter, how do I do that? I mean, varRange variable now holds two values, so how do I split the varRange variable into two values - "beginning of range" and "end of range"? Can I use an array-like syntax, something like @{varRange}->[0] and @{varRange}->[1] ?

Answers

  • Jerry Casey
    Jerry Casey Rank 6 - Analytics Lead

    The value passed by your prompt will look like 2018,2019. You'll have to parse it and cast as an integer or leave as text, depending on your need.

    first value: CAST(LEFT('@{dashboard.variables['presvar']}',POSITION(',' IN '@{dashboard.variables['presvar']}')-1) as INTEGER)

    second value: CAST(SUBSTRING('@{dashboard.variables['presvar']}' FROM POSITION(',' IN '@{dashboard.variables['presvar']}')+1 FOR 20) AS INTEGER)

    You may be able to just use the '@{presvar}' syntax, instead of '@{dashboard.variables['presvar']}'.  I get lost on when to use which one, but I know I have to use the latter in some filters.

  • Dimitry F.
    Dimitry F. Rank 3 - Community Apprentice

    Excellent. Thank you, Jerry!