Reputation: 67
I am looking to create the table below, trying to figure out the if statement with dates and buckets and need assistance. note the dates I have do not include days, just mm/yy.
Upvotes: 0
Views: 244
Reputation: 3348
Make a date field by string concatenation to add in a day value.
date('01/'+[your_mm/yyyy_field])
Then create a date bucket field with the newly created [date] calc and comparing to today's date.
if datediff('month',[date],TODAY()) > 1 then 'In past'
elseif datediff('month',[date],TODAY()) = 1 then 'Last Month'
elseif datediff('month',[date],TODAY()) = 0 then 'Current Month'
elseif datediff('month',[date],TODAY()) = -1 then 'Next Month'
else 'Future'
end
Upvotes: 1