Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Rolling 12 month set analysis

Hi,

I thought I had an answer for my rolling 12 month problem, but unfortunately it doesn't work correctly.

This is my expression inkl. set analysis:

Count({<closed_yearmonth={"<=$(=date(MonthStart(Today(),-1),'YYYYMM'))) >= $(=Date(MonthStart(Today(),-13), 'YYYYMM'))"}>}DISTINCT ID)

I assumed that my bar char would show the values from May 2014 to May 2015 (ok, we only have data starting from April 2015, so April 2015 and May 2015) - but it shows June data as well.

Does anyone know why I have June data in there?

Thanks in advance!

5 Replies
Anonymous
Not applicable
Author

Hi,

I hope this help you!

Count({$< closed_yearmonth= {"<=$(=addmonths(max(Datefiel),-12,1))>=$(=addmonths(min(DateFiel),-12))"}>}Distinct ID)

Regards!!.

Not applicable
Author

Hi,

thank you.

I adjusted it to

Count({$< closed_yearmonth= {"<=$ (=date(AddMonths (max(MonthStart(today())),-13),'YYYYMM')) >= $(=date(AddMonths(min(MonthStart(today())),-13),'YYYYMM')) "}>}Distinct ID)

but I have the same issue here. It doesn't matter if I choose -1 or -12 or -20, it always displays all data I have

PrashantSangle

Hi,

Try like

Count({$< closed_yearmonth= {"<=$ (=date(MonthStart(today())-1,'YYYYMM')) >= $(=date(AddMonths(MonthStart(today()),-12),'YYYYMM')) "}>}Distinct ID)

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

I think I solved by myself. I think there was one bracket too much

Count({$<closed_yearmonth={"<=$(=date(MonthStart(Today(),-1),'YYYYMM')) >= $(=Date(MonthStart(Today(),-13), 'YYYYMM'))"}>}DISTINCT ID)

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

There is another way of approaching this without Set Analysis, which I find quite flexible and useful.

I've described it in this blog post:

http://www.quickintelligence.co.uk/qlikview-accumulate-values/

Steve