Hi there -- I have a dataset that has an individual record per employee that states if they are active or terminated and that gives their current tenure or the tenure at the time that they left the company.
I'm trying to do a survival beastmode using a bar chart where I show 100% at tenure = 0, and then at tenure = 1, I want to show the proportion that has left the company, into tenure = 2, etc.
I have the calculated tenures and have it rounded down and labeled, but am having trouble accomplishing the above. Is there any way to do a beastmode where I show the survival / retention likelihood to making it to 1-year of tenure, 2-years, etc. where the horizontal access is years (through 5 years) and the y-axis shows survival based on the total population and dropping off those that don't make it to that next threshold.
This is my beastmode so far for survival:
The yellow highlight is my pre-existing beastmode that reflects current tenure (if active, time from hire to load, if terminated, time from hire to term). At time 0, I want the survival to be 1 (or 100%), then I want to subtract from 1, the proportion of departures that left with < 1 year of tenure. However, this does not appear to be working especially for trying to iterate this to 2, 3, 4, + years.
Code also copied below (instead of an image):
CASE WHEN floor((CASE WHEN Termination Date
is null then DateDiff(ETL_DATE
,Last Hire Date
) else DateDiff(Termination Date
,Last Hire Date
) end) / 365.25) = 0
THEN
1
WHEN floor((CASE WHEN Termination Date
is null then DateDiff(ETL_DATE
,Last Hire Date
) else DateDiff(Termination Date
,Last Hire Date
) end) / 365.25) = 1
THEN
1 - (SUM (CASE WHEN ((CASE WHEN Employee Status
!='TERMINATED' then DateDiff(ETL_DATE
,Last Hire Date
) else DateDiff(Termination Date
,Last Hire Date
) end) / 365.25) < 1 AND Employee Status
= 'TERMINATED' THEN 1 ELSE 0 END) / SUM (CASE WHEN ((CASE WHEN Employee Status
!='TERMINATED' then DateDiff(ETL_DATE
,Last Hire Date
) else DateDiff(Termination Date
,Last Hire Date
) end) / 365.25) >= 1 THEN 1 ELSE 0 END))
Any advice on how to make this happen while still remaining interactive (removing certain orgs, focusing on certain countries, etc. via filters)? Much appreciated.