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: 
arvindjha2050
Creator
Creator

Rolling Twelve Months

Hello Team,

 

I have requirement for Rolling Period in Line Chart

Dimension : Year

Measure : sum(Attrition) for the year / average(employees) for last 12 months

 

The problem is the dimension Year where we need to calculate average for rolling last 12 months .

 

For example for Dimension 2019 : Number of employees who left in 2019 / Average of employees for last 12 months(i.e. from Mar 2018 to Feb 2019)

 

How can it be done?

 

Thanks

Labels (1)
3 Replies
pradosh_thakur
Master II
Master II

if you have a date column it will be easier to do so

Please refer the below for reference. 

https://community.qlik.com/t5/QlikView-Documents/Date-Level-Analysis-WTD-MTD-QTD-YTD-Current-Year-Pr...

What do you mean by average of employees here?

 

Learning never stops.
pradosh_thakur
Master II
Master II

something similar to below should work Please check the field names once
dimension = year

measure = sum(Attrition)/ (count(Distinct{<date_column={">=addmonths(today(),-12)  <= today()"}>} Empoyees)/12)
Learning never stops.
arvindjha2050
Creator
Creator
Author

Hello Pradosh,

 

This does not work.

I have a date field also , my dimension is Year(DateField).

The problem is for instance when this field has value 2019 it is not able to fetch values of Year 2018 but we want sum of rolling twelve months which in many cases will require data from past year also.

 

Regards,

Arvind