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

Sum distinct records

Status
Not open for further replies.

JasonMcConnell

Technical User
Mar 10, 2005
29
GB
Hello all,

I am relatively new to crystal (8.0) and have the following problem.

I have a created a report which displays the total number of Applications Received.

Initially the information was duplicating so I grouped it by Application number and dragged the fields into the group footer. This has solved the duplication Problem.

However I need to produce a table at the end of the report which shows the total number of applications by type. To this I have drawn the table using the draw line function and have created a formula for each type that’s says

If applicationtype = “Name of Type” then 1 else 0

However when I sum the total it counts all the duplicated records??

Can anybody provide me with a formula that will Sum only distinct records

Hope this makes sense

Thanks for your help.

Jason
 
Why not insert a crosstab, using type as the row and distinctcount of application number as the summary?

-LB
 
There are a few apporaches available, and since you didn't state WHERE you placed your formula, I'll just give you the generic answers:

Use a Running Total (RT) type of summary field, and select Distinct Count as the RT type.

or

Use the 2 formula method:

Group header:

whileprintingrecords;
numbervar MyCount:=MyCount+1

Then in the report footer you can display the total using:

whileprintingrecords;
numbervar MyCount

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top