Oracle Analytics Cloud and Server

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

OBIEE 12c how to implement case statement in Narrative view based on prompt value

Received Response
460
Views
5
Comments
rajk5
rajk5 Rank 3 - Community Apprentice

Hi Gurus,

We have a dashboard with a prompt that has drop down values as Daily, Weekly, Monthly, Quarterly and Yearly.

Now my report is a pivot table with a narrative view.

Requirement is when user selects Daily,  then i need to show "Previous day" in narrative view. If user selects Weekly then narrative to show "week to date" and so on.

I am trying to use a case statement in the narrative view but instead of evaluating the case statement, i see the entire text of case statement when i run report.

Can any one please suggest how to implement this.

Thanks in advance,

Answers

  • Hi,

    I assume you have an analysis (a report is a BI Publisher report).

    A narrative view in an analysis is a fairly basic view which doesn't support any logic by itself as it's supposed to only have "text" inside.

    Do you 'just' need to change a title or something like that in your narrative or "Previous day", "Week to date" etc. represent totally different pieces of texts?

    If it's just a title you can move the logic, your CASE WHEN, into the analysis logic by adding a column which simply evaluate that formula (and therefore return you the same text for every single row of result), and in your narrative you reference that column (because that works in a narrative, using the @x to reference columns of the analysis).

  • Christian Berg-0racle
    Christian Berg-0racle Rank 10 - Analytics Guru

    Let's take a step back and look at this:

    rajk5 wrote:We have a dashboard with a prompt that has drop down values as Daily, Weekly, Monthly, Quarterly and Yearly.

    What does that prompt DO? *Exactly*? Because it more sounds like a problem created by really, really bad front-end design/usage and not a product limitation.

  • M De Fanti
    M De Fanti Rank 2 - Community Beginner

    Hi,

    I think that the prompt should be a variable prompt.

    Then you should use the variable value to conditionally change the formula of a column in the criteria tab, something like:

    INDEXCOL(

    CASE '@{PVAR}{Daily}'

    WHEN '' THEN 0

    WHEN 'Daily' THEN 1

    WHEN 'Montly' THEN 2

    END ,

    '0',

    'FILTER(MEASURE USING DATE=....)',

    'FILTER(MEASURE USING WEEK=....)')

    The narrative view sholud only show the column content.

  • Christian Berg-0racle
    Christian Berg-0racle Rank 10 - Analytics Guru

    There are tons of hacks which will achieve this, but the question most likely originated in a weird interpretation of what is really intended.

    What needs to be achieved is important.The HOW is a function of that - it shouldn't be a purpose in and of itself

  • M De Fanti
    M De Fanti Rank 2 - Community Beginner

    Hi,

    I was trying to help, figuring out what he what was he trying to do, Without waiting for a formally perfect question.

    Eventually if rjak was looking for something other, he will ask again.