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: 
jcharles
Contributor III
Contributor III

Total does not add up

Good day

I have a chart where every column's total adds up correctly except for the last column which should show the total as R384.88 but it shows R389.98. I don't know why. Can someone help please.

KEYWORDNOAMOUNTAMT PER NONO OF LEADSCOST PER LEAD
TOTAL163R1,767,380.59R10,842.834,592R389.98
Sun45R627,008.68R13,933.531,852R338.56
Move14R297,787.00R21,270.50554R537.52
Kaap35R213,786.72R6,108.19642R333.00
Family6R205,650.00R34,275.00379R542.61
krag6R111,055.50R18,509.25198R560.89
Goal6R90,732.60R15,122.10255R355.81
Iso18R80,598.01R4,477.67180R447.77
Ilanga17R69,186.35R4,069.79165R419.31
Value3R38,181.15R12,727.05102R374.33
Sonto12R24,771.86R2,064.3246R538.52
Nurse1R8,622.72R8,622.7211R783.88
Bona0R0.00-54R0.00
Drum0R0.00-38R0.00
Rights0R0.00-38R0.00
You0R0.00-38R0.00
New0R0.00-14R0.00
World0R0.00-2R0.00
Love0R0.00-2R0.00
Mthatha0R0.00-2R0.00
Khosi0R0.00-11R0.00
Kick0R0.00-1R0.00
City0R0.00-1R0.00
Times0R0.00-1R0.00
Day0R0.00-6R0.00
14 Replies
simenkg
Specialist
Specialist

And in the NO OF LEADS column:

Are you using COUNT(DISTINCT LEADNO) or COUNT(LEADNO)?

This would explain the wrong total if there are some LEADNO that exists for more than one KEYWORD. It would then only be counted once in the total.

If sum(AMOUNT) / COUNT( LEADNO) does not work, try

sum(AMOUNT) / sum(aggr(Count(Distinct LEADNO),KEYWORD)))


Regards
SKG

jcharles
Contributor III
Contributor III
Author

Thanks - this must be true because if I filter per month I get to a total of 4351 leads and not 4592 leads. I think this is the case but how do I fix it?

jcharles
Contributor III
Contributor III
Author

Thank you - This one worked

sum(AMOUNT) / sum(aggr(Count(Distinct LEADNO),KEYWORD)))

simenkg
Specialist
Specialist

Because you have a field and an expression with the same name, the expression
[AMOUNT] / [NO OF LEADS] will not work.

What I'm trying to do is tell it to take the values for those expressions and dividing them by each other. It is "the same" as using

Column(2) / Column(4)

however, using this syntax will not let you add columns before the expression.

You can rename the Expression AMOUNT into TOTAL AMOUNT and use the expression:

[TOTAL AMOUNT] / [NO OF LEADS]

Regards
SKG

Not applicable

Hi Joyce,

You have to look at the link between the different tables in your data structure and make sure that all links up correctly.

Right click on the links in your tables and look at the Subset Ratio's between the tables as well as the Information Densities.

The subset ratios need to be very close to 100%.