Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Row Subtraction in Table

Hi friends,

I have this table

   

TypeBattingBowling
A44.447.4
B8.48.8
C1.31.8
D1.31.7
E6.87.6
F3.93.8
Total 162.267.4
G8.08.2
Total 270.2

75.6

The field highlighted in bold , Row E i want the value Row F - Row E, so the total comes correct in Total 1.

Can you please tell me how to deal with row subtraction?

Regards,

KC

1 Solution

Accepted Solutions
sunny_talwar

Try these expressions:

Batting: =Sum(Batting) - If(Type = 'E', sum(TOTAL {<Type = {'F'}>}Batting), 0)

Bowling: =Sum(Bowling) - If(Type = 'E', sum(TOTAL {<Type = {'F'}>} Bowling), 0)

Output:

Capture.PNG

I used the sample that was prepared by fvelascog72 and made slight changes to it

Best,

Sunny

View solution in original post

6 Replies
fvelascog72
Partner - Specialist
Partner - Specialist

Hi,

I hope I understand your requeriments.

See attached file.

Not applicable
Author

Hi Federico,

Thanks for your quick response.

But the values highlighted in bold, Row E is still showing 6.8 and i want Row F - Row E (6.8-3.9 = 2.9)  for batting

For bowling (7.6-3.8 = 3.8) and everything on the table remains same.

Regards,

KC

Not applicable
Author

Hi,

I am not sure whether column subtraction like col(3)-col(2) works in case of rows as well.

Regards,

KC

sunny_talwar

Try these expressions:

Batting: =Sum(Batting) - If(Type = 'E', sum(TOTAL {<Type = {'F'}>}Batting), 0)

Bowling: =Sum(Bowling) - If(Type = 'E', sum(TOTAL {<Type = {'F'}>} Bowling), 0)

Output:

Capture.PNG

I used the sample that was prepared by fvelascog72 and made slight changes to it

Best,

Sunny

Not applicable
Author

Hey Thanks Sunindia,

This is perfect!

Regards,

KC

sunny_talwar

No problem

I am glad I was able to help.

Best,

Sunny