BradCustom
IS-IT--Management
Hi,
I need some help with a running total. Below is the description of the report and formulas being used.
I'm trying to calculate the remaining inventory balance by subtracting the Order Qty for each detail line.
The Main Report has three groups:
Order_Date
Sales Order
Material
There are two Subreports: first is InProdQty (In Production Quantity) and second is OnHandQty (On Hand Quantity). I've passed the total of each to the main report using the following formulas. Both subreports are linked to the Main Report by the Material field.
"InProdQty"
"OnHandQty"
Both passed variables display fine on the Main Report. On the Main Report I have the following formula to find the Total Available.
"TotInvAvailable"
Next I tried using two formulas that I've used in the past for a similar problem but I'm obviously doing something wrong.
First is the variable:
"VarLineQty"
Second formula:
"display"
What I'd like to do is a running total where the Order Quantity is subtracted from "TotInvAvailable" which would show the remaining inventory. I'd also like to reset the running total on the Material Group. I'm not sure how this will work because of the group order; 1st Date, 2nd Sales Order, 3rd Material.
Because this report is sorted by Date first you could have material "123" as the first record, the 12th record and the 18th record. Record placement is of course dictated by the Order Date. I'm not sure if this will cause a problem for the running total but I thought I'd mention it.
Thanks you all your help!!
I need some help with a running total. Below is the description of the report and formulas being used.
I'm trying to calculate the remaining inventory balance by subtracting the Order Qty for each detail line.
The Main Report has three groups:
Order_Date
Sales Order
Material
There are two Subreports: first is InProdQty (In Production Quantity) and second is OnHandQty (On Hand Quantity). I've passed the total of each to the main report using the following formulas. Both subreports are linked to the Main Report by the Material field.
"InProdQty"
Code:
whileprintingrecords;
shared numbervar InProdQty :={@InProdQty}
"OnHandQty"
Code:
whileprintingrecords;
shared numbervar onhandqty :=Sum ({Material_Location.On_Hand_Qty}, {Material_Location.Material})
Both passed variables display fine on the Main Report. On the Main Report I have the following formula to find the Total Available.
"TotInvAvailable"
Code:
{@PassInProdQty}+{@PassOnHandQty}
Next I tried using two formulas that I've used in the past for a similar problem but I'm obviously doing something wrong.
First is the variable:
"VarLineQty"
Code:
whileprintingrecords;
numbervar sumline := sumline - {SO_Detail.Order_Qty}
Second formula:
"display"
Code:
whileprintingrecords;
numbervar sumline;
What I'd like to do is a running total where the Order Quantity is subtracted from "TotInvAvailable" which would show the remaining inventory. I'd also like to reset the running total on the Material Group. I'm not sure how this will work because of the group order; 1st Date, 2nd Sales Order, 3rd Material.
Because this report is sorted by Date first you could have material "123" as the first record, the 12th record and the 18th record. Record placement is of course dictated by the Order Date. I'm not sure if this will cause a problem for the running total but I thought I'd mention it.
Thanks you all your help!!