Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Sorting Issue Post Reply Post New Topic
Author Message
billbjr
Newbie
Newbie


Joined: 19 Feb 2009
Location: United States
Online Status: Offline
Posts: 14
Quote billbjr Replybullet Topic: Sorting Issue
     Posted: 26 Jul 2010 at 11:22am
I have a report where I group by account ID, then add and subtract the transactions in and transactions out using a formula to get an "account balance".
 
I want to sort the report by account balance, but Crystal 9 won't let me. It will only allow me to sort by account ID, since that is what I am grouping on.
 
How can I sort by account balance?
Bill
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 26 Jul 2010 at 11:52am
if you can change the formula to allow you to do an insert summary as a SUM youc an do a group sort of that field.
IP IP Logged
billbjr
Newbie
Newbie


Joined: 19 Feb 2009
Location: United States
Online Status: Offline
Posts: 14
Quote billbjr Replybullet Posted: 26 Jul 2010 at 11:57am
Ok, so how do I do that?
Bill
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 26 Jul 2010 at 12:02pm
what is your data?
How do you know how to read a transaction in or  a transaction out.
basically you want to create one formual field to flip each row between a postive or negative value
if field=transaction_in then amountfield else (amountfield *(-1))
then do an insert summary (sigma sign) as a SUM of this fomrual field
set in the groujp footer
once you do that (should be the same suma syour current formula) the group Sort expert will no longer be greyed out and you can sort all groups on that SUM
 


Edited by DBlank - 26 Jul 2010 at 12:03pm
IP IP Logged
billbjr
Newbie
Newbie


Joined: 19 Feb 2009
Location: United States
Online Status: Offline
Posts: 14
Quote billbjr Replybullet Posted: 26 Jul 2010 at 12:14pm
I'm not sure what you mean.
 
Here is my formula:
 
((Sum ({CDS_STATSUMMARY.CompEarned}, {CDS_PLAYER.Player_ID}))+{CDS_STATBALANCE.CompBalanceForward}+{CDS_STATBALANCE.CompPromoAdjusted}+{CDS_STATBALANCE.CompMgrAdjusted}+{CDS_STATBALANCE.RecoveredComp}-{CDS_STATBALANCE.CompRedeemed}-{CDS_STATBALANCE.ArchivedComp}-{CDS_STATBALANCE.ExpiredComp})
 
This formula gives me a comp balance. How do I get this to show in the list when I click on "Insert Summary" or "Record Sort Expert"?
Bill
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 26 Jul 2010 at 12:26pm

Sorry, won't work. Your formula uses row level records that are not group summarizations. You cannot use crystal to sort the groups this way. I have seen others post suggestions of using shared variable formulas to do this but I still think that this is a non - sortable result.

IMO you would have to get the result outside of crystal (like a view or stored procedure) and then it will be a field you can sort on in crystal.
 
Sorry
IP IP Logged
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