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

Month Vs Rollign 12 months in combo chart

Hi all,

 

I have requirement to have a combo chart with month-wise date vs 12 months rolling. attached the screenshot.

 

the screenshot dimension has to be the last 12 months and the bar has to be month-wise data and line or dot has to be 12 months rolling.

I have achieved the dimension and month-wise data but the rolling 12 months not happening

 

example 

dim have last 12 months Jan18-dec 18-> this is achived by selecting the limitation--> fixed number--> top as 12 .

exp 1 has been achieved based on the period I select.

if(GetFieldSelections(Period)='12 Months Rolling',
sum({<Month_Year1={"$(vPeriodType)"},Month=,Year=>}[ Quantity]),

if(GetFieldSelections(Period)='YTD',
sum({<Month_Year1={"$(vPeriodType)"},Month=,Year=>}[ Quantity]),,

if(GetFieldSelections(Period)='Monthly',
sum({<Month_Year1={"$(vPeriodType)"},Month=,Year=>}[ Quantity])

)))

where my variable value is 

=if(GetFieldSelections(Period)='12 Months Rolling',
'<=$(=Date(MAX(Month_Year1),'MMM-YY')) >=$(=Date(AddMonths(MAX(Month_Year1),-11),'MMM-YY'))',
if(GetFieldSelections(Period)='YTD',
'<=$(=Date(MAX(Month_Year1),'MMM-YY')) >=$(=Date(YearStart(MAX(Month_Year1)),'MMM-YY'))',
if(GetFieldSelections(Period)='Monthly',
'<=$(=Date(MAX(Month_Year1),'MMM-YY')) >=$(=Date(MonthStart(MAX(Month_Year1)),'MMM-YY'))')))
 

 

exp 2 as a line chart is not achievable where Jan 18 dimension value shd have the data from feb17-jan18 as 12 months rolling and similarly to the Feb 18 as mar17-feb18. 

 

exp 2 is not achievable. pls suggest and help me how to achieve the 12 months rolling in this scenario.

 

Regards

Mano  

 

 

 

 

Labels (4)
13 Replies
sunny_talwar

Uncheck 'Include zero values' under Add-ons -> Data handling

manoranjan_d
Specialist
Specialist
Author

Hi sunny,

 

In the exp 2 I changed the condition to =If(Column(1) > 0,previous it was =If(Column(1) <> 0, many thanks for the help and great solution. now my requirement satisfied 100%. 

 

Regards

Mano

manoranjan_d
Specialist
Specialist
Author

i got my solution based on your input, may be your solution can help this thread

https://community.qlik.com/t5/Qlik-Sense-App-Development/Show-Rolling-12-Months-of-data-in-Combo-Cha...

Vasunthra_R
Contributor
Contributor

Hi Sunny, 

I have a same case to restrict the dimension to show only 12 months from Max date selected but the Rolling 12 months should be like for Mar 23 data should show from Apr22 to Mar 23, for feb 23 its from Mar 22 to Feb 23 like that it goes on.

I used Rangesum below expression to achieve the rolling data but not able to restrict the chart to show only 12 months of data. could you please help here.

RangeSum(Above(count({<[Enr Flag]={'1'},TableName={'Enrollment'}>}distinct Pat_CP_ID),0,12))