Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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
Thanks. Do you have an example of how this would be done?