Custom Filter for "Year to Date on Last Year to the same date Last Year"

Knowledge Drop

Last tested: Jan 21, 2019


In custom filters:


((extract_years(now())=extract_years(${download_stats.timestamp_year})

AND ${download_stats.timestamp_year} <= now())



OR



(((extract_years(now())-1)=extract_years(${download_stats.timestamp_year})

AND ${download_stats.timestamp_year} <= add_years(-1,now()))



AND



(extract_months(${download_stats.timestamp_date}) = extract_months(now())

AND

extract_days(${download_stats.timestamp_date}) <= extract_days(now()))



OR



extract_months(${download_stats.timestamp_date}) < extract_months(now())))

This content is subject to limited support.                

Comments
Scott_Bennett
Observer

I found a way to find the YTD total of the previous year compared to the YTD Total of the last complete month.  Here’s the custom filter I used:

DATE-FIELD-YEAR​​​​​​=trunc_years(add_years(-1,now())) AND extract_months(DATE-FIELD-MONTH​​)<extract_months(trunc_months(now()))

The DATE-FIELD-YEAR is the date field you’re filtering on, but specifically the year

The DATE-FIELD-MONTH is the date field you’re filtering on, but specifically the month

I hope that helps!  Scott

Version history
Last update:
‎04-05-2021 03:17 PM
Updated by: