Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

6 Month Rolling Within 12 Month Rolling

Hi there,

I am working on a bar chart that counts a number of issues raised and shows it for the last 12 months (starting from the previous month). So for example, this month is May 2017; this means the bar chart will show from April 2017, going back to May 2016.

Within each bar representing the months, I want to see the count of issues for the past 6 months - April 2017 should show a total of the count of issues for April, March, February, January, December, November. and then the same pattern for the other 11 months.

So far my set analysis is as follows to achieve the 12 month rolling (Static) chart:

COUNT(DISTINCT{1<NM_IncEventDate={'>=$(=MonthStart(AddMonths(Max(NM_IncEventDate),-12))) <=$(=MonthEnd(AddMonths(Max(NM_IncEventDate),-1)))'}>}NM_ID)

This only counts for each individual month, so how do I get each month within this 12 month range, to total up the last 6 months performance?

I have also attached a photo of the graph so far, below:

Thank you

Labels (1)
  • Chart

10 Replies
aamirSiddiquee1
Contributor
Contributor

Please use the following Set analysis for your work-

 

Sum({1<NM_IncEventDate = {'>=$(=MonthStart(AddMonths(Max(NM_IncEventDate),-12))) <=$(=MonthEnd(AddMonths(Max(NM_IncEventDate),-1)))'}>} Aggr(RangeSum(Above(Count({1} DISTINCT  NM_ID), 0, 6)), MonthYear))