Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
See why BI users voted Qlik #1 in 11 categories. GET REPORT
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator
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)
4 Replies
Highlighted
Creator II
Creator II

try this?

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

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
Highlighted
Creator
Creator

Hi Jordy,

 

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

 

will it work there ?? in table

Highlighted
Partner
Partner

Hi Manu,

Then you can do this in the set analysis:

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

Jordy

Climber

Work smarter, not harder