Tips and Tricks
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Tips and Tricks
Message Icon Topic: sort on running total Post Reply Post New Topic
Author Message
Despina
Newbie
Newbie


Joined: 30 Mar 2010
Location: Australia
Online Status: Offline
Posts: 31
Quote Despina Replybullet Topic: sort on running total
    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
IP IP Logged
Savan
Senior Member
Senior Member
Avatar

Joined: 14 Dec 2007
Location: India
Online Status: Offline
Posts: 162
Quote Savan Replybullet 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
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet 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
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet 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.
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.