I’m working on the same and stuck as well and comparing the last 14 days to the same 14 days last year. My solution works, but it’s not great and I’m curious if there is a better, built in way
My solution current is a a series of 2 calculated fields:
Reporting Day Value (example is show the last 3 days) This is used on the X-axis-
ifelse(
dateDiff({reporting_enroll_date},${DailyRun},“DD”) = 365, 14,
dateDiff({reporting_enroll_date},${DailyRun},“DD”) = 0, 14,
dateDiff({reporting_enroll_date},${DailyRun},“DD”) = 366, 13,
dateDiff({reporting_enroll_date},${DailyRun},“DD”) = 1, 13,
dateDiff({reporting_enroll_date},${DailyRun},“DD”) = 367, 12,
dateDiff({reporting_enroll_date},${DailyRun},“DD”) = 2, 12,
0
)
Reference Day (this shows if the data should be included in “this year” or “last year” and is used in the color field well)
ifelse(
dateDiff({reporting_enroll_date},now(),“DD”) <=14, ‘Current’,
dateDiff({reporting_enroll_date},now(),“DD”) >365 and dateDiff({reporting_enroll_date},now(),“DD”) <=379, ‘Last Year’,
‘Not included’
)