Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Highlighted
Esteemed Contributor III

Re: sum does not equal total

Are there any duplicates or your expr is using any DISTINCT in your Sum() function in the front end worth a check.

Highlighted
Partner
Partner

Re: sum does not equal total

Looks like, while calculating the sum only distinct data values were considered.

in given example Numbers 8 & 9 have multiple occurrences. While summing if only distinct values are considered then sum value will come up as 35 instead of 52.

Highlighted
Honored Contributor

Re: sum does not equal total

There may be, a variable used in your measures expression, was not able to compute successfully. When you filter by that dimension as dimension did not affect the variable.

Try to amend the variable to ignore all filters, then the expression will be, able to compute even with filter applied.

Highlighted
Contributor

Re: sum does not equal total

are you using distinct function for a dimension in set expression of sum? it could be possible that you might have some duplicates among dimensions. for total option, you can use SUM instead of auto

New Contributor III

Re: sum does not equal total

Sager,

Thank you for the input are you suggesting the sum of rows in the total mode, when you say "you can use SUM instead of auto"?

Thanks,

John Worth

BI Data Analyst

Upper Lakes Foods

p: 800.879.1265 ext 4278

w: upperlakesfoods.com<http://upperlakesfoods.com/>

Highlighted
New Contributor III

Re: sum does not equal total

Bala,

Can you show me an example?

Thanks,

John Worth

BI Data Analyst

Upper Lakes Foods

p: 800.879.1265 ext 4278

w: upperlakesfoods.com<http://upperlakesfoods.com/>

Highlighted
New Contributor III

Re: sum does not equal total

Rohan,

Thank you for the feedback, the formula in the example was sum(Field 5), but I do see where using sum (distinct Field 5) would give you a result closer to 39.

Thank you,

John Worth

BI Data Analyst

Upper Lakes Foods

p: 800.879.1265 ext 4278

w: upperlakesfoods.com<http://upperlakesfoods.com/>

Highlighted
Valued Contributor

Re: sum does not equal total

sum(num(Field2))


Highlighted
New Contributor III

Re: sum does not equal total

William,

Thanks for the update,

John Worth

BI Data Analyst

Upper Lakes Foods

p: 800.879.1265 ext 4278

w: upperlakesfoods.com<http://upperlakesfoods.com/>

Highlighted
Valued Contributor

Re: sum does not equal total

In your example the sum is less than the expected total.Is that actually happening or is the total to large? If you data model is incorrect I would expect the total to be duplicating values making to actual total larger. 


If you change sum to count, do you have to correct number of records?