Find Questions & Answers

You have agreed with the moderation alert. Please choose one of the following actions.

You have disagreed with the moderation alert and it has been removed from the queue.

This question has been deleted.

This question has been undeleted.

0

How to handle many to many relationship and get most current data in SAP HANA Calculation View?

Nov 26, 2016 at 02:35 AM

164

Former Member

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

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.