Skip to main content
I am trying to create a component filter for "the running past 24 months".
- I can get a "since 2022" to work, but I can't get a floating filter, like "for the past two years" to work.

Can you help me with the general syntax?

Thank you.

Hi @karl.guent,

 

Very good question, I never tried this but I got something working.

 

FILTER YEAR ("ACTIVITIES_TABLE_PO"."EVENT_TIME") => (YEAR(TODAY()) - 2);

 

Let me know if this works on your end. Please validate the results 😁

 

EDIT: I think it should be => rather than >, I changed this.

 

Kind regards,

Sverre Klein


Hi,

for the past 24 months simply use ADD_MONTHS(TODAY(),-24) in the comparison, i.e.

FILTER Table.Date >= ADD_MONTHS(TODAY(),-24)

BR

Stephanie


Wow! These are both awesome!

  • Stephanie ... The "TODAY -24 is truly elegant.
  • Sverre ... the From => To approach is the way I was also thinking.

Hi,

for the past 24 months simply use ADD_MONTHS(TODAY(),-24) in the comparison, i.e.

FILTER Table.Date >= ADD_MONTHS(TODAY(),-24)

BR

Stephanie

Very nice, thanks Stephanie! 😊


Reply