0 Replies Latest reply on Feb 17, 2017 10:07 AM by Snehasis Pradhan

    Using parameter in calculated field to filter data with date range

    Snehasis Pradhan

      Hi Guys,

       

      I have data of last 364+90 days in the data set

      in my graph, I want to have a parameter [timeperiod] with 2 values, which would show- Last 90 days(BETWEEN TRUNC (SYSDATE - 90) AND TRUNC (SYSDATE - 1) , this is a oracle query)

       

       

      and Previous year Last 90 days(BETWEEN TRUNC (SYSDATE - 90 - 364) AND TRUNC (SYSDATE - 1 - 365)

      I wanted to create a calculated filed and use the Parameter to filter my data as per the selection. I have want something like this

       

      if [timeperiod] ='Last90'

      then DATE BETWEEN (TODAY()-90) AND (TODAY()-1)

      ELSE

      DATE BETWEEN (TODAY()-454) AND (TODAY()-364)

      END

       

      I know this wont work, but hope I tried to explain what I wanted. Kindly help me with the calculated field syntax which would give the same output for my situation.

       

      Thank you!!