Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
In Qlikview, I want to calcultae certain sumifs for each unique code. If I am using the below code, I am getting the sum for all the codes together. How to segregate according to each code?
Load
Sum[(If[ABC]=XYZ, [Amount], 'NA']
Resident originaltable
Group By ABC
Hi,
You have to do it the outer way around, try this:
originaltable:
Load * Inline [
ABC, Amount
XYZ, 1230
XYZ, 573
XYZ, 1234
XYZ, 12
AAB, 1203
DSD, 832
];
NoConcatenate
Table:
Load
ABC,
IF( ABC = 'XYZ',
Sum( Amount ),
'NA'
) as Amount
Resident originaltable
Group By ABC
;
Drop table originaltable;
exit script;
I've added a test table for showing that it works.
Jordy
Climber
Hi,
You have to do it the outer way around, try this:
originaltable:
Load * Inline [
ABC, Amount
XYZ, 1230
XYZ, 573
XYZ, 1234
XYZ, 12
AAB, 1203
DSD, 832
];
NoConcatenate
Table:
Load
ABC,
IF( ABC = 'XYZ',
Sum( Amount ),
'NA'
) as Amount
Resident originaltable
Group By ABC
;
Drop table originaltable;
exit script;
I've added a test table for showing that it works.
Jordy
Climber
Thanks 🙂 It worked
Great, please mark the post as solved so other people can see this solves your issue!
Jordy
Climber