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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sort on parameter field

Status
Not open for further replies.

pomster

Technical User
Jan 15, 2003
88
AU
I have a numeric formula field in group footer 2 that I need to sort the report by, any ideas? I'm going round in circles!!!

cheers,


David
 
Can you show a a little example of data and what you need to do?

ro Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
Do you mean to sort your report by the (group footer 2 formula) column ?
Have you used the same formula to specify the grouping for group 2. if yes, then you can specify the sort in Grooup Options.
*************************
Pradeep Kumar Gupta
Data Warehouse Consultant.
pradeep.gupta@wipro.com
 
If you want to sort the groups by a summary value (such as sales by region etc.), then you need to use the TopN expert.

Not only does the TopN expert allow you to answer questions such as 'Who were my top 5 sales people this month?' or 'Who were my bottom 10?', if you don't specify an 'N' value, all groups will be shown sorted by the summary value. Steve Phillips, Crystal Consultant
 
In Detail I have 2 columns of data (monthly prints)

actual agreed
21324 60000
32456 60000
45678 60000
34567 60000
I need to sort on the data based on AvActual - AvAgreed
I get an error saying must be evaluated later.

Cheers,
David
 
If actual and agreed are normal database fields you should not have a problem.

The error suggests either the fields are NOT database fields OR you have included the 'WhilePrintingRecords' clause in your formula (you probably don't need this).

Another reason for the error is if these values are sumary values rather than database values.

Does any of this help? Steve Phillips, Crystal Consultant
 
My doubt: AvActual - AvAgreed (OR average of actual minus average of agreed) will be constant value. How can you sort on a constant value ?

AvActual and AvAgreed values will be calculated after all the records will be printed and therefore sorting is not possible on these values.

You may try couple of other options. Like

1) Try passing AvActual and AvAgreed value as two other columns from the data source. This may require writing a view etc. Then on the report you can make a formula field like (AvActual - AvAgreed) and sort on this formula.

2) Calculate AvActual and AvAgreed values on the main report and pass these values in a sureport. The sub report then can be sorted on (AvActual - AvAgreed)

-PKG *************************
Pradeep Kumar Gupta
Data Warehouse Consultant.
pradeep.gupta@wipro.com
 
David,

I will take a wild guess that you are trying to rank groups (not details) based on the difference between two subtotals. If so, the trick is to write a formula that takes the difference between the actual detail fields (not the subtotals) and then subtotal this formula. You can then rank the groups using the TopN feature.

If this is way off, then tell us the formula used for these two fields. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
Ken,

Guessed right!!

Thanks very much to you and all the others who tried to decipher my explanation of the problem.

Best Regards,

David Grimwood

Melbourne, Australia
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top