Print Page | Close Window

sort on running total

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2022
Forum Name: Tips and Tricks
Forum Discription: Have you learned some great tricks to share with the group? Post them here!
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=9743
Printed Date: 03 May 2025 at 4:14pm


Topic: sort on running total
Posted By: Despina
Subject: sort on running total
Date Posted: 19 Apr 2010 at 7:38pm
I have a running total formula which tells me how many records are stored in each file in a system.  Each file should have only have 1 record.
 
I want to highlight records and(sort in descending) order when my running total is greater than 1
 
how can I apply a sort on a running total formula?
 
Regards,
Despina



Replies:
Posted By: Savan
Date Posted: 19 Apr 2010 at 11:18pm
I think its not possible to sort on Running total, instead you can do it usinh the formula option or doing group by in the query and sorting in the query itself.

-------------
Thanks
Savan


Posted By: lockwelle
Date Posted: 20 Apr 2010 at 3:27am
yeah, you can't sort/group on a running total as it's value is not known at the time the data is read.  I have never tried to sort/group on a formula that is not predicable at the time the data is read, and I don't think that you can.
 
I believe that you would need to create the count at the time the data is read, so that CR 'knows' the value.  A stored procedure is a great way to accomplish this, a Command object might work provided that you can link the count to the file.
 
HTH


Posted By: DBlank
Date Posted: 20 Apr 2010 at 4:49am

From your description I think you can use an Insert Summary instead of a Running Total.

If you use the Insert Summary function you can sort using Top N and/or exlcude groups (e.g. any thing that has a 1) using the group seelction criteria.



Print Page | Close Window