Oracle Analytics Cloud and Server

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

How can i extract a year from a date prompt and display it in my table

Received Response
81
Views
3
Comments
User_WJS22
User_WJS22 Rank 1 - Community Starter

Hello i am using OBIEE  12.2.1.3.0 

I have a date prompt and i would like to extract the year of  this year prompt and put the year as  a variable  in my table ( look the picture below )

2020.png

1 - i would  like to know if it's possible to do that 

2 - I need an indication about how to do it 

Thank you for your usual help !

Answers

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

    Is that prompt really a "date" prompt i.e. a specific day? Does it set a real "date" context or does it actually just filter for the year?

    For column headings things are tricky as you must use variables and hence that value must be written into a variable - which brings us back to my initial question.

  • User_WJS22
    User_WJS22 Rank 1 - Community Starter

    Hello Christian , Thank you

    the prompt is a "date"  but i use it to filter all cumulative data till this  date  

    ex : if i chose 30/06/2019    , i sum   all the indicators  till  30/06/2019 .   But i  would like to extract the month and the year from this date and display it into my column headings then it will be dynamic.

    Thank you

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

    Hmm ok. AS I said in the column header you only reference variables - you can't do a calculation/transformation - which means your date input has to be transformed into a pure year value in an intermediate step.

    pastedImage_0.png

    So you'll basically need a second - hidden - prompt object which takes the date presentation variable as an input and spits out the year alone as a new presentation variable as either a string or a number. Don't know how your year is stored.