Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
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
tresesco
MVP
MVP

Using NODISTINCT should resolve the issue. Try like:

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

View solution in original post

2 Replies
tresesco
MVP
MVP

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.