I have got the following file, wherein if in a particular month lets say Feb if the material ID is same, in the below case 70000, then check if the vendors are different, incase, the vendor is different in the below case T and S then check the Net Price, if there is a difference between the two then take the difference of the lower amount from the higher amount in the below case 569-558, and repeat the same for order qty, subtract lower amount from higher amount and populate under Difference in Qty.
The total difference should be
Total of Difference = Difference in Qty * Difference in Price .
Now it is not necessary that there is always a difference in the net price, mostly they are same for vendors but incase there is a difference i want to highlight those cases.
Also note in the below example I have given an example of only 2 vendors under the same material IDs in a particular month, there can be cases where there might be 3 or more than 3 vendors under the same material ID in such case i was to subtract max net price among the values with min net price among the values.
Kindly note - Cases should be found in the same month [ for example if price difference is in different months for the same material ID i don't want that]
I have tried a lot to get the exact solution but I am unable to do so. Was using multi-row to create a workflow
ANY HELP WOULD BE APPRECIATED.
Input -
Month | Material | Material Category | Order Qty | Supplier/Supplying Plant | Net Price |
February | 70000 | A | 8,600 | 10595-T | 558 |
February | 70000 | A | 31,711 | 12757-S | 569 |
February | 70001 | A | 3,700 | 10595-T | 658 |
February | 70001 | A | 14,274 | 12757-S | 672 |
Desired Output-
Month | Material | Material Category | Order Qty | Difference in Qty | Supplier/Supplying Plant | Net Price | Difference in Price | Total of Difference |
February | 70000 | A | 8,600 | - | 10595-T | 558 | 0 | 0 |
February | 70000 | A | 31,711 | 23,111 | 12757-S | 569 | 11 | 254,221 |
February | 70001 | A | 3,700 | - | 10595-T | 658 | 0 | 0 |
February | 70001 | A | 14,274 | 10,574 | 12757-S | 672 | 14 | 148,036 |
Thank you sooo much for the help! Can you share the workflow so I can see the multi-row formulas?
Maybe you need add group by [Month] and filter the min & max of supplier.