'HANA SQL Logic or Calculation view Model level Approach for time dependent role mapping

I have a Time dependent Master data table – DRNUMBER Recently with new CLASS – ‘1TC’, ECC folks introduced Role information. Earlier with CLASS - ‘1JL’ role information will not be available. CLASS - 1JL is somewhat detail level and CLASS - 1TC is aggregated level if same role is performed with continued dates.

enter image description here

Expected output should look like below. How to achieve this in HANA - SQL and if Calculation view Model level is possible how it is…..

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source