Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Group sort on formula field

Status
Not open for further replies.

leftfldr5

IS-IT--Management
Joined
Feb 22, 2006
Messages
22
Location
US
I need a way around not being able to group sort on a formula field.

Here is the layout of my report: 2 tables and Inventory Master and Work Order table with a possible 1 to many relationship.
Item # -- Qty -- Standard Cost -- Ext Cost

The report is grouped on Item # and Ext Cost is Qty * Standard Cost. All the fields are in my group footer and all other sections suppressed. I want to sort the group by Ext Cost, but it is a formula field in the footer and it will not let me.
Please help.
 
Try posting technical infornmation rather than descriptions:

Crystal version
Database/connectivity used
Example data
Expected output

It also sounds like you don't understand what a group is. Groups are automatically sorted, so if you want something sorted by that entity it should be the group, not something else.

So a TOP N report might be what you seek, but I'll reserve advising you until you demonstrate what you have and need.

-k
 
Crystal 10, SQL database, ODBC

Yes TOP N sort is what I need on a formula field.
 
Are you saying that you dragged the detail sections into the group footer in order to show only the most recent value for example? What is the exact formula for extended cost? Does it contain any group summaries?

-LB
 
I am gathering quantity records in the detail section and then have a summary by item number in the group footer. I then taken that sum quantity and muliple it by a static cost number to get extended cost, which makes extended cost this formula:
( {IV00101.STNDCOST} * Sum ({SVC06101.QTYSOLD}, {SVC06101.ITEMNMBR})
I would know like to do a TopN sort by extended cost.
 
Create a command (database->database expert->your datasource->add command) which looks something like this:

Select Sum (SVC06101.`QTYSOLD`) as SumSold, SVC06101.`ITEMNMBR`
From `SVC06101` SVC06101
Group by SVC06101.`ITEMNMBR`

Link the command to your table on the item number field. Then in the report, create a formula {@extcost} to be placed in the detail section:

{IV00101.STNDCOST}*{Command.SumSold}

Right click on {@extcost} and insert a maximum on {@extcost} at the item number group level. This maximum summary will now be available for a topN/group sort. Even though {@extcost} will be the same as the maximum of {@extcost}, you need to do the inserted summary in order to make the group sort available.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top