Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sum Error in Charts

hi,

I have three columns..

ABAmount
10002550
32100082
15007890
13008954
25130060

I need to sum up the Amount when Column A = Column B. eg: First 2 rows, 1000 is in both columns but has different adjacent values, so i have to sum up 50 + 82 and similarly Row 4 and 5, since 1300 is in both columns need to sum up, 60 + 54.  whereas row 3, is a single unique line item and that remains the same. Plz help me find the right expression.

1 Solution

Accepted Solutions
Not applicable
Author

=if(FieldIndex('B',sum(A))=0,if(FieldIndex('A',sum(B))=0,Bal), Bal + FieldValue('Bal',FieldIndex('B',sum(A))))

View solution in original post

20 Replies
Not applicable
Author

ABAmount=
10002550132
32100082132
1500789090
13008954114
25130060114

right?

in this case?

ABAmount=
100014003196?
1400783296?
8910003396?
Not applicable
Author

Hi,

Can you do an applymap function in the script level between A & B to get the amount correspondingly ,

and call this calculated amount  in the expression directly

Regards,

Kiruthiga

Not applicable
Author

the second case can never happen cause for each unique number in column A, there can be only on corresponding line item in B.

Not applicable
Author

Hi,   Try   (Amount)+FieldValue('Amount',FieldIndex('B',sum(A)))  Please see file attached.   Regards  Rahul

Not applicable
Author

Thanks.. It surely works.. but the first row has a value 110.. Why is that?

Thanks & Regards,

Shilpa

Not applicable
Author

A 25 =60 B 25 =50  Therefore value equals 60+50 = 110

Not applicable
Author

"the second case can never happen cause for each unique number in column A, there can be only on corresponding line item in B." is not correct...?

Not applicable
Author

Hi Rahul,

Your expression is giving me th required output but it is not working in my application.

Not applicable
Author

Hi Shilpa,   If possible, could you post an example?  Regards  R