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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
don_qlikview
Creator
Creator

How to compare positive and negative values

Hello every one,

I am trying to find negative and positive values based on a transaction id and if they have equal and opposite signs, I want to cancel them out:

For example if I have a table like below:

Transaction ID

Amount

12345

100

12345

-100

12345

200

6789

300

In this case I want the result to be

Transaction ID

Amount

12345

0

12345

200

6789

300

How can I do this?

Thanks in advance

Don

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Using the calculated dimension should work, you need to disable 'suppress zero values' in presentation tab of straight table chart properties.

View solution in original post

5 Replies
swuehl
MVP
MVP

Shouldn't just a sum(Amount) be sufficient?

Or maybe a straight table chart with dimension

=Dual([Transaction ID], fabs(Amount) )

and as expression

=Sum(Amount)

don_qlikview
Creator
Creator
Author

Doing a sum(Amount) will give me only two records

12345 200

6789   300

whereas i want three records as mentioned in my question.

Thanks!!!

swuehl
MVP
MVP

Using the calculated dimension should work, you need to disable 'suppress zero values' in presentation tab of straight table chart properties.

don_qlikview
Creator
Creator
Author

Thanks Swuehl. This worked

Anonymous
Not applicable

Hi Sohail,

  how did you solve it...

Thanks in advance