Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Sort Formula Field Post Reply Post New Topic
Page  of 2 Next >>
Author Message
ridershaun
Newbie
Newbie


Joined: 31 Aug 2010
Online Status: Offline
Posts: 32
Quote ridershaun Replybullet Topic: Sort Formula Field
     Posted: 02 Feb 2015 at 6:39am
I need to sort a formula field in descending order after it shows the data in the three types of groups and was wondering how I go about accomplishing that. If anyone could offer any insight it would be appreciated.

Thank You
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 02 Feb 2015 at 7:01am
please explain more...
you need to have the groups sorted?
In descending order based on what? A group sum or count?
group sorting can be done only against summarized data using functions like count, sum, average. It cannot be done with Running Totals or shared variable results.


Edited by DBlank - 02 Feb 2015 at 7:01am
IP IP Logged
ridershaun
Newbie
Newbie


Joined: 31 Aug 2010
Online Status: Offline
Posts: 32
Quote ridershaun Replybullet Posted: 02 Feb 2015 at 7:13am
I have a formula that calculates the variance of purchase order quantities and I want the highest variance listed on the top, but since it is a formula field there is not a section to sort. The details are broken out into multiple groups based on the PO type. I have listed an example of how the report is broken up currently. I want to have in the SCAN section it go in order of 4, 1, & -4 and in the AUTO section it go in order of 5, -1. Hope this helps.

Item Avg Qty   Cur Qty Var
SCAN
40555     5        6     1
40557     8        4     -4
12124     4        8     4

AUTO
40556     5        10    5
16666     2        1     -1   
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 02 Feb 2015 at 7:18am
is your qty var formula a simple subtraction of cur-avg fields?
IP IP Logged
ridershaun
Newbie
Newbie


Joined: 31 Aug 2010
Online Status: Offline
Posts: 32
Quote ridershaun Replybullet Posted: 02 Feb 2015 at 7:23am
Yes my formula is a subtraction of the current-average fields.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 02 Feb 2015 at 11:45am
unless you used a whilereading or whileprinting records it should be an option in the sort order.
IP IP Logged
Vimal Nair
Newbie
Newbie
Avatar

Joined: 29 Dec 2014
Location: United Arab Emirates
Online Status: Offline
Posts: 26
Quote Vimal Nair Replybullet Posted: 02 Feb 2015 at 7:23pm
You have a grouping on SCAN field. But the sorting should be on Qty Var field. Is my understanding correct?
Born To Live
IP IP Logged
ridershaun
Newbie
Newbie


Joined: 31 Aug 2010
Online Status: Offline
Posts: 32
Quote ridershaun Replybullet Posted: 03 Feb 2015 at 2:50am
Your understanding is correct, it is a formula field that calculates the type of order that was created. SCAN, AUTO, ETC.
IP IP Logged
ridershaun
Newbie
Newbie


Joined: 31 Aug 2010
Online Status: Offline
Posts: 32
Quote ridershaun Replybullet Posted: 03 Feb 2015 at 2:55am
I have used a whileprinting records since I'm calculating cost on each month of data that is running in the report.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 Feb 2015 at 3:22am
so you are grouping on scan?
I don't see anything in this about cost or months?
What is the formula you are using to get Qty Var?
If it is using any formula fields include them.
 
Can you write a stored procedure or a command object as your data source?
IP IP Logged
Page  of 2 Next >>
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