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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
QS_User_2019
Contributor II
Contributor II

How to sum in this situation

I have a raw data like below.

Master_ColumnSlave_Column_1Salve_Column_2Amount
Raw MaterialGoldChina100
Raw MaterialSilverBrazil50
Raw MaterialGoldChina100
FoodFrozen FoodRussia50
Raw MaterialGoldChina 100

 

Now, I use a table in QS to present it like this. For the Amount_2 measure, any suggested formula I can use?

 

Master_ColumnSlave_Column_1AmountAmount_2
Raw MaterialGold100200
Raw MaterialSilver100100
Raw MaterialGold100200
FoodFrozen Food5050
Raw MaterialGold100200

 

I tried to write like this but some row in Amount_2 become 0 like below table.

Sum(aggr(sum([Amount]),[Master_Column]))

Master_ColumnSlave_Column_1AmountAmount_2
Raw MaterialGold100200
Raw MaterialSilver100100
Raw MaterialGold1000
FoodFrozen Food5050
Raw MaterialGold1000
1 Solution

Accepted Solutions
tresB
Champion III
Champion III

Using NODISTINCT should resolve the issue. Try like:

Sum(aggr(NODISTINCT sum([Amount]),[Master_Column]))

View solution in original post

2 Replies
tresB
Champion III
Champion III

Using NODISTINCT should resolve the issue. Try like:

Sum(aggr(NODISTINCT sum([Amount]),[Master_Column]))

QS_User_2019
Contributor II
Contributor II
Author

Thank you. You solve my question.