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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to calculate Stock with Weighted average ?

How to calculate stock with weighted average by using stock ledger?

7 Replies
marcus_sommer

I think this will be helpful: Average – Which average?

- Marcus

Anonymous
Not applicable
Author

could you share some sample data?

else go thru:

Help on weighted average

Weighted average

miguelbraga
Partner - Specialist III
Partner - Specialist III

Hey there,

Do you have a qvw in which you need that average so that we can provide a solution for your problem?

Thanks,

MB

Not applicable
Author

In my stock i have same TWO quanties  which i purchased at different rates follows:

srno   Item   qty   product_rate    value

1.         A      10         1                 10

2.         A       6          1.5               9

Now in my stock have 5qty from my 1st purchase (with purchase rate as rs.1)

and 2nd purchase  i have 6qty .

now as per me weighted avg: is =

   total qty=5+6=11 and value=5+9=14

and product rate changes  to rs.1.27

Anonymous
Not applicable
Author

For weighted avg, you can try:

sum(Value)/sum(Qty)

miguelbraga
Partner - Specialist III
Partner - Specialist III

Or something like this:

= Sum(Value) / Count(Value)

marcus_sommer

Within charts you could use something like this:

rangeavg(above(sum(value), 0, rowno(total)))

and within the script you could use peek() and previous() to access previous records: Peek() or Previous() ?

- Marcus