Oracle Analytics Cloud and Server

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

passing presentation variable - date field error

Received Response
21
Views
6
Comments
3409791
3409791 Rank 2 - Community Beginner

Hi All,

could anyone please provide some suggestion - I have a field in the RPD which is based on the to_date and it is to get the last day of the month

1)OPV Field - LAST_DAY(TO_DATE(TO_CHAR(TO_DATE(A.REC_CALNDR_PRD,'YYYYMMDD'),'MM/DD/YYYY'),'MM/DD/YYYY')) AS MONTH_ENDING

2). From the Answers it looks like below without any format in the column properties data format

s1.png

3). For testing I create the prompt in answers with a presentation variable - and I choose choice list - so the values in it looks like

s2.png

4). when I specify the filter using presentation variable - Month Ending is equal to / is in  @{vtest} - This is working when I open the answers but when I look at the results it is giving an error "date value was expected"

when we look at the results in answers it should not give me an error - right? it should specify the message or custom message like no results etc

I think I am missing something here - thanks a lot for yur time

Rj

Answers

  • Pedro F
    Pedro F Rank 6 - Analytics Lead

    What do you mean by exactly by this: "This is working when I open the answers but when I look at the results it is giving an error "date value was expected"" ?

    It's normal that you can only see result for your analysis when you have it in a dashboard with the dashboard prompt that sets your presentation variable @{vtest}. If you want to see results inside your analysis, you need to set up a default variable for your variable, something like "Month Ending is equal to / is in @{vtest}{01/31/2017}.

    Is that your issue or it doesn't work at all?

  • 3409791
    3409791 Rank 2 - Community Beginner

    s11.png

    s22.png

    s3.pngs33.png

    when I open the answers - that is when I click on open and when I select a value it is ok - but within the answers when I click on "results" tab it is giving me an error

    when I use a presentation variable it will generally say no data returned something like that - but not a error message - right?

    thanks for your time, It's been a while I used answers - really appreciate your time

    Rj

  • Pedro F
    Pedro F Rank 6 - Analytics Lead

    No, the error you're getting it's normal. The filter is expecting to receive a date value and instead is getting the value 'vTest'. Like I said, in the screenshot that you put there where you set the filter, fill in the box for (default) (just below the one where you put the variable name) and the variable will assume that value as the default one and won't produce the error you see now.

  • Bose Pandian
    Bose Pandian Rank 3 - Community Apprentice

    Hi,

    In Answer, if you want to test the result, then just update the default column with any date value and try. It will not give any error.

    Screen.png

  • Khalid Ibrahim
    Khalid Ibrahim Rank 4 - Community Specialist

    You can also default in the current date or create a repository variable that you can then default to in your prompt.

  • Thomas Dodds
    Thomas Dodds Rank 8 - Analytics Strategist

    In addition to your other issues ... you are burdening the OPV (which is not a performance approach in itself) ...

    1)OPV Field - LAST_DAY(TO_DATE(TO_CHAR(TO_DATE(A.REC_CALNDR_PRD,'YYYYMMDD'),'MM/DD/YYYY'),'MM/DD/YYYY')) AS MONTH_ENDING

    You don't need half the functions...

    LAST_DAY(TO_DATE(A.REC_CALNDR_PRD,'YYYYMMDD')) AS MONTH_ENDING