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

How to Sort with a Seemingly Unsortable Field??

Status
Not open for further replies.

crystalhelp1

Technical User
Aug 21, 2010
19
US
I have a formula field in my main report that includes a sql statement, summary and 2 number fields (%sql + {sum of dpqty} - (OHQTY + ODQTY)).

This field is in my header. I would like to sort on this field, but it does not give me this option...even when trying to perform a group sort.

Any thoughts on how to sort by this field?

Thanks,
KK
 
Please show the actual formula and the content of any nested formulas.

-LB
 
Hi,
In addition, it would seem that sorting on a summary would need to be done after the summary is computed, so the location and details of the summations are important.

[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Here's the formula:

if {@Open SO Qty Minus Null Values} > {FKITMSTR.IMQTOH} then
-1000000
else if {@Open SO Qty Minus Null Values} > {@Fcst + Dep} then
({FKITMSTR.IMQTOD} + {FKITMSTR.IMQTOH}) - {@Open SO Qty Minus Null Values}
else
({FKITMSTR.IMQTOD} + {FKITMSTR.IMQTOH}) - {@Fcst + Dep}

The formula above is located in the the header GH2 under the GH1 header that comprises a whileprintingrecords;
shared numbervar x := {@Fcst Qty Minus Null Values}; formula used as part of the "{@Fcst + Dep}" formula above.

I hope this helps?
 
You will not be able to sort on any formula that contains a shared variable or a summary. You did not show the content of the nested formulas, but already it is apparent that this is not sortable. You would have to eliminate the shared variable and also convert any summaries to SQL expressions so that you would end up with a formula that you could INSERT a summary on--this is necessary to activate the group sort.

-LB
 
I prefer sql statements. My issue with sql statements is upon creating them they run, but often times take too long or end up crashing Crystal. Any advice for fine-tuning my sql statements (e.g. Crystal sql for dummies)?

Thanks,
KK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top