I'm try to do some auditing for our purchase orders, and I created this dataframe (here's a csv sample of it):
ProductName,Qty,LineCost,BuyQty1,BuyQty1Cost,BuyQty2,BuyQty2Cost,BuyQty3,BuyQty3Cost
SIGN2WH,48,40.63,5,43.64,48,40.63,72,39.11
SIGN2BK,144,39.11,5,43.64,48,40.63,72,39.11
In my data source, some products get different breaks, depending on the quantity purchased. Hence the columns BuyQty1 and BuyQty1Cost. Qty and LineCost are the values I need to audit. So, what I'm trying to do is:
Check what quantity break corresponds to the value on the column
Qty. Example aQtyof 48 implies that the break isBuyQty2, and the corresponding price should beBuyQty2Cost.Then add a column with the ratio of
LineCost/BuyQty2Cost. It would beBuyQty3Costin the case ofSIGN2BK(2nd line).
How should I tackle this?