Oracle Analytics Cloud and Server

OBIEE12c. Count of chosen elements in parameter

Received Response
21
Views
4
Comments
Frog Toad
Frog Toad ✭✭✭

Hi

I have dashboard with prompt.

In prompt i chosen some values and i send result to analysis.

I choisen values:

Prompt.jpg

Now, in analysis i want get number of chosen values - 3.

How i can get this?

The number of chosen values i put in a special presentation variable - it string-variable, where values are divided by commas

I see only one solution to the problem: use the function "EVALUATE"

Namely, the following: create store procedure in database, where i split a string-parameter to elements, count it and return result to OBI.

Is there a better way to count the number of values in the prompt?

Answers

  • If you are selecting effective members in a dimensional attribute then you can just do a COUNT(DISTINCT attrib.column). If you have pure variables without anything structural behind it then you'll need to split the string.

  • What Christian said is a clean way of doing things.

    If for any reason you can't do that there are other options, EVALUATE and a stored procedure is a bit ... too much ....

    If the separator of your values in the variable is a comma and your values are numbers (without the comma) you can easily do it by doing something like:

    1+CHAR_LENGTH('10,12,14,16') - CHAR_LENGTH(REPLACE('10,12,14,16', ',', ''))

    (I used a string instead of a presentation variable but same business ....)

  • Frog Toad
    Frog Toad ✭✭✭
    Gianni Ceresa написал(а):
    1+CHAR_LENGTH('10,12,14,16') - CHAR_LENGTH(REPLACE('10,12,14,16', ',', ''))
    
    

    In this case, the solution is suitable for me. Thanks, Gianni Ceresa

    Christian Berg, thanks too

  • Any time