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

Sorting after grouping....

Status
Not open for further replies.

mathew001

Programmer
Jun 28, 2002
25
US
I am creating a report which is grouped by a field called say, Affiliation ID. An affiliation has more than one customer associated with it. The report I created is grouped by affiliation id and displaying the customers associated with it( I am supressing the group name field).

The customers associated with an affiliation id is 2 or 3 and all of them in a group starts with same alphabet. Now I want these values of customers in ascending order. In my report the group is created in ascending order.

Group Name - 111 - suppressed
Baxxon Field
Baxxen Corps

Group Name - 112 - suppressed
Anexample1
Anexample2

---
---

Now I want this to be displayed in ascending order...

Anexample1
Anexample2

Baxxen Corps
Baxxon Field


Thanks !!!
 
Click on report, sort records, pick the customer name as the secondary sort field (Affiliation will be the first by default because you are grouping on it.) and you are done.

Software Training and Support for Macola, Crystal Reports and Goldmine
251-621-8972
dgilsdorf@mchsi.com
 
Hi dgillz,
That will sort within a group only !
Baxxen Corps will come before Baxxen Field. But I also want

Anexample1
Anexample2

to be displayed before

Baxxen Corps
Baxxon Field

Thanks!


 
Is there any alphabetical overlap between the groups? Also, are the groups determined by the first x letters of the customers?

If the answer to the second question is yes, create a formula, say, xlets

Left({customerfield},x) where x is the number of chars used for assigning the groups and then group on this instead of the affiliation ID. If any customers have less than x chars in their name you will need to check for this.

If this is not the case but there is no alphabetical overlap between the groups, can you get rid of the grouping? You can use Previous({affiliateID}) and next({affiliateID}) to test for when the group break occurs. Any summaries etc, will need to be worked out with formulas and cleared at the start of a new affiliateID etc.
 
The simple work around is to create a formula of:

@Initial_Letter
Left({CustomerName},1)

Create Group 1 on @InitialLetter
Create Group 2 on AffiliationID Steve Phillips, Crystal Consultant
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top