Discussion board where members can get started with QlikView.
How to calculate stock with weighted average by using stock ledger?
I think this will be helpful: Average – Which average?
could you share some sample data?
else go thru:
Help on weighted average
Do you have a qvw in which you need that average so that we can provide a solution for your problem?
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
For weighted avg, you can try:
Or something like this:
= Sum(Value) / Count(Value)
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() ?