Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear Community,
I need a help in finding the Retirement dates of the employees.
Kindly find the attachment.
Thanks,
Mukram.
My example is just an example how one might be able to do what you want.
You need to understand the design idea and then adapt to your requirement and data.
For example, if you change the last step from CEO to Coordinator, you also need to change the script load code accordingly:
TMP2:
LOAD *, if(DateRetire<DateStep or PositionStep='Coordinator', 1,0) as RetiredOrLastStep;
This will create this result table:
CurrPos | DateRetire | DateStep | DoB | DoJ | DurationTotal | DurStep | EmpID | PositionStep | Ret_Age | RetiredOrLastStep |
---|---|---|---|---|---|---|---|---|---|---|
Team Member | 10/10/2046 | 10/5/2027 | 10/10/1986 | 10/05/2010 | 17 | 101 | Coordinator | 60 | 1 | |
Team Member | 1/2/2026 | 10/4/2026 | 01/02/1970 | 10/04/2009 | 17 | 3 | 102 | Manager | 56 | 1 |
Team Member | 10/5/2014 | 10/9/2015 | 10/05/1963 | 10/09/2010 | 5 | 5 | 103 | Team Member | 51 | 1 |
Team Leader | 10/10/2040 | 10/10/2024 | 10/10/1980 | 10/10/2007 | 17 | 104 | Coordinator | 60 | 1 | |
Team Leader | 10/10/2020 | 12/12/2020 | 10/10/1965 | 12/12/2006 | 14 | 3 | 105 | Assist Manager | 55 | 1 |
Team Leader | 10/10/2011 | 12/11/2012 | 10/10/1960 | 12/11/2007 | 5 | 5 | 106 | Team Member | 51 | 1 |
Supervisior | 10/7/2035 | 10/5/2021 | 10/07/1975 | 10/05/2004 | 17 | 107 | Coordinator | 60 | 1 | |
Supervisior | 10/7/2050 | 10/1/2021 | 10/07/1990 | 10/01/2004 | 17 | 108 | Coordinator | 60 | 1 | |
Assist Manager | 10/5/2038 | 10/5/2017 | 10/05/1978 | 10/05/2000 | 17 | 109 | Coordinator | 60 | 1 | |
Coordinator | 10/10/2016 | 10/12/2017 | 10/10/1960 | 10/12/2000 | 17 | 3 | 110 | Manager | 56 | 1 |
You requested a retirement date 10/05/2046 for emp 101, and I calculated 10/10/2046 based on the DoB (while you seem to calculate your retirement date based on DoJ). If this is what you need, change the code accordingly, as I said, you need to understand the idea, then adapt.
Sorry, I haven't fully understood what you are trying to analyze.
One question first:
In your company, if an employee keeps working for some 14 years, he gets automatically promoted to CEO? Where can one apply? And what about the other CEO's then?
Back to your application:
What do you want to get as a result given your sample data?
Dear Stephen,
Thanks for Reply.
1)
In my Application i have taken the position data as a Sample.
i have different designations in Original apps.
In my sample application more than one person can promoted to CEO.
in My application I want to get the retirement dates of the employees.
like
EMPID 103
Current Age is 49.
And at the time of Joining date his age is 47.
and his position is a team member.
Duration for the position Team member is 5 Years. means he should be at that position for 5 years then only he will get the promotion.
so after 5 years from joining date his age become 52.
But the Retirement age is for that position is 51.
so he should retire.
so his retirement date is 10/09/2015.
i updated some data in application .
please find the attachment.
Thanks,
Mukram.
Still a little unclear what you want to achieve.
If you want to project into the future also the upcoming promotions and check if the employee get's promoted, you can try like suggested in attached file (script based solution).
The RESULT table shows the last position an employee holds in his career and his retirement date.
Dear swuehl,
Thanks for your reply.
I tried your script but it's not giving proper result.
Now i updated the data as well as positions .
i am expecting the result like
emp [Last Position] and Date of Retirement
101 Coordinator 10/05/2046
102 Manager 10/04/2026
and so all
--------------------------------------------------------
find the attachment.
Thanks,
Mukram.
My example is just an example how one might be able to do what you want.
You need to understand the design idea and then adapt to your requirement and data.
For example, if you change the last step from CEO to Coordinator, you also need to change the script load code accordingly:
TMP2:
LOAD *, if(DateRetire<DateStep or PositionStep='Coordinator', 1,0) as RetiredOrLastStep;
This will create this result table:
CurrPos | DateRetire | DateStep | DoB | DoJ | DurationTotal | DurStep | EmpID | PositionStep | Ret_Age | RetiredOrLastStep |
---|---|---|---|---|---|---|---|---|---|---|
Team Member | 10/10/2046 | 10/5/2027 | 10/10/1986 | 10/05/2010 | 17 | 101 | Coordinator | 60 | 1 | |
Team Member | 1/2/2026 | 10/4/2026 | 01/02/1970 | 10/04/2009 | 17 | 3 | 102 | Manager | 56 | 1 |
Team Member | 10/5/2014 | 10/9/2015 | 10/05/1963 | 10/09/2010 | 5 | 5 | 103 | Team Member | 51 | 1 |
Team Leader | 10/10/2040 | 10/10/2024 | 10/10/1980 | 10/10/2007 | 17 | 104 | Coordinator | 60 | 1 | |
Team Leader | 10/10/2020 | 12/12/2020 | 10/10/1965 | 12/12/2006 | 14 | 3 | 105 | Assist Manager | 55 | 1 |
Team Leader | 10/10/2011 | 12/11/2012 | 10/10/1960 | 12/11/2007 | 5 | 5 | 106 | Team Member | 51 | 1 |
Supervisior | 10/7/2035 | 10/5/2021 | 10/07/1975 | 10/05/2004 | 17 | 107 | Coordinator | 60 | 1 | |
Supervisior | 10/7/2050 | 10/1/2021 | 10/07/1990 | 10/01/2004 | 17 | 108 | Coordinator | 60 | 1 | |
Assist Manager | 10/5/2038 | 10/5/2017 | 10/05/1978 | 10/05/2000 | 17 | 109 | Coordinator | 60 | 1 | |
Coordinator | 10/10/2016 | 10/12/2017 | 10/10/1960 | 10/12/2000 | 17 | 3 | 110 | Manager | 56 | 1 |
You requested a retirement date 10/05/2046 for emp 101, and I calculated 10/10/2046 based on the DoB (while you seem to calculate your retirement date based on DoJ). If this is what you need, change the code accordingly, as I said, you need to understand the idea, then adapt.
Dear Stephen,
Thank you it's working perfectly.
Thanks again.
Regards,
Mukram.
,
'