Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

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 (2)
3 Replies
Highlighted
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.
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.
Highlighted
Contributor III
Contributor III

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