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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
ivandrago
Creator II
Creator II

Not getting the correct sum figure

Hi,

For the expression COP on the Summary chart the SUM Function does not seem to be returning the correct results?
I want the value 1672.80 (this is worked out if you sum the cost field on the Detail table) but I am getting 314.3703 any ideas why this is?

Thanks

Labels (1)
1 Solution

Accepted Solutions
ivandrago
Creator II
Creator II
Author

Now works I have used this formula

sum

(aggr(sum(Cost), [Bin ID],Location,[Location Description],[Part ID],PlaceId))

View solution in original post

6 Replies
syed_muzammil
Partner - Creator II
Partner - Creator II

Hi,

The sum function is correct. If you create a simple Table box with fields Part Group and cost then you can see that the Sum(Cost) is correct. There maybe some other problem.

Regards,

Syed.

disqr_rm
Partner - Specialist III
Partner - Specialist III

It's because you have multiple records for the same PartPK in Stock table compare to the Parts table.

For example for for PartPK = tree_COR36L8681 you have 7 records in Stock table and 1 record in Parts table. The chart is considering only 1 occurrence of this value.

It seems, to me, that you need to multiple the cost with some kind of Quantity field from Stock. So it would be that you are getting the cost from Parts table and then multiplying with Quantity from Stock table, so it will give you the value you need.

I tried with multiplying with "Quantity On Hand Usable" and it seems to be giving pretty close results to what you are looking for. Try changing expression to SUM(Cost * [Quantity On Hand Usable]) and you will see the results. Make sure to pick the right field for this quantity multiplication.

Hope this helps you.

llauses243
Creator III
Creator III

Hi Rakesh,

Excelent explain, i does attach .qvw for find duplicates (in all fields of records), this case is typical ¡¡

For NOT omit records duplicates on accounting if exists key duplicates to use RowNo()

good luck, Luis.

Not applicable

Hi

Could you pls explain how to include the duplicates in the calculation...

I have the field with 200,200,200,300

here 200 is repeated 3 times...

but wen i do the calculation it will take only one..

how to include all the values...

thanks in advance

ivandrago
Creator II
Creator II
Author

Has anyone got any other ideas? I tried SUM(Cost * [Quantity On Hand Usable]) but it is not giving me the result I want?



ivandrago
Creator II
Creator II
Author

Now works I have used this formula

sum

(aggr(sum(Cost), [Bin ID],Location,[Location Description],[Part ID],PlaceId))