Skip to main content
Question

Hi Celopeers,Can anyone help with a filter function to select all cases in a 12 month period leading up to a specific date?So like all cases in the 12 months to 30th April 2023?

  • May 4, 2023
  • 3 replies
  • 3 views

Forum|alt.badge.img+14
Hi Celopeers, Can anyone help with a filter function to select all cases in a 12 month period leading up to a specific date? So like all cases in the 12 months to 30th April 2023?

3 replies

Lets imagine you want cases with at least one activity in the last 12 months....

 

FILTER ACTIVITY_TABLE()."EVENTTIME" > ADD_MONTHS(TODAY(),-12)


Forum|alt.badge.img+14
  • Author
  • Level 2
  • 3 replies
  • May 9, 2023

Lets imagine you want cases with at least one activity in the last 12 months....

 

FILTER ACTIVITY_TABLE()."EVENTTIME" > ADD_MONTHS(TODAY(),-12)

Thanks again @Guillermo Gost for your help. I had been looking at the ADD_DAYS, ADD_MONTHS but wasn't sure it was the correct approach.

Was hoping to avoid using TODAY() as this is essentially a moving target.


Thanks again @Guillermo Gost for your help. I had been looking at the ADD_DAYS, ADD_MONTHS but wasn't sure it was the correct approach.

Was hoping to avoid using TODAY() as this is essentially a moving target.

Do you want always a fixed date? Or maybe a moving target but like init or end of month?

 

Fixed date will be something like this instead of the TODAY()

 

TO_DATE('30-4-2023', FORMAT ('%d-%m-%Y')

 

BTW if the date string comes from a table and you get other data formats (like the name of the month instead of the number, or a 2 digit for the year) Celonis is a bit limited compared to datetime library... so you will need to apply some CASE WHEN to convert (like CASE WHEN "April" THEN 04...)