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 gkittelson 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 a Group in Formula 2

Status
Not open for further replies.

ewox420

Technical User
Jul 7, 2010
6
US
Hi there, I'm using crystal report XI. I'm having problem to sort a group which is base on a formula.

I want to sort it by @Formula2:
{@Formula1 / {Sheet1_.Monthly Target}) * 100

while having this formula @Formula1

{Sheet1_.MTD PROMISED AMOUNT (YESTERDAY)} + Sum ({Promises_.Amount}, {Sheet1_.Operator})


In what way can i sort this thing? Any ideas...pls help...tnx!
 
If you create a formula field for '@Formula2', then Reports > Record Sort Expert should let you sort within the group. Is that what you were after?

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
You'll need to use the Group Sort Expert fro thsi not the Record Sort Expert.

Gary Parker
MIS Data Analyst
Manchester, England
 
You would have to return: Sum ({Promises_.Amount}, {Sheet1_.Operator}) as a SQL expression {%sumamt}, as in:

(
select sum(`Amount`)
from Promises_ A, Sheet1_ B
where A.`keyfield` = B.`keyfield` and
B.`Operator` = Sheet1_.`Operator`
)

Then you could create a formula like this:

({Sheet1_.MTD PROMISED AMOUNT (YESTERDAY)} + {%sumamt})%{Sheet1_.Monthly Target}

Place this in the detail section and insert a maximum on it at the operator group level. Then go to report->group sort->and select the maximum of this formula to do the group sort.

-LB
 
Hi! sorry for the late reply! i'm done with my report and it is already running.... THANK YOU very much with the help!

LB you rock! ty


ewox420
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top