CASE WHEN {trandate} BETWEEN '01/01/2023' AND '01/...
# suiteanalytics
j
CASE WHEN {trandate} BETWEEN '01/01/2023' AND '01/31/2023' THEN {amount} ELSE 0 END How do i get this to be relative so when date is in the month start and end date of the month this year
r
There's an Add_months function that would probably work. I think you can use negatives with that.
s
this might work (untested):
CASE WHEN LAST_DAY({trandate}) = LAST_DAY({today}) THEN {amount} ELSE 0 END
LAST_DAY should return the last day of the month for the date parameter passed to it, and should give equal results if both dates are in the same month