Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Highlighted
Keitaru
New Contributor III

First month of Rolling 12 month count not displaying correctly

Hi,

Having issues with Rolling 12 Months Count on my chart.

Original.jpgOriginal

1:0
2:1
3:12
4:6Rolling 12 montsh.jpgRolling 12 Months

 For some odd reason my 1st month of the rolling 12 months' data is not coming out as compared to the original one above w/o the rolling 12 month 

Here is my code:

Count({<[Res.Severity]={4},[Res.Reported MY],[Res.Reported Date+]={">=$(=addmonths(today(1),-12))<=$(=today(1))"}>}[Res.Incident ID*+])

 

 

 

 

6 Replies

Re: First month of Rolling 12 month count not displaying correctly

Not sure I understand the issue? You have two different dimensions in the chart images that you have shared above? What is the issue. Can you explain more?

Keitaru
New Contributor III

Re: First month of Rolling 12 month count not displaying correctly

Hi Sunny,

First Chart is the original Chart that I had created without rolling 12 Month formula, so its displaying Jan 2018 to Dec 2018 data numbers correctly. 

However, in the second chart after applying rolling 12 Months formula. From Jan 18 to Jan 2019, notice that both original Jan 2018 and Rolling 12 Mnths 2018 data are completely off.

So my question here is how do I rectify this in having both numbers match? as the rest of the Months seem to be in synced.

 

Thank you.

Re: First month of Rolling 12 month count not displaying correctly

What are the expressions for the two charts? The one expression you shared have a set analysis on [Res.Severity] field to show just 4... why in the image we are seeing all 1, 2, 3, & 4? Are you sure you share the right expression?

Keitaru
New Contributor III

Re: First month of Rolling 12 month count not displaying correctly

Where here is the code without the running 12 months but with a static 12 months.

  1. Count({<[Res.Severity]={1}>}[Res.Incident ID*+])
  2. Count({<[Res.Severity]={2}>}[Res.Incident ID*+])
  3. Count({<[Res.Severity]={3}>}[Res.Incident ID*+])
  4. Count({<[Res.Severity]={4}>}[Res.Incident ID*+])

here are the codes for running 12 months

  1. Count({<[Res.Severity]={1},[Res.Reported MY],[Res.Reported Date+]={">=$(=addmonths(today(1),-12))<=$(=today(1))"}>}[Res.Incident ID*+])
  2. Count({<[Res.Severity]={2},[Res.Reported MY],[Res.Reported Date+]={">=$(=addmonths(today(1),-12))<=$(=today(1))"}>}[Res.Incident ID*+])
  3. Count({<[Res.Severity]={3},[Res.Reported MY],[Res.Reported Date+]={">=$(=addmonths(today(1),-12))<=$(=today(1))"}>}[Res.Incident ID*+])
  4. Count({<[Res.Severity]={4},[Res.Reported MY],[Res.Reported Date+]={">=$(=addmonths(today(1),-12))<=$(=today(1))"}>}[Res.Incident ID*+])

Don't have a access to a sample qsf since i'm working on my companies Qlik Enterprise. 

 

Re: First month of Rolling 12 month count not displaying correctly

Would you also be able to share the format for [Res.Reported Date+] field? May be you need this?

Count({<
[Res.Severity] = {1},
[Res.Reported MY],
[Res.Reported Date+] = {">=$(=Date(AddMonths(Today(1), -12), 'DateFieldFormatHere'))<=$(=Date(Today(1), 'DateFieldFormatHere'))"}
>} [Res.Incident ID*+])
Keitaru
New Contributor III

Re: First month of Rolling 12 month count not displaying correctly

so i figured a work around for this and added the rolling 12 months calculation into dimension instead of the measure and it seem to work better for my requirements. 

 

the date time format has been changed from  dd\mm\yy hh:mm:ss down to just dd\mm\yy in the load script.