Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
ToinkToinkTigger
Contributor
Contributor

Sum values column A if condition is Column B is met

Hello there,

I have a dataset with two columns of interest. Column A and Column B.

I want to return the Sum value of Column A for when the fieldvalue of Column B equals 167000

How is this syntax written?

 

Thanks in advance,

Labels (1)
1 Solution

Accepted Solutions
sidhiq91
Specialist II
Specialist II

@ToinkToinkTigger Please see the below KPI, which works perfectly fine.

sidhiq91_0-1665665877694.png

In the table form, please see below.

sidhiq91_1-1665665949323.png

 

sidhiq91_2-1665665978596.png

 

View solution in original post

8 Replies
sidhiq91
Specialist II
Specialist II

@ToinkToinkTigger You can use the set expression:

Sum({<[Column B]={'167000'}>}[Column A])

If this resolves your issue, please like and accept it as a solution

ToinkToinkTigger
Contributor
Contributor
Author

That does not work unfortunately, it return the value 0 for all fields.

ToinkToinkTigger_0-1665662447390.png

 

sidhiq91
Specialist II
Specialist II

@ToinkToinkTigger  Could you please post some sample data?

ToinkToinkTigger
Contributor
Contributor
Author

Yes, sure,

So the entries have a WBS Element ID (Col A). Column G distinguishes between 600500 (Capital Invesmtnets) and 617000 (Temporary Staff)

I would like to sum the actual costs for lets say temporary staff in an expression

sidhiq91
Specialist II
Specialist II

@ToinkToinkTigger Please see the below KPI, which works perfectly fine.

sidhiq91_0-1665665877694.png

In the table form, please see below.

sidhiq91_1-1665665949323.png

 

sidhiq91_2-1665665978596.png

 

ToinkToinkTigger
Contributor
Contributor
Author

Strange, can this have to do anything with using a lower Qliksense version? (not the newest)?

sidhiq91
Specialist II
Specialist II

@ToinkToinkTigger It will work in any version. It has nothing to do with the version of the Qlik.

ToinkToinkTigger
Contributor
Contributor
Author

Thanks, worked out in the end. Had a dumb typo in there 🙂 Thanks for the quick help, much appreciated.