on 11-26-2016 2:35 AM
Hi Gurus,
I am trying to solve a problem. which i think is caused by a many 2 many 2 many relationship.
I have an EMPLOYEE table which has jobcode, employee, company information.
I have a Jobcode table which has jobcode, jobclass, company, valid_from, valid_to fields.
I have a JOBCLASS table which has jobclass, company and jobclass_Description information.
Business wants to analyse employees historical and current data to see what were the employees jobcode, jobclass during the last 5 years and their changes in jobs (how many technician changed to supervisor etc)
We already have a calculation view with employee, jobcode, company information for analysis but no "jobclass" and jobclass_Description". I need to include these 2 more fields (job_class and job_class description) in the calculation view. So the business can analyse historical and current data for each employee's "Jobcode", "jobclass" and "jobclass_description" based on the employee and his company number, (there are several sub-companies in this organization).
Each company can have many jobcodes and each jobcode can be related to many jobclasses. But when a jobclass id is changed then how we only want to get latest jobclass id
Example below:
Company ||| Jobcode ||| Jobclass ||| Jobclass_description ||| valid_from ||| valid_to
110 123456 00 Technician Jan1, 2002 Current
520 123456 00 Technician Jan1, 2002 Current
220 98765 01 Supervisor Feb 1,2005 dec 3, 2012
220 98765 03 Supervisor Dec 4,2012 Current
So, in the case of company = 220 and jobcode = 98765, employees can have 2 diff jobclasses at different period of time, however we only need the latest/current jobclass id, which in this case will be 03.
1. How can i get the latest jobclass (03) for the employees with jobcode = 98765 and not records for both 01 and 03. This is causing me inflation in number of records compared to the original calculation view.
Any guidance or suggestion will be a great help.
Thank you all for the suggestions, since my HANA is SPS8, it does not support Rank node function in graphical CV. However, using the filter option on valid_to solved my problem.
Thanks again.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can use any one of operations below based on functionality and data:
Please reply back with concerns.
Thank you.
Best Regards,
Anjali.
,Hi,
You can try below operations based on your functionality and data:
Please reply with additional details if this doesn't suffice.
Thank you.
Best Regards,
Anjali.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello
Can you not use a filter on the valid_to field as current_date? That would fetch only the latest records.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.