Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Not applicable

Month over Month Report

For a Headcount and Attrition Analysis report, I need to calculate the Average Heacount for any given month as (current headcount + previous headcount)/2. I've created this expression to do that:

(sum({<[Employee_Non-Employee]={'Employee'}>}TurnoverPopulationFlag)) + (sum({1<YearMonth={"$(=(date(AddMonths(YearMonth,-1),'YYYYMM')))"},[Employee_Non-Employee]={'Employee'}>}TurnoverPopulationFlag)))/2

Performance Rating and YearMonth are Dimensions in the report. If a single YearMonth is selected, the calculation works fine However, if multiple YearMonth selections are made, the preious month calculation does not seem to work - (sum({1<YearMonth={"$(=(date(AddMonths(YearMonth,-1),'YYYYMM')))"},[Employee_Non-Employee]={'Employee'}>}TurnoverPopulationFlag))).

Any ideas why? Thanks.





2 Replies
Highlighted
Not applicable

Month over Month Report

Hi,

you can create a variable to identifying the minimum or maximum value of the selected values in YearMonth field and make use of the variable in your expression.

Regards

Rajesh

Highlighted
Not applicable

Month over Month Report

Thanks. Do you have an example of how this would be done?