Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding/Subtracting values on report lines

Status
Not open for further replies.

barfnuts

Technical User
Feb 11, 2005
2
CA
Hello everyone,

I was hoping the function I need would be possible in Crystal Reports XI.

I have a purchasing report that groups parts that need to be ordered by part number. Inside that component part number is a list of different production orders that the part is allocated to. This report takes the quantity currently on hand, subtracts the quantity needed for the production order, and specifies when parts need to be re-ordered based on lead times.

The problem I seem to be having is that I can't figure out how Crystal handles equations on items in a group.

It's kind of hard to explain so below is a link to a screencap of my report:

Under the heading "On Hand", I want the value of "Qty Required" to subtract the amount "On Hand" progressively through each line and display to the right of the "Qty Required" value. For example:

Line 1 - Qty Req'd: 75 // On Hand: 35 Total: 40
Line 2 - Qty Req'd: 75 // On Hand: -5 Total: -5
Line 3 - Qty Req'd: 50 // On Hand: -40 Total: -45

The reason I want this is so that if the "Total" number is below 0, it would trigger the "Order By" column so that the purchaser is aware they need to be ordered.

Is this possible? Would I use some sort of a running total field? My knowledge of Crystal is still "in progress" so any help would be greatly appreciated.


Thanks!
 
YOur lines don't make sense, how does onhand and total relate, surely results should be

Line 1 - Qty Req'd: 75 // On Hand: 35 Total: -40
Line 2 - Qty Req'd: 75 // On Hand: -40 Total: -115
Line 3 - Qty Req'd: 50 // On Hand: -115 Total: -165


You can use a variable to do this but need to understand your logic before I can suggest how to evaluate.

Ian
 
I'm not following your math. Can you show how you arrived at your on-hand and total columns? Is there another column that is adding in product that we do not see?

-LB
 
I see the math, it is {On Hand} - {Qty Req'd}. Easy enough to create a formula to do this. I could not connect to the web link. Anyhow if {On Hand} and {Qty Req'd} are running totals, you can do math on these in a formula. Then you would have a text box that would be suppressed based on the value of the formula (i.e., fomula > 0).

I hope this helps.
 
kray4660--I think you are looking at Ian's sample, not the top one, which doesn't make sense. I agree with Ian.

-LB
 
I was, I see what you mean. Huh! The math does not make any sense.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top