Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am trying to calculate a rolling attrition rate for people that have spent less than 3 months, 4 to 6 months, 7 to 9 months and 10 to 12 months at a company. The attrition formula I am using is;
**The total number of leavers in certain period divided by the total number of new hires during the same period of time and then multiply the end result with 100%.**
My QlikSense calculation I am using to calculate the attrition rate for someone that stayed at the company for less than 3 months during a specific period of time is below;
num((Count({<[Bucket)]={'[0-3 Months)'}>}{<Month>}[Leaving Date]) / Count({<Month>}[Start Date])),'#0.0%')
I am not sure if this is the right calculation. I have a table of sample data below. Could someone please advise me?
| Unique Employee ID | Start Date | Leaving Date | No Of Months at Company | Bucket |
| 1245 | 01/01/2019 | 03/03/2019 | 2 | 0-3 Months |
| 1365 | 01/03/2019 | 31/03/2019 | 1 | 0-3 Months |
| 6897 | 06/02/2019 | 05/09/2019 | 7 | 7-9 Months |
| 1459 | 08/01/2019 | 04/12/2019 | 11 | 10-12 Months |
| 9865 | 06/07/2019 | 03/03/2020 | 8 | 7-9 Months |
| 4657 | 05/08/2019 | 05/02/2020 | 6 | 7-9 Months |
Hi, maybe try with:
=num((Count({<Bucket={"0-3 Months"},Month>}[Leaving Date]) / Count({<Month>}[Start Date])),'#0.0%')
Hi @sergio0592 ,
Thanks for your response!
As well as the actual code, I wanted to know whether you thought my thought process or idea for calculating rolling attrition was right?
Thanks,
Jed
One solution is.
SET DateFormat='DD/MM/YYYY';
SET MonthDiff = Num(((year($2) * 12) + month($2)) - (((year($1) * 12) + month($1))) + 1);
tab1:
LOAD *, Class([No Of Months at Company],3,'months') As Bucket
;
LOAD *, $(MonthDiff([Start Date],[Leaving Date])) As [No Of Months at Company]
;
LOAD * INLINE [
Unique Employee ID, Start Date, Leaving Date
1245, 1/1/2019, 3/3/2019
1365, 1/3/2019, 31/03/2019
6897, 6/2/2019, 5/9/2019
1459, 8/1/2019, 4/12/2019
9865, 6/7/2019, 3/3/2020
4657, 5/8/2019, 5/2/2020
];
Hi @Saravanan_Desingh ,
Thanks for your response. However I was looking more to see if my code for calculating rolling attrition was right.