Is there a way to use a calculated value rather than having to re-use the formula in each column of a query?
For example...
Need the following calculations:
Layman's Terms:
Maximum Quantity is the allowed quantity over quantity ordered we may ship and bill. Example - Overrun is 5% (.05). Customer orders 100, we can ship 105 and bill.
Excess Quantity is the quantity manufactured above the Maximum Quantity. Example - we produce 108, Excess is 3. If we produce less than Max Qty the value is 0 (zero).
Excess Sold is the quantity of Excess Quantity that customer agreed to buy. Example - Customer agrees to purchase 2 of the 3 Excess Qty, 2 is the Excess Sold.
In my queries I have to repeat the same formula snippet:
Max_Qty: Qty_Ordered * (1 + Overrun_pct)
Excess_Qty: IIf(QTY_MFG > (Qty_Ordered * (1 + Overrun_pct)),Qty_Ordered * (1 + Overrun_pct)-QTY_MFG,0)
Excess_Sold: IIf(QTY_SOLD > (Qty_Ordered * (1 + Overrun_pct)),QTY_SOLD - (Qty_Ordered * (1 + Overrun_pct),0)
* Max Qty formula snippet occurs 5 times. How nice it would be to define it once and use Max_Qty instead in the other 4 places. As I understand, and have experienced, I can't reference another column.
For example...
Need the following calculations:
Layman's Terms:
Maximum Quantity is the allowed quantity over quantity ordered we may ship and bill. Example - Overrun is 5% (.05). Customer orders 100, we can ship 105 and bill.
Excess Quantity is the quantity manufactured above the Maximum Quantity. Example - we produce 108, Excess is 3. If we produce less than Max Qty the value is 0 (zero).
Excess Sold is the quantity of Excess Quantity that customer agreed to buy. Example - Customer agrees to purchase 2 of the 3 Excess Qty, 2 is the Excess Sold.
In my queries I have to repeat the same formula snippet:
Max_Qty: Qty_Ordered * (1 + Overrun_pct)
Excess_Qty: IIf(QTY_MFG > (Qty_Ordered * (1 + Overrun_pct)),Qty_Ordered * (1 + Overrun_pct)-QTY_MFG,0)
Excess_Sold: IIf(QTY_SOLD > (Qty_Ordered * (1 + Overrun_pct)),QTY_SOLD - (Qty_Ordered * (1 + Overrun_pct),0)
* Max Qty formula snippet occurs 5 times. How nice it would be to define it once and use Max_Qty instead in the other 4 places. As I understand, and have experienced, I can't reference another column.