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

Running Total of Numeric Data 2

Status
Not open for further replies.

Estandridge

IS-IT--Management
Jul 27, 2004
14
US
You guys have been wonderful in the past, I'm really getting along with this program now. There's still quite a bit I don't know but with experts like yourselves and consultants who charge too much I'm sure I'll get it all figured out. Anyway, on to the question:

I have a series of numbers I'm trying to add:

111 <--(Order Number)
111
111
222
222
333
333
333
333

I'm trying to think of a formula that will only add the groups of numbers together. I can't group the numbers because of the way the report was set up, but I need to get a count of the number of orders. I should come up with a total of 3 orders. How would I be able to do this?

Thanks again for all your help! You guys are awesome!
Eric
 
Please say your Crystal version, it makes a difference to the possible methods.

Assuming Crystal 8.5, you need a distinct count. This should be available in both running totals and summary totals.

Madawc Williams (East Anglia)
 
May be you can use this formula. The order coulun should be sorted for this to work correctly.

numbervar counter;
If onfirstrecord then counter := {Table2.OrderID}
else
if {Table2.Field1} <> previous({Table2.OrderID}) then counter := {Table2.OrderID} +counter ;
counter;

kutoose@yahoo.com
 
To expand on Madawc's suggestion, right click on {table.ordernumber}->insert summary->distinctcount.

-LB
 
Thank you all for your help. I was able to modify kutoose's formula a little and got it to work out fine. The version of Crystal Reports that I have (8.5) doesn't have the help files installed so I've had a lot of trouble with formulas, as there is nowhere for me to look to find what commands I can use. You've all been a great help, and is very much appreciated! Thanks!
Eric
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top