Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Erlik
Contributor II
Contributor II

Sum does not sum same value

Hello All,

 

X & Y values: 100,500,500

Function:

Sum (Aggr(Sum(distinct{<A= {'X', 'Y'}>} B), A))

OR

sum({<A= {'X', 'Y'}>} distinct B),

 

Result: output of both function are: 600, however required to be 1100.

 

Could you please help? Thank you.

 

Labels (1)
1 Solution

Accepted Solutions
vincent_ardiet_
Specialist
Specialist

If you put "distinct" 500 is counted only once, so 500+100 = 600.
And if you remove the "distinct" and the sum is above 1100, as @Mark_Little is saying, the issue is in your datastructure.

View solution in original post

3 Replies
Mark_Little
Luminary
Luminary

Hi can you please share it as data table with dimension names? This will allow us to formulate the set analysis.

If you are getting 600 it means one of the 500's are not include by your set expressions, But with out the data structure it would only be a guess on how and why.

vincent_ardiet_
Specialist
Specialist

If you put "distinct" 500 is counted only once, so 500+100 = 600.
And if you remove the "distinct" and the sum is above 1100, as @Mark_Little is saying, the issue is in your datastructure.

Erlik
Contributor II
Contributor II
Author

Mark, Vincent; Thank you so much for quick responds. 

After removing distinct, sum is far above than 1100. I better start revising my data structure first.