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

Sort specified, THEN sort ascending ... this must be possible!

Status
Not open for further replies.

jollyreaper

Technical User
Jul 25, 2005
105
US
I have a group that needed to have the data split into two groups. Sort specified order did this wonderfully. However, now I have to sort the data within the specified order!

Right now it's coming through like this:

Group in Question

Sort 1 (specified order)
123
321
221
231

Sort 2 (specified order)
664
432
744
503

What I'd like it to do is this:

Group in Question

Sort 1 (specified order, then ascending)
123
221
231
321


Sort 2 (specified order, then ascending)
432
503
664
744

I know I must be missing something. From what I can see, I only have the choices of ascending OR specified order. There has to be a way!
 
Create a formula field which is just the same field that you used for your grouping.
You can then sort on this formula field.
 
What is your group field? Is it a formula? Please share. I'm not sure how to interpret your example. Are "Sort 1" and "Sort 2" the two instances of your group field? What are the numbers underneath from?

I'm going to guess that you used specified to create two faux groups. Instead, you could have used a formula like:

if {table.field} in [123,321,221,231] then "Sort1" else "Sort2"

Insert a group on this and then go to report->sort records->use {table.field} ascending as your sort field.

-LB
 
That's weird. I posted a reply here and it didn't take.

Reposting....

Aha!!! Stumbled across a crazy solution that worked.

Under group expert, I dragged the field over twice. Specified Order on the first one, Ascending on the second. Then I had to delete the headers and footers from that second group that weren't needed and everything looks spiffy now. Success!!!
 
In 8.5, I was able to group, and then to sort descending by a totals formula in the report by choosing Report -> Top N/Sort Group Expert. This allowed me to choose the field to sort on and define how to do so. This was the only way I found to display groups in order by a subtotal field in the report.

Also, thanks for all of the help - it's really been critical for me just starting out!
 
Crystal is nice and powerful. Somewhat cumbersome at times but that's the price you pay for the features. You can do just about anything with these reports but the trick is figuring out how!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top