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

Announcements
Q&A with Qlik - Qlik Cloud Migration: Questions about migrating to Qlik Cloud? Catch the latest replay!
cancel
Showing results for 
Search instead for 
Did you mean: 
zahidrahim_ocp
Partner - Creator
Partner - Creator

Wrong Table Total

Dear Experts,

I have a column in table with some calculation. It is showing correct individual values but the total is wrong. I export the data in excel and the total in excel and qlik have huge difference.

Formula used is:

((SUM(FABS(INPUT_QUANTITY))-SUM(OUTPUT_QUANTITY))/SUM(FABS(INPUT_QUANTITY)))*100

Regards,

Zahid Rahim

1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

May be use this

Sum(Aggr(

((SUM(FABS(INPUT_QUANTITY))-SUM(OUTPUT_QUANTITY))/SUM(FABS(INPUT_QUANTITY)))*100,

YourDimension/s))

Also, look here

Sum of rows in pivot tables ‒ QlikView

View solution in original post

4 Replies
sunny_talwar
MVP
MVP

May be use this

Sum(Aggr(

((SUM(FABS(INPUT_QUANTITY))-SUM(OUTPUT_QUANTITY))/SUM(FABS(INPUT_QUANTITY)))*100,

YourDimension/s))

Also, look here

Sum of rows in pivot tables ‒ QlikView

agigliotti
MVP
MVP

try with below expression:

(

sum( FABS(INPUT_QUANTITY) - OUTPUT_QUANTITY )

/

SUM( FABS(INPUT_QUANTITY) )

)

* 100

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
zahidrahim_ocp
Partner - Creator
Partner - Creator
Author

Dear Sunny,

Thank you very much. You were always my life savor. May i know the reason as why my expression was showing wrong total whereas your gave correct totals.

Regards,

Zahid Rahim

sunny_talwar
MVP
MVP

What I gave you is basically doing sum of individual rows, where as without Sum(Aggr()) it performs the same calculation for the total row... i.e.

It will first perform the numerator calculation and sum it up

((SUM(FABS(INPUT_QUANTITY))-SUM(OUTPUT_QUANTITY))

and then the denominator calculation

SUM(FABS(INPUT_QUANTITY))

and then divide it....

Does that make sense?