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 Westi 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 by calculated formula?

Status
Not open for further replies.

kunzi

Technical User
Nov 24, 2009
5
US
Hi all,

I'm using Crystal 2008 to create a report. The reports has one-level grouping by user name. Each user may have multiple tasks and each task has a duration in hours if it is complete. The details about those tasks and durations will be shown in drill-down. In the Preview tab, for each row I need to display: user name and average duration of tasks that have been done by the user. Note that the average duration only counts for tasks that have been done.

So my questions is: is there a way to group by users and sort by average task duration? I guess Group Sort Expert might be helpful but cannot find the formula for Average Task Duration there. I think it may because I'm using both Sum and Count in the formula for average duration. The formula is like this:

if Sum ({@TaskDone}, {%User})>0 then Sum({@Duration},{%User})/Sum ({@TaskDone}, {%User})
else -1

Any suggestions? Thanks a lot in advance!
 
Take a look at the SQL expression method in thread767-1489425: Group Sort on calculated percentage. I'm not familiar with CR2008, but in previous versions, the only way to do this is by eliminating the summaries from the calculation by replacing them with SQL expressions which are summaries that behave like fields, i.e., summaries can in turn be inserted on them which is a prerequisite to activating the group sort feature.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top