Print Page | Close Window

Sorting on formula field

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=6853
Printed Date: 05 May 2024 at 6:33am


Topic: Sorting on formula field
Posted By: jchan
Subject: Sorting on formula field
Date Posted: 24 Jun 2009 at 6:04pm
Can someone tell me how to sort on a sum of a formula field. I have a report that list a group along with the sum for that group. The report now is sorted in ascending order by the group name (GF1). I would like to sort it by the group sum in descending order.
 
Formula is  {spRptSector;1.Bal}/1000
Group Balance =  Sum of @Bal
 
 
Current sort:
Sector              Balance
--------              ------
Services           960,496
Construction    263,769
Stores              494,087
 
Desired sort:
Sector              Sum
--------              ------
Services           960,496
Stores              494,087
Construction    263,769



Replies:
Posted By: DBlank
Date Posted: 24 Jun 2009 at 6:53pm
in this particular case you can use the summary function as a SUM of spRptSector;1.Bal at group1 and then do a top N and sort on the SUM field.
Set  your top N high enough to display all of your groups.
suprress the SUM field and show your existing formula.


Posted By: jchan
Date Posted: 25 Jun 2009 at 8:05am
Thanks DBlank. Worked like a charm.



Print Page | Close Window