Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
I have a data like below
Name | SAL |
---|---|
ABC | 100 |
DEF | 200 |
GH | 50 |
IKJ | 10 |
now I want to add one dummy value under and I need to sum up the specified records under SAL
Like,
Name | SAL |
---|---|
ABC | 100 |
DEF | 200 |
GROUP 1 SUM | 300 |
GH | 50 |
GROUP 2 SUM | 50 |
G1+G2 Sum | 350 |
IKJ | 10 |
GROUP 3 sum | 10 |
TOTAL | 360 |
In the above table GROUP 1 SUM is a dummy column which will sum SAL of ABC+DEF
I want to specify how many rows are need to be summed.
Thanks,
Vivek
Hi,
You can try below logic.
Data:
Load * inline [
Name, Group, SAL
ABC,Group1,100
DEF,Group1,200
GH,Group2,50
IKJ,Group3,10
];
FinalData:
Load Group as Name,Sum(SAL) as SAL Resident Data Group by Group;
Concatenate(FinalData)
Load Name, SAL resident Data;
Concatenate(FinalData)
Load 'Total' as Name,Sum(SAL) as SAL Resident Data;
Drop table Data;
Regards,
Kaushik Solanki
Hi Kaushik,
I my table I don't have Group field. to group them.
HI,
That is something which you need to create to tell which values should be Grouped under what.
Regards,
Kaushik Solanki
Hi Kaushik,
Thanks for the reply.
you are correct but, It is the sample data which I posted. but in real time in have very huge data. I cannot create GROUP manually.
forget about the SUM, can we add A dummy field atleast?
Like GROUP 1 SUM in the above table
Hi,
You can use the Mapping function to map it from other source.
Hope you know how to use the apply map.
Regards,
Kaushik Solanki