Forum Discussion
Changing the Granularity Level | There are Some Caveats
The figure below is a snapshot of our Employee Lifecycle table, which contains information pertaining to every event in the employee lifecycle from Onboarding to Offboarding. Each production staff will be assigned to only ONE client at any point in time (primary client). A change in client can happen if the employee is laterally transferred, which will be recorded in the Employee Lifecycle table under the column titled "Transaction Type" as "Lateral Transfer."
As you can see above, the employee, Aaden Grimes started his job on 15-Mar-17 and left the company on 31-Jan-18. Throughout his employee lifecycle, he has worked only under Client_1.
The figure below shows a different scenario:
Olivia Zhang started her job on 12-Aug-15 under Client_1, and she stayed with the same client until 31-May-18. She was laterally transferred to Client_2 on 1-Jun-18 and back to Client_1 on the same day. She then stayed under Client_1 until 22-May-19 and got laterally transferred to Client_5 on 23-May-19.
To achieve my objective, I guess all dates between Eff_Start_Date and Eff_End_Date will have to be generated and the client names drilled down. However, there are some caveats:
- Grouping by Client cannot be done since an employee might be laterally transferred from Client_1 to Client_2 and then back to Client_1. Each of these transitions should be treated as separate stints. (Please see the column titled "Stint" in the above screenshot).
- If the employee has been offboarded (Transaction_Type = "Employee Offboarding"), the last Eff_End_Date should be the Effective_Date of Employee Offboarding.
- If the employee has not been offboarded, the last Eff_End_Date should be dynamically updated with today's date.
The current granularity level of the Employee Lifecycle table is a lifecycle event, which needs to be changed to the level of each day in the lifecycle of every employee.
I hope someone would be able to help out. Many thanks in advance.
Aji
2 Replies
- AnonymousNot applicable
Hi ajieapen ,
So according to my understanding, the new table you want to create contains every row with a change in the Transaction Type of each employee.
Could you please share some dummy data in table format not picturesfor convenience? Or share me with your pbix file after removing sensitive data.
How to provide sample data in the Power BI Forum - Microsoft Power BI Community
Best Regards,
Eyelyn Qin - ajieapenNew Member
Hi Anonymous
Many thanks for your reply.
You can access the sample file here: https://drive.google.com/drive/folders/1OXkbnDya2FUn36WZWmL4uaznfv-WhEI1?usp=sharingOn the 2nd tab of the file, columns F, G, and H have been manually done by me. I need to create those columns using PQ, then fill down all the dates between "Eff_Start_Date" and "Eff_End_Date."
I have used fake employee and client names to protect confidentiality.
Many thanks for responding. Hope you'll be able to help.Regards,
Aji