AKPolarBear
MIS
I have a report built for reviewing purchase/sales/forecasting by item for the current month. Our purchasing dept. uses this as part of the inventory control and ordering functions.
I have run into a (common) problem when using CRW and some of the Macola databases - more than one entry for an item. Sometimes this is a linking problem, other times it is related to the number of entries for that item. I.E. if it has 1 entry, it reports once. It there are 3 entries, then it repeats all the data 3 times. This is what I am fighting now with the Forecast order file.
Here is the formula I am using:
if month(currentdate) = month(numbertodate({MSSCHFIL_SQL.due_dt}))
then {MSSCHFIL_SQL.ms_qty}
else 0
Works great if only one FO for the item in the current month. It selects the current month and ignores the others in the data file.
In another part of the report, it shows the forecast for the following month as well, based on this same formula.
An example of this is if one item has two FO's per month with quantities that are 100 & 200. Total FO should be 300 for that item/month. What CRW reports shows are 4 entries: 100,200,100,200 for a total of 600.
Can anybody suggest a way to prevent this duplication? I have run into this before and am not always able to solve it. I suppose I could have CRW count the number of entries and divide the total by that number, but that does not appear to be the correct solution even if it does work!
I have run into a (common) problem when using CRW and some of the Macola databases - more than one entry for an item. Sometimes this is a linking problem, other times it is related to the number of entries for that item. I.E. if it has 1 entry, it reports once. It there are 3 entries, then it repeats all the data 3 times. This is what I am fighting now with the Forecast order file.
Here is the formula I am using:
if month(currentdate) = month(numbertodate({MSSCHFIL_SQL.due_dt}))
then {MSSCHFIL_SQL.ms_qty}
else 0
Works great if only one FO for the item in the current month. It selects the current month and ignores the others in the data file.
In another part of the report, it shows the forecast for the following month as well, based on this same formula.
An example of this is if one item has two FO's per month with quantities that are 100 & 200. Total FO should be 300 for that item/month. What CRW reports shows are 4 entries: 100,200,100,200 for a total of 600.
Can anybody suggest a way to prevent this duplication? I have run into this before and am not always able to solve it. I suppose I could have CRW count the number of entries and divide the total by that number, but that does not appear to be the correct solution even if it does work!