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

Sorting and Grouping

Status
Not open for further replies.

ddbrook

Programmer
Aug 19, 2002
17
0
0
US
I have a report sorted by Bill_amount(DESC), so I can get the top accounts. I also have the customer_name field(ASC).
The Bill_amount works fine but the customer_name field looses the grouping. I need the customer_name field to group with the same customer names.

Name,Cust#,Utility Type,Bill_amount are the fields.

Hornady,4567,E,$81,000.
Power,2345,E,$46,000.
Hornady,4567,E,$15,000.

The Bill_amounts are descending but the Customer_names are not grouping together. What am I not doing??

Thanks,
ddbrook
 
Are there 2 customers named Hornady? If so does one have a trailing space? Try creating a formula field trim({CustomerName}), and group on this fied rather than the database field.

Check this out and let me know what you come up with. Software Training and Support for Macola, Crystal Reports and Goldmine
251-621-8972
dgilsdorf@mchsi.com
 
dgillz: I think the two Hornadies are the same dude - hence the same customer id (which I'm assuming is a unique identifier).

ddbrook: you need to create a group on the Customer ID. Just hit the Insert menu, Group, and choose Customer ID in ascending order.

All the best,

Naith
 
Exactly, and then if you want to see top accounts (meaning groups) then subtotal the amounts by group, and use the TopN feature to put the groups in order. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Great that is completed...thanks.
Now I need to get the top 10 accounts.

I made a parm(?view) the number the user puts in..and went into Report, Edit Selection, by Group...and put in this code. RecordNumber <= {?View}
Now I am getting 10 records by the amount field I need the top 10 accounts..by the group...

Please advise.

Thanks again.
ddbrook
 
Ken headed you off at the pass there. He's already pointed you in the direction you need to go in in order to get the Top 10 records.

In the Report menu, go to TopN, and let the expert walk you through. Get rid of the RecordNumber formula.

Naith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top