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

Sorting issue 1

Status
Not open for further replies.

ind123p

Programmer
Sep 28, 2005
62
I am using CR XI.

I have two groups

GH1 is Client
GH2 is Staff
GF1 is Total
Details section is suppressed.

Current Period Previous Period Increase/Decrease
Hours Hours Hours
Client1 StaffA 10 150 -140
StaffB 5 50 -45
Total 15 200 -185


This is what i wish to accomplish. I want to be able to sort ascending or descending on Increase/Decrease
For example, sort (descending) should be as shown below:

Current Period Previous Period Increase/Decrease
Hours Hours Hours
Client1 StaffB 5 50 -45
StaffA 10 150 -140
Total 15 200 -185




Increase/ Decrease is a calculated field.

Can somebody give me a direction in accomplishing the above ?
 
Use the TopN/Sort Expert to sort by the difference for each group.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
To create the increase/decrease field, use a formula at the detail level:

{@currenthrs} - {@previoushrs}

...and then insert a summary on this, so that topN is available. If you only use the group summaries in a subtotal formula, the topN/group sort won't be available.

-LB

 
Thanks dgillz, Lb for responding..

LB,

Currently I have a formula calculating the difference of hours.

@hourdiff
Sum({@CurrentHrs},{@Staff}) -Sum({@PreviousHrs},{@Staff})

As per your suggestion. I moved this formula from GH2 to detail section (suppressed). When I click on the Insert , it does not let me insert summary. It just says Insert--> field heading.

Am I doing something wrong ?

 
That was not what I was suggesting. I was suggesting that you create a separate formula for the detail section:

{@CurrentHrs} - {@PreviousHrs}

Then insert a summary on this at the {@Staff} group level.

-LB
 
Thanks LB..Your solution worked..Star for you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top