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: 
beck_bakytbek
Master
Master

Wrong Sum in Table

Hi Folks,

i got a question (please see attached screenshot):

beck_bakytbek_0-1608034239986.png

 

For my Project C in Column: New_Expression i created the following expression: if(sum(Actual) = 0, sum(Plan), sum(Actual)) this expression does work. 

But as total Sum i have only 20 instead 40, i am using in this case the straight table. My expected Output is: Sum = 40

 

Does anobody know how to resolve this issue.

Thanks a lot in advance for any suggestions and feedbacks

Bek

 

Labels (1)
1 Solution

Accepted Solutions
lironbaram
Partner - Master III
Partner - Master III

yes you can do it with aggr() function 

sum(aggr( if(sum(Actual) = 0, sum(Plan), sum(Actual)),Project))

View solution in original post

4 Replies
lironbaram
Partner - Master III
Partner - Master III

Hi , 

Qlik engine is calculating the total in app level using the expression, it doesn't sum the rows 
so in your case on app level sum(Actual)>0 so you get 20 as the total 
you need to change the total function in the measure from Auto to Sum 

lironbaram_0-1608035589640.png

 



beck_bakytbek
Master
Master
Author

Hi Lironbaram, first of all thanks a lot for your time and help, Yes it is a good suggestion. I wanted to know, is that possible to resolve this issue maybe by using of functin: Aggr ().

 

Do you have any idea?

Thanks a lot

lironbaram
Partner - Master III
Partner - Master III

yes you can do it with aggr() function 

sum(aggr( if(sum(Actual) = 0, sum(Plan), sum(Actual)),Project))
beck_bakytbek
Master
Master
Author

Hi Lironbaram, thanks a lot for your help and time