Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am attempting to use two different expressions within a subset of data. The expressions are to derive an adjusted Cost and Quantity for specified lines of data within the set. I am calculating cost and quantity, normally, by using the Cost and Quantity fields within my set. The adjusted calculations will need to reference other tables (“MaterialMaster” and “ComponentSubset”).
Some problems I’ve come across are due to the 1 to Many relationships I have in my ComponentSubset table. Each Sub Material can but does not always have more than one Parent Material. Additionally, each Parent Material will have at least 2 Sub Materials associated but can have 3 in some cases.
For all (Parent) Materials in my dataset that equal a Parent material in my ComponetSubset table, the following formula is needed to calculate “Adjusted Cost”:
For all (Sub) Materials in my dataset that equal a Sub material in my ComponentSubet table, the following formula is needed to Calculate “Adjusted Quantity”:
Ultimately, I am hoping to blend the normal Cost and Quantity calculation (reference Fields within dataset) with the adjusted calculations.
For example, to calculate the Adjusted Cost of (Parent) Material - 59012 and Adjusted Quantity of (Sub) Material – 59004:
Parent Qty = 15 | Sub Quantity = 40 Adjusted Quantity – 10 = 40 – 15 – 15 |
I have attempted many different designs to accomplish these calculations but have not been able to complete everything I’ve needed yet. Originally, I tried using the aggr function to aggregate by Parent and/or Sub where applicable but could not figure it out completely. I ha !ve since attempted to create temporary tables in the script, yet still have not been able to figure it out completey. Attached is a qvw and an excel file with all data needed to simulate what I need. Can anyone help, please??!!??!!