Working with Dates in Oracle Data Visualization Cloud — Oracle Analytics

Oracle Analytics Cloud and Server

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

Working with Dates in Oracle Data Visualization Cloud

Received Response
101
Views
4
Comments

Summary

Working with Dates in Oracle Data Visualization Cloud

Content

Hi There

How can i check if a date is less or greater than one specific date when writing a condition:

in my example the field which contains my dates is called CSSD.

I set the properties for this field  as measurement and date (data type).

i wrote the condition below but it not displaying any information

What should I do different to make this condition to work?

Thanks

Answers

  • Satya Surisetti
    Satya Surisetti Rank 2 - Community Beginner

    Since your CSSD Date is in date format and as you are comparing the date with string you need to cast your date to string and then compare and it should work as expected. However before applying this logic, check your date format how is it retrieving and then compare your string value matching to your date format ( eg: dd/mm/yyyy or mm/dd/yyyy or yyyy/mm/dd)

    Your modified logic should look like below.

    CASE WHEN CAST(CSSD AS CHAR) > '12/01/2017' THEN 'YES' ELSE 'NO' END

    Rgds

    Satya

  • Jose Casquero
    Jose Casquero Rank 4 - Community Specialist

    Hello,

    I have still problems because the information is displayed without following the rule added in the calculation called test1

    is there any alternative solution?

  • Jose Casquero
    Jose Casquero Rank 4 - Community Specialist

    it works !!!  it is quite tricky to do it but I will keep it on mind.

  • FTisiot
    FTisiot Rank 6 - Analytics Lead

    In my opinion what ​ is suggesting is not 100%:

    CASE WHEN CAST(CSSD AS CHAR) > '12/01/2017' THEN 'YES' ELSE 'NO' END

    you are casting the dates as char and then sorting both values by alphabetical order??? (this could cause problems in case you specify days with only 1 digit).  Shouldn't it be the other way around?

    CASE WHEN CSSD > cast('2012-01-03 00:00:00' as date) THEN 'YES' ELSE 'NO' END

    In this way you're actually comparing dates (not strings) , i've done a check and it works. Be aware that i got an error until i specified the 00:00:00 (hour:time:sec)

    2017-04-18_12-52-02.png