Tips and Tricks
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Tips and Tricks
Message Icon Topic: Sort by Colum Value Post Reply Post New Topic
Author Message
verniqueb
Newbie
Newbie


Joined: 04 May 2009
Location: United States
Online Status: Offline
Posts: 12
Quote verniqueb Replybullet Topic: Sort by Colum Value
    Posted: 24 Aug 2010 at 8:39am
Is it possible to sort crosstab report by colum with highest value? 
 
For example my report is displayed by region, State, by product type. I would like to sort on the state with highest balance value. 
 
So each time the report is ran and New York has the hight balance value I would like New York Colum first within it's region. 
 
If Texas balance is highest the next time the report is ran I would like to see that colum first.
 
Any ideas how to do this? 
 
Thanks in advance.
VB
IP IP Logged
Emir_W
Senior Member
Senior Member
Avatar

Joined: 25 Apr 2010
Online Status: Offline
Posts: 228
Quote Emir_W Replybullet Posted: 25 Aug 2010 at 12:21am
when you create a crosstab for columns, there is 'Group Options...' button under 'Columns:' box.
try to use this function.

(maybe you'll need to create formula to set as ColumnName).


hope it help.

Emir W
IP IP Logged
verniqueb
Newbie
Newbie


Joined: 04 May 2009
Location: United States
Online Status: Offline
Posts: 12
Quote verniqueb Replybullet Posted: 25 Aug 2010 at 12:38am
I apologize but my crystal skill are not advance...i don't see the option you are referring to.  How to i get my cross-tab for colums?  Can you give me an example of how the formula should be written?
VB
IP IP Logged
djwessels
Newbie
Newbie
Avatar

Joined: 23 Aug 2010
Location: United States
Online Status: Offline
Posts: 10
Quote djwessels Replybullet Posted: 25 Aug 2010 at 8:43am
I have not found any way that the Group Options can be set to sort on an individual column or row. It will sort on overall totals, but not on values in one particular row or column.
 
I am new to Crystal Reports, using CR 2008. Has anyone had any success with doing this?
 
Thanks!
Many thanks,

DJW   
IP IP Logged
verniqueb
Newbie
Newbie


Joined: 04 May 2009
Location: United States
Online Status: Offline
Posts: 12
Quote verniqueb Replybullet Posted: 25 Aug 2010 at 12:00pm
I created a new calculated field  called header and added this field to my cross-tab columns.  The calculation on this field is: 
Sum ({Balance}, {Location}). The location with the lowest amount floats to the first colum of the report.  If another location has the lowest balance on the next run that location moves to the first colum.
Now I need to figure out how to show the location name instead of the calculation.
VB
IP IP Logged
Emir_W
Senior Member
Senior Member
Avatar

Joined: 25 Apr 2010
Online Status: Offline
Posts: 228
Quote Emir_W Replybullet Posted: 25 Aug 2010 at 10:11pm
here is what i've done.

crosstab condition:
- Row : item desc
- Column : location desc
- Detail : qty on hand

till here, it gives me standard/normal crosstab (where the QtyOnHand is not sorted).

here is to sort the QtyOnHnd:
1. right click crosstab

2. select 'Cross-Tab Expert...'

3. click on field in Columns section ({tbl.QtyOnHnd})

4. click 'Group Options...' button

5. sort by {tbl.QtyOnHnd} and set as 'Descending'

6. click on 'Options' tab

7. check for 'Customize Group Name Field'

8. select for {tbl.LocDesc} in order to print the Location name



hope it help.




Edited by Emir_W - 25 Aug 2010 at 10:26pm
Emir W
IP IP Logged
djwessels
Newbie
Newbie
Avatar

Joined: 23 Aug 2010
Location: United States
Online Status: Offline
Posts: 10
Quote djwessels Replybullet Posted: 26 Aug 2010 at 3:52am
Thanks to both of you - I'll try your suggestions and see what I come up with.
 
At the moment, I've been pulled onto another project... of course.
 
I'll get back with you on how it goes.
 
Thanks again!
 
 
Many thanks,

DJW   
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.020 seconds.