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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Wrong total in total line

in my attachment you can see that the total is not correct

i like to use the if statement because in my real file the formula is very complex.

How are totals calculated in QV? why is the sum not correct?

is use this formula

if

(User_id=1,0,Sum(number))

is it also possible to change the sum in avg??

1 Solution

Accepted Solutions
Not applicable
Author

Its the way its aggregating from the dataset.

Try sum(if(user_id=1,0,number))

View solution in original post

12 Replies
disqr_rm
Partner - Specialist III
Partner - Specialist III

If you have user_id in the dimension, why do you need to use it in the expression under if condition? May be I am missing what oyu are trying to achieve.

To me seems that if you just put sum(number) in the expression, it will give you what you are looking for.

Not applicable
Author

Its the way its aggregating from the dataset.

Try sum(if(user_id=1,0,number))

Not applicable
Author

thnx this works perfect!

Not applicable
Author

and how about my original if-function?

if (CODA_ASSETBOOK_DEPNSTARTYEAR>year(Now())-1,0,if (CODA_ASSETBOOK_DEPNSTARTYEAR+(CODA_ASSETBOOK_ASSETLIFE/12)>year(Now()),(sum(CODA_ASSETBOOK_COST)-sum(CODA_ASSETBOOK_RESIDVALUEASSET))/((CODA_ASSETBOOK_ASSETLIFE/12)-(if(year(now())-CODA_ASSETBOOK_DEPNSTARTYEAR>(CODA_ASSETBOOK_ASSETLIFE/12), 0, year(now())-CODA_ASSETBOOK_DEPNSTARTYEAR)))
,0))

the last else 0 (,0) is the problem!

Not applicable
Author

What is it returning currently?

Not applicable
Author

this is the result , line with activum COMP0003 has value 0, and the total sum is also 0, so there is a problem

Not applicable
Author

sorry, column 2009 is the column to look at

Not applicable
Author

Is that the only row that is incorrect?

Not applicable
Author

This row is correct, so there has to be a value 0 (zero)

but because there is value 0, the total line (0) is not correct, this is my problem