Hi experts,
I have to prepare “Employee Attrition dashboard” in quicksight and I need the dynamic calculation based on the Parameters, but as ‘StartOfthisYear’ parameter takes default start date as 01-01-YYYY (2025), I am unable to display data based on Fiscal Year (April-March)
But I have already done something which is explained in below calculations.
Data fields are like:
-Emp Code,
-Name,
-Date of Joining,
-Last Working Date,
-Attrition (having values ‘0’ and ‘1’, 0 represents “Active”, and 1 represents “Attrited”)
-Zone, Region, State, Location etc are some other fields which I need to use as filters and for other KPIs.
The logic to calculate Attrition Rate is:
- Number of employees beginning of the year/month/quarter – [A]
- Number of employees left during the year/month/quarter – [B]
- Number of new employees joined during the year/month/quarter – [C]
- Number of employees at the end of the year/month/quarter – [D]
Formula to calculate [D]: [A]-[B]+[C] - Total Active Base Head Count at the end of the year/month/quarter – [E]
Formula to calculate [E] = ([A] + [D]) / 2
Formula to calculate Attrition Rate: ([B] / [E]) * 100
Parameters and dependent calculations:
${startOfYear} - represents start of this year.
${endOfYear}- represents End of this year.
{DOJ_FY}: addDateTime(-3,‘MM’, {Date of Joining})
{LWD_FY}: addDateTime(-3,‘MM’, {Last Working Date})
I have tried calculating A, B, C, D, E as per logic shared above with below calculated fields:
A:
countIf({Emp Code}, {DOJ_FY} < ${startOfYear} AND (Attrition = 0 ))
B:
countIf({Emp Code},{LWD_FY}>=${startOfYear} AND {LWD_FY}<=${endOfYear} AND Attrition = 1)
C:
countIf({Emp Code},{DOJ_FY}>=${startOfYear} AND {DOJ_FY}<=${endOfYear})
D:
{A_}-{B_}+{C_}
E:
({A_} + {D_}) /2
Here, I have divided by 2 just to have an average headcount.
Please note that whenever I have Active users, My Last Working Date remains NULL and for that employee I have Attrition as 0 as he is Active into the system.
Can someone help me in this approach of mine in handling Fiscal Year is the correct approach or should I make some changes ?
Best,
Vaibhav