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: 
khaycock
Creator
Creator

Sum for each number expression

I'm trying to get a total sum of the total price column but I have some duplicate fields and only want to pick up one 'Total Price' amount per 'Invoice Number'. For instance, for invoice number 14735 there are 3 different fields with the value 1064.4 but I only want to use one of them in the sum expression.

Any ideas as to what expression I could use?

Thanks

expression.PNG

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

This should do it:

=Sum(Aggr(Only([Total Price]), [Invoice Number]))

I suggest that you re-examine the data model to create a table in which these amounts are not duplicted and possibly amend the model/front end so that you are not making spurious duplicates from incorrectlty associated dimensions.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

3 Replies
qlikview979
Specialist
Specialist

Hi please share sample app

jonathandienst
Partner - Champion III
Partner - Champion III

This should do it:

=Sum(Aggr(Only([Total Price]), [Invoice Number]))

I suggest that you re-examine the data model to create a table in which these amounts are not duplicted and possibly amend the model/front end so that you are not making spurious duplicates from incorrectlty associated dimensions.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
khaycock
Creator
Creator
Author

Here is one. Thanks.