Hi Team,
The formula below was built as a beastmode but would like to move it to dimensions, the backend. However, "DATEDIFF()" isn't recognized in Redshift, any workarounds? Thanks
CASE
when
("date","published_date") >0 and
DATEDIFF("date","published_date") <=29 then '01 Month'
when
DATEDIFF("date","published_date") >29 and
DATEDIFF("date","published_date") <=59 then '02 Months'
when
DATEDIFF("date","published_date") >59 and
DATEDIFF("date","published_date") <=89 then '03 Months'
when
DATEDIFF("date","published_date") >89 and
DATEDIFF("date","published_date") <=119 then '04 Months'
when
DATEDIFF("date","published_date") >119 and
DATEDIFF("date","published_date") <=149 then '05 Months'
when
DATEDIFF("date","published_date") >149 and
DATEDIFF("date","published_date") <=179 then '06 Months'
when
DATEDIFF("date","published_date") >179 and
DATEDIFF("date","published_date") <=209 then '07 Months'
when
DATEDIFF("date","published_date") >209 and
DATEDIFF("date","published_date") <=239 then '08 Months'
when
DATEDIFF("date","published_date") >239 and
DATEDIFF("date","published_date") <=269 then '09 Months'
when
DATEDIFF("date","published_date") >269 and
DATEDIFF("date","published_date") <=299 then '10 Months'
when
DATEDIFF("date","published_date") >299 and
DATEDIFF("date","published_date") <=329 then '11 Months'
when
DATEDIFF("date","published_date") >329 and
DATEDIFF("date","published_date") <=359 then '12 Months'
ELSE '>13 Months'
end)