0
Former Member
Jul 08, 2015 at 07:17 PM

# Carrying multiple values throughout report

17 Views

I have a report that is broken down into multiple manufacturing orders per project by priority, and those manufacturing orders list the parts that are needed to be pulled from inventory. Parts can be asked for in multiple manufacturing orders, but not every manufacturing order is the same. Each part has an on-hand quantity associated with it and I'd like to figure out a way to subtract the quantity needed from the on hand quantity and have it trickle down the report. This way, I can tell if I have enough parts on hand to pull for EVERYTHING on the manufacturing orders. I'll try to show an example below:

For simplicity, all parts have a starting on hand quantity of 6 (this would be a field from the database per part):

{JOB} {PART} {NEED} {LEFTOVER}

AAAAAA 12345 2 4

AAAAAA 23456 1 5

AAAAAA 34567 5 1

BBBBBB 01234 7 -1

BBBBBB 12345 3 1

BBBBBB 56789 1 5

CCCCCC 12345 1 0

CCCCCC 34567 6 -5

CCCCCC 56789 4 1

(Sorry if it's not lined up right, but hopefully the concept is there). So then I could filter the report such that it shows I can pull all of the parts for job AAAAAA, but not BBBBBB or CCCCCC because there wouldn't be enough of ALL parts leftover once I pulled for AAAAAA. What I can't figure out is how to start with an on hand quantity per part, subtract the quantity needed per part and then bring that leftover quantity down to the next manufacturing order instead of the original quantity on hand.

I've tried making a subreport grouped by part with the manufacturing jobs in the details and using a variable to subtract it out, but then when I link it to my main report using the manufacturing order, it always reverts back to the original quantity on hand and not the quantity from the previous manufacturing order. I dabbled a little bit with an array (not totally familiar with how to use these). Since Crystal doesn't do multi-dimensional arrays, I tried to make a string out of the part and the quantity to see if I could keep track of it that way throughout the report, but when I try to drag a field into the array it gives me an error: "The result of a formula cannot be an array".

I'm not sure if I'm doing something wrong or thinking about this wrong, but any input would be greatly appreciated.