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

Status
Not open for further replies.

diannelight

Technical User
Feb 24, 2003
59
0
0
US
Crystal sorts by group first and then by fields selected. Is there a way of manipulating the sort to have a particular field sort higher than the group sort?
 
Dianne

You can also sort by a formula, you can then define how you want data to appear.

Alternatively, in the Group Expert you can arrange the group in a specified order rather than just simple ascending or descending.

Ian Waterman
Crystal reports consultant (UK)
 
Ian, how do I sort by a formula?

This is my scenario:
I have 2 sorts on my report but the field in my details section is a DateID.
I'd like to sort on this Date ID and not by higher groups. I hope that's clear enough.
 
Crystal 8.5 will insist on sorting by groups, highest first. You can use a formula in place of a field so as to get the order you want: e.g. a) Bananas b) pears c) apples.

You can also use [Change Group Expert] under [Reports] to change the hierarchy of groups, does this help?

A third possibility is to add a higher group that picks up the value you want.

Madawc Williams
East Anglia, Great Britain
 
Madawc,
I'm using Crystal 9.
I have tried inserting a higher group - which works but then my other totals don't add up correctly.
Also, when I go to the sort expert, if I select a group, the up and down buttons are greyed out and so is the Ascending and Descending options.
Please excuse my ignorance but could you help me with the code that I would write in a formula to sort?
Thank you.
 
To change the sorting of a group you need to open the Group Expert.

Go to Report, Group Expert.
Click the Options button at the bottom.
Select the Group in the first drop down list and the sort order in the second drop down list.

~Brian
 
Brian, that does the same as moving the groups around / inserting a higher group.
I'll get the date id in the correct order but then my other group by totals are grouped incorrectly.
 
dianne - The Highest sort is the Group 1...nothing can be higher than that....messing around with group order is fine but the first group you end with is the highest you can get

next comes a formula/database field sort

Formulas are flexible since they can be parameter driven giving your user some control over sorting of information after grouping...BTW you can also Group on a formula to give that kind of flexiblity at the group level

Now it seems that regrouping interferes with your sums.

I have 2 sorts on my report but the field in my details section is a DateID.
I'd like to sort on this Date ID and not by higher groups. I hope that's clear enough.


Nopes...it is not clear...just placing {Table.Date ID } after the groups in the sorting hierarchy will accomplish that....but that doesn't seem to work for you

THE QUESTION IS WHY??? until you tell us that you won't get a good answer

Jim Broadbent

The quality of the answer is directly proportional to the quality of the problem statement!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top