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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using running total result in formula

Status
Not open for further replies.

AngelB

Programmer
Feb 9, 2004
1,477
GB
Hi All,

I'm using crystal reports 10 connecting to an oracle database using ODBC.

The report I am writing is product based, and is grouped by product code. On the details line are the components of that product and the alloy of each of the components. If the alloy code begins with '3' it is a gold alloy.

In the group footer, I have a running total which is the count of detail lines that have a gold alloy (evaluated if the first character is '3' and reset on change of product code). This running total is then used in a calculation in the group footer, which decides whether the product value must be multiplied by a certain percentage. If the product has any gold-based components (running total >= 1) then the value must be multiplied by 0.5.

So my footer looks like this:

Code:
[Value_Field]    [Percentage_Formula]    [Value * Percent]

I need to include a grand total summary of the
Value * Percent field, but I cannot do this because there is a running total used in the percentage calculation.

Is there another way that I can summarise this field? I apologise for the long post, but I needed to mention all the steps to fully describe the problem.


Geraint

The lights are on but nobody's home, my elevator doesn't go to the top. I'm not playing with a full deck, I've lost my marbles. Barenaked Ladies - Crazy
 
Do a running total for the whole report. Use that as the basis for a similar calcuation.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Use a variable:

//{@accum} to be placed in the group footer:
whileprintingrecords;
numbervar goldval := goldval + {@yourformula};

//{@display} to be placed in the report footer:
whileprintingrecords;
numbervar goldval;

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top