Dear Experts,
I have input file which is comma separated, has 4 columns like below,
BRAND,COUNTRY,MODEL,COUNT
NIKE,USA,DUMMY,5
NIKE,USA,ORIGINAL,10
PUMA,FRANCE,DUMMY,20
PUMA,FRANCE,ORIGINAL,15
ADIDAS,ITALY,DUMMY,50
ADIDAS,ITALY,ORIGINAL,50
SPIKE,CHINA,DUMMY,1O
And expected output add one column TOTALCOUNT which is group by BRAND,COUNTRY column(1st and 2nd) and add a new column(5th) which is SUM of COUNT column(4th)..
BRAND,COUNTRY,MODEL,COUNT, TOTALCOUNT
NIKE,USA,DUMMY,5,15
NIKE,USA,ORIGINAL,10,15
PUMA,FRANCE,DUMMY,20,35
PUMA,FRANCE,ORIGINAL,15,35
ADIDAS,ITALY,DUMMY,50,100
ADIDAS,ITALY,ORIGINAL,50,100
SPIKE,CHINA,DUMMY,1O,100