Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
zagzebski
Creator
Creator

Getting a range in set analysis (variable + 11 months)

There are probably several ways to do but I need to return a sum of sales for a period equal to the value of a Year Month variable + 11 months.

For instance:

Year Month Variable = 201311 (which represents year and month)

Data (yellow represents the 12 months data I need to sum -  201311 through 201410). Obviously the issue is with a Year Month field I can't just add 11 to the variable:

CompanySales_YearMonthSales
A2013095
A20131010
A20131115
A20140520
A20140625
A20140830
A20140935
A20141240
A20150145
A20150250

Thanks in advance,

Steve

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

=SUM({<,YourDateField =, YourMonthField = , YourQuarterField =, YourYearField = ,YearMonth = {">=$(=Date(AddMonths(Date#(Max(YearMonth),'YYYYMM'),11),'YYYYMM'))<=$(=Max(YearMonth))"}>}Sales)

View solution in original post

5 Replies
MK_QSL
MVP
MVP

=SUM({<,YourDateField =, YourMonthField = , YourQuarterField =, YourYearField = ,YearMonth = {">=$(=Date(AddMonths(Date#(Max(YearMonth),'YYYYMM'),11),'YYYYMM'))<=$(=Max(YearMonth))"}>}Sales)

zagzebski
Creator
Creator
Author

Thanks!!

Steve

Anonymous
Not applicable

Sorry to "steale" this thread, but i just know this answer would help me solve my problem, but I can not get it to work.

Can someone explain it for me, and help me understand 🙂

My period is on the format YYYYMM ('acc_period'), and my Sales is amount.

What shall I Write to make this work?

Anyone? 🙂

MK_QSL
MVP
MVP

Create a new Question/Thread please !

anitamelbye
Creator
Creator

I got it! Thx

(After trying 50 times) 🙂