Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to aggregate values of one table based on values of another table?

Hello everyone! I'm fairly new to Qlik Sense. I need to do the following:

I have two tables, Risk and Revenue.

Risk:

Serial NoSupplier NameRisk Score
1A

8

2B4
3C10
4D2

The unique id in this table is the supplier name

Revenue:

Serial No.ProductSupplier NameRevenue
1123A$10
2234A$20
3156D$1

The unique id in this table is the product number. But the tables are linked by the supplier name.

I want to calculate a KPI of sum of revenue for all products whose supplier has a risk score greater than 5.

The logic I am using is if([Risk Score] > 5, Sum([Revenue]))

I am not getting any answer from my code. The correct answer in this case should be $30 dollars.

Any pointers is greatly appreciated.

Best,

Pranab

1 Solution

Accepted Solutions
Anil_Babu_Samineni

Try this, If this is in KPI? PFA

=Money(Sum({<[Risk Score] = {">5"}>} Revenue),'$#,##0')



Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

2 Replies
Anil_Babu_Samineni

Try this, If this is in KPI? PFA

=Money(Sum({<[Risk Score] = {">5"}>} Revenue),'$#,##0')



Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Yes, this is for a KPI.

Thanks Anil, this works. Appreciate it.