how do i use a case when statement in a saved sear...
# suiteanalytics
k
how do i use a case when statement in a saved search to pull data between ‘11/01/2019’ to ‘11/30/2019’ ?
k
Why does this need to be a case statement and not standard functionality?
k
i’m trying to get all the taxes collected on a monthly basis for the last 5 months, i need to create buckets of months in the result
11/01/2019 to 11/30/2019 above was just an example
k
Does it have to be in seperate columns? Or can you have the months repeated in the rows?
k
basically the result has to be like this: Tax_Nov19 | Tax_Dec19 | Tax_Jan20 | Tax_Feb20 | Tax_Mar20
in a single row
k
fair enough - just know case statement is gonna suck...
something like this:
Copy code
case when {date} BETWEEN TO_DATE ('2020/02/01', 'yyyy/mm/dd')
AND TO_DATE ('2020/02/29', 'yyyy/mm/dd') then {amount} else 0 end
doesn't look as hard as I first thought.
note haven't actually tried it
k
yep, that was it! thanks a lot!