Forum Discussion

cosminzanfir's avatar
cosminzanfir
Frequent Visitor
6 years ago

Substract value from different month based on several conditions

Hello,
Please help me find a solution to the following problem.

 

I need to calculate the difference between this month value vs previous month.

The problem is that the calculation needs to take in consideration several other columns and make the substractions based on these columns as well.

Below you can find the columns I am working with (In excel file for calculation purposes).

The column from wich i am substracting is Time Y.m. 

The value from second month of the same year is substracted from the previous month of the same year , where Employee ID-S- ,Employee ID-H-  ,Stage and Job Key is the same. If anything changes , then a the value should be separated from the calculation.

In the table below I have marked each step in column Nr of calcul for each step.

Column Key Sort is the key made from Year*100+Month and Employee ID-S- that i tought that it will help.

In column Time Y.m based on stage and Employee ID-S- is the calculation value made in excel by hand.

 

Spoiler


The way the data should be displayed to the user is shown in the screen below.

 

Could you please advice?

Thank you

 

5 Replies