Skip to main content

Hi,

I would like to show a dropdown in analyses with options as Last 30 days, Last 60 days, Last 90 days etc which should then filter analyses based on that date range. My code for the dropdown looks like this but it seems it is not displaying results correctly as results for say October month differ if I select Last 60 or Last 90 days.

 

CASE

 WHEN

   "Case"."Submission_Date_Time" > ADD_DAYS((TODAY()),-30)

 THEN

  'Last 30 days'

 WHEN

   "Case"."Submission_Date_Time" > ADD_DAYS((TODAY()),-60)

 THEN

  'Last 60 days'

 WHEN

   "Case"."Submission_Date_Time" > ADD_DAYS((TODAY()),-90)

 THEN

  'Last 90 days'

 WHEN

   "Case"."Submission_Date_Time" > ADD_DAYS((TODAY()),-365)

 THEN

  'Last 365 days'

 ELSE 'Greater than 365 days'  

END

 

Any help in this regard is appreciated.

Hi Sameer,

The CASE WHEN will put your Case in the first condition that is true. So a case that is submitted in the last 30 days will only be in 'Last 30 days', and not in any of the others.

You could try to use a drop down to populate a variable, e.g. "number_of_days" and use the value of this variable in your ADD_DAYS statement and use this as component filter.


Reply