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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
DJ55
Contributor III
Contributor III

Weighted average calculation

Hi Everyone,

I am trying to calculate weighted average cost for Material by Fiscal year to show the price trend for below mentioned data.

I have used this formula is qlik. 
sum((OrderQty*OriginalNetPrice*Exch. Rate)/Priceunit_Cal)/sum(OrderQty)

consider Priceunit_cal = 1

I am getting an answer 20.24 for FY21 by actual answer should be approximately 14.

Can anyone help me with the correct formula?

Fiscal Year Created on Material ordered qty. original Net price Curr. X Rate Price (CAD/kg)
FY21 03/17/2021 7-8 24000 12.6 USD 1.278 16.1028
FY21 03/17/2021 7-8 24000 12.6 USD 1.278 16.1028
FY21 02/08/2021 7-8 24000 12.6 USD 1.278 16.1028
FY21 02/08/2021 7-8 24000 12.6 USD 1.278 16.1028
FY21 04/22/2020 7-8 24000 8 USD 1.4 11.2
FY21 04/22/2020 7-8 24000 8 USD 1.4 11.2
FY21 04/22/2020 7-8 24000 8 USD 1.4 11.2
FY20 02/27/2020 7-8 12000 6.6 USD 1.3104 8.64864
FY20 02/27/2020 7-8 12000 8 USD 1.3104 10.4832
FY20 02/27/2020 7-8 24000 6.6 USD 1.3104 8.64864

 

Thank you. 

1 Reply
DJ55
Contributor III
Contributor III
Author

@sunny_talwar 
Hi Sir, Could you please help me with this?