BradCustom
IS-IT--Management
I need some help with a formula to calculate the number of pieces remaining and when the remaining quantity reaches 0 or less than 0 then I'd like to know the "need date".
Below is how the report is structured.
I have 7 Sub-reports which pass data to the Main report. I believe that I need the passed data from 3 of the Sub-reports. The Sub-reports are listed below.
Sub-InProdQty
Sub-POStatus
Sub-On Hand Qty
Sub-Hardware Demand
Sub-InProductionQty
Sub-SO Del-Job Time
Sub-JobLeadDays
The Sub-Hardware Demand report shows the number of pieces required for a given delivery date and summerizes the total. I've passed data from the Main report to the Sub-report to do a couple of formuals. The data passed is "PassQtyAssy" which is the number of pieces used per Assembly.
Pass Formula:
The formulas in Sub-Hardware Demand are listed below:
"DelLineQty"
"LineQtyPerAssy"
"VarLineQty"
"display"
"PassTotalDemand"
This PassTotalDemand is used in a formula on the Main report.
On the Sub-InProdQty report I pass the total In Production to the Main report. Below is the formula:
"PassInProdQty"
On the Sub-POStatus report I pass the total Remaining Open on Purchase Orders to the Main report. Below is the formula:
"PassTotRemainQty"
On the Sub-On Hand Qty report I pass the total In Inventory to the Main report. Below is the formula:
"PassInvOnHand"
What I'd like to be able to do is add (total Inventory + Total Remaining Open PO Quantity + In Production Quantity) which would equal the W.I.P Quantity. Then use that total and subtract each "Sub-Hardware Demand" delivery line quantity. When the result is equal to or less than 0 I'd like to know the "Need Date" which is on the Sub-Hardware Demand report.
My question has two parts; 1 would it be better to do this on the "Sub-Hardware Demand" report where the delivery dates reside. 2 How can I accomplish this?
Thanks for your help!!!!
Please let me know if anything isn't clear or you need more information.
Below is how the report is structured.
I have 7 Sub-reports which pass data to the Main report. I believe that I need the passed data from 3 of the Sub-reports. The Sub-reports are listed below.
Sub-InProdQty
Sub-POStatus
Sub-On Hand Qty
Sub-Hardware Demand
Sub-InProductionQty
Sub-SO Del-Job Time
Sub-JobLeadDays
The Sub-Hardware Demand report shows the number of pieces required for a given delivery date and summerizes the total. I've passed data from the Main report to the Sub-report to do a couple of formuals. The data passed is "PassQtyAssy" which is the number of pieces used per Assembly.
Pass Formula:
Code:
whileprintingrecords;
shared numbervar QtyPerAssy :={Material_Req.Quantity_Per}
The formulas in Sub-Hardware Demand are listed below:
"DelLineQty"
Code:
whileprintingrecords;
shared numbervar QtyPerAssy;
"LineQtyPerAssy"
Code:
{@DelLineQty}*{'Schedules_Excel_Download_'.Open Sched Qty}
"VarLineQty"
Code:
whileprintingrecords;
numbervar sumline := sumline + {@LineQtyPerAssy}
"display"
Code:
whileprintingrecords;
numbervar sumline;
"PassTotalDemand"
Code:
whileprintingrecords;
shared numbervar DemandTotal := if isnull (Sum ({'Schedules_Excel_Download_'.Open Sched Qty}, {'Schedules_Excel_Download_'.Part Nbr}))
then 0
else (Sum ({'Schedules_Excel_Download_'.Open Sched Qty}, {'Schedules_Excel_Download_'.Part Nbr}))
This PassTotalDemand is used in a formula on the Main report.
On the Sub-InProdQty report I pass the total In Production to the Main report. Below is the formula:
"PassInProdQty"
Code:
whileprintingrecords;
shared numbervar inprodqty := {@InProdQty}
On the Sub-POStatus report I pass the total Remaining Open on Purchase Orders to the Main report. Below is the formula:
"PassTotRemainQty"
Code:
whileprintingrecords;
shared numbervar totrem := {@display}
On the Sub-On Hand Qty report I pass the total In Inventory to the Main report. Below is the formula:
"PassInvOnHand"
Code:
whileprintingrecords;
shared numbervar InvTotal := if isnull ({Material_Location.On_Hand_Qty})
then 0
else
Sum ({Material_Location.On_Hand_Qty}, {Material_Location.Material})
What I'd like to be able to do is add (total Inventory + Total Remaining Open PO Quantity + In Production Quantity) which would equal the W.I.P Quantity. Then use that total and subtract each "Sub-Hardware Demand" delivery line quantity. When the result is equal to or less than 0 I'd like to know the "Need Date" which is on the Sub-Hardware Demand report.
My question has two parts; 1 would it be better to do this on the "Sub-Hardware Demand" report where the delivery dates reside. 2 How can I accomplish this?
Thanks for your help!!!!
Please let me know if anything isn't clear or you need more information.