# New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

## Sum Error in Charts

hi,

I have three columns..

 A B Amount 1000 25 50 32 1000 82 1500 78 90 1300 89 54 25 1300 60

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

## Re: Sum Error in Charts

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

20 Replies
Not applicable

ABAmount=
10002550132
32100082132
1500789090
13008954114
25130060114

right?

in this case?

ABAmount=
100014003196?
1400783296?
8910003396?
Not applicable

## Re: Sum Error in Charts

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

## Re: Sum Error in Charts

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

## Re: Sum Error in Charts

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

Not applicable

## Re: Sum Error in Charts

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

Thanks & Regards,

Shilpa

Not applicable

## Re: Sum Error in Charts

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

Not applicable

## Re: Sum Error in Charts

"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

## Re: Sum Error in Charts

Hi Rahul,

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

Not applicable

## Re: Sum Error in Charts

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