Announcements
cancel
Showing results for
Did you mean:
Creator

## Rolling Six Months

Hi all,

I have date in format sales date :- 'YYYY-MM'

Now i want to create six months flag..can you please tell me logic.

Kind Regards

Manu

Labels (1)
• ### General Question

1 Solution

Accepted Solutions
Partner - Master

Hi Manu,

Then you can do this in the set analysis:

Sum({\$< Date = {">=\$(=AddMonths(Date,-6) <=\$(Date)"}>} Sales)

Jordy

Climber

Work smarter, not harder
4 Replies
Creator II
try this?

sum({<Date={\$(='>=' & Date(YearStart(addMonths(Date,-5))),'YYYY-MM') & '<=' & Max(Month(Date))}>}sales)
Partner - Master

Hi Manu,

Do you mean an indicator that tells you what the last six months are in your calendar?

Then you can do the following:

``IF(Date(Addmonths(Today(),-6),'YYYY-MM') >= SalesDate,1,0) as _indRLSM // RollingLastSixMonths``

You can use this in set analysis like: Sum({\$< _indRLSM = {1}>}Sales)

Jordy

Climber

Work smarter, not harder
Creator
Author

Hi Jordy,

Unfortunately i have no calendar in my model,i have only this field in actual table,

will it work there ?? in table

Partner - Master

Hi Manu,

Then you can do this in the set analysis:

Sum({\$< Date = {">=\$(=AddMonths(Date,-6) <=\$(Date)"}>} Sales)

Jordy

Climber

Work smarter, not harder