I just mocked up a few records because you posted a graphic and I had to type a few records.
Your table was sheet1, mine is Ankur
This is the sql I tried
Code:
SELECT Ankur.ITEM
,Ankur.Location
,Ankur.PATH
,Ankur.PARENT
,Ankur.CATEGORY
,Ankur.origin
,Ankur.qty
,Ankur.rate
,(Produced * Rate) AS EFF_Rate
,(
SELECT max(QTY) AS ProducedQty
FROM ankur AS B
GROUP BY ITEM
) AS Produced
FROM Ankur;
Here is my input:
Code:
item,location,path,parent, category, origin,qty, rate
935306,LB00,AC,935306,AL,TW10,1,.9811
935306,LB00,ACA,340000,BP,6324@TW70,1,1
935306,LB00,ACAA,340000,CE,TW70,5026, .9278
Here is the query result
ITEM |
Location |
PATH |
PARENT |
CATEGORY |
origin |
qty |
rate |
EFF_Rate |
Produced |
935306 |
LB00 |
AC |
935306 |
AL |
TW10 |
1 |
0.9811 |
4931.0086 |
5026 |
935306 |
LB00 |
ACA |
340000 |
BP |
6324@TW70 |
1 |
1 |
5026 |
5026 |
935306 |
LB00 |
ACAA |
340000 |
CE |
TW70 |
5026 |
0.9278 |
4663.1228 |
5026 |