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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
ecabanas
Creator II
Creator II

sum total error in table

    Hi,

I have an error in total cost field. The TOTAL in cost field did not sum correctly,

Anyone knows how to fix it?

Many thank's

10 Replies
Kushal_Chawda

What is the error?

swuehl
MVP
MVP

Try

sum( Aggr(

(sum ({<CalendarYear =,CalendarMonthName=,CalendarMonthAndYear={">=$(=addmonths(max(CalendarMonthAndYear),-1200)) <=$(=Max(CalendarMonthAndYear))"}>} UNIDADES)*-1)

*

Avg ({<CalendarYear =,CalendarMonthName=,CalendarMonthAndYear={">=$(=addmonths(max(CalendarMonthAndYear),-1200)) <=$(=Max(CalendarMonthAndYear))"}>} WAC)

,DES_FAMILIA,DES_SUB1,DES_SUB2,ITEMID,ITEMNAME)

)

ecabanas
Creator II
Creator II
Author

Hi Kush

Sorry the error is inside the doc. The TOTAL in cost field did not sum correctly,

ecabanas
Creator II
Creator II
Author

Hi swuehl

If I apply your formula, see that there are some lines not multiplying:

2015-07-16_12h39_09.png

Kushal_Chawda

Hi,

You need to aggregate it by all the dimensions of the pivot table.

Please see the attached

swuehl
MVP
MVP

Can't reproduce your data, have you changed the selection compared to the uploaded version?

edit: third line shows only 5 units at my version, and it does multiplicate to cost

ecabanas
Creator II
Creator II
Author

Hi swuehl

Yes I update the date but the problem is the same, there are 6 units, cost, but not multiplies and I don't know why

ecabanas
Creator II
Creator II
Author

Hi Kush

Now it sums but there are some lines not multiplying, you know why?

Many thank's

swuehl
MVP
MVP

What do you mean 'I update the date', have you reloaded it?

I do get a full set of cost and total with your original file.

Family DES_SUB1 DES_SUB2 ITEMID ITEMNAME UnitsAvg WAC Cost
Total 11 9,51 79,31
08.BEBE E INFANTIL14.VIAJE06. BASES Y FIJADORES DE SILLA10363680BASE BEBE CONFORT 2WAYFIX NEGRA0127,600,00
10363787PARASOL ENROLLABLE BEBE CONFORT18,038,03
10363788KIT DE VIAJE BEBE CONFORT510,2051,00
10363789RETROVISOR BEBE CONFORT02,550,00
10363790REPOSACABEZAS DE VIAJE BEBE CONFORT54,0520,27

To see you issue, please describe what you have changed or upload a new sample file.