Oracle Analytics Cloud and Server

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

Presentation variables in the between prompt

Received Response
371
Views
3
Comments
Venkata Rachuri
Venkata Rachuri Rank 5 - Community Champion

Hi Gurus,

I have a prompt  which values between two dates as shown in the attachment. Is there any way to just capture only one date in the presentation variable ?

For ex : User chooses 04/01/2018 to 04/24/2018. I just want to capture 04/24/2018 and use it to populate calculated field.

Thnaks

Venkat

Answers

  • Martin van Donselaar
    Martin van Donselaar Rank 6 - Analytics Lead

    The presentation variable that the prompt creates will store the dates like 04-01-2018,04-24-2018  (dates are separated by column)

    You can get the second date like this: SUBSTRING('@{pVar}' FROM POSITION(',' IN '@{pVar}')+1 )

    Date format in the presentation variable string can vary based on your NLS settings

  • Robert Angel
    Robert Angel Rank 8 - Analytics Strategist

    Your other option is to create two dashboard prompts one for the from, the other for the two, populating presentation variables and then filtering based on these with two separate filters, or one sql based file, in your analysis.

  • Adam Wickes
    Adam Wickes Rank 6 - Analytics Lead

    Something similar to the following will also work (where p_test = the name of your variable).

    SUBSTRING('@{p_test}{01/01/1900}' FROM LOCATE(',', '@{p_test}{01/01/1900}')+1 FOR LENGTH('@{p_test}{01/01/1900}')-LOCATE(',', '@{p_test}{01/01/1900}'))


    Martin's method is by far the cleanest though.