How can i Calculate difference from row values instead columns. Below is the example
Below Data is available in csv file
Month Amount Type Value Jan Type A 150 Jan Type B 100 Jan Type C 20 Feb Type A 200 Feb Type C 20 Feb Type B 100
Now I want to calculate difference in Jan and Feb month for Type A and Type B amount Type and the expected result is
Month Type Difference Jan Type A 50 Feb Type B 0
This come with the calculation
In Jan and Feb Type A value is 150 and 200 and its variance with respect to Jan is (200-150)=50
In Jan and Feb Type B value is 100 and 100 and its variance with respect to Jan is (100-100)=0
How can i achieve this ?
i tried something using ruby filter and transpose the data, with that also no luck.
I think i am missing something here,if this would have been sql query we would have added the Amount type as filter and do the difference, how we will achieve this with pipeline