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

sorting on calculated group value 1

Status
Not open for further replies.

meryls

Technical User
Nov 20, 2003
62
US
Hi!
I have a Crystal 9 report that extracts customer notes and calculates the number of days passed since the last note. I am grouping by customer.

Each record is an individual customer note, with a date for the note.

I use a running total which keeps track of the most recent note date for each customer and I print the days since that date in the group footer for each customer, along with other information I derive.

I want to be able to sort these customers by this calculated days passed, so I can print out a report that shows the customer's who haven't been contacted for the longest times first. When I try to change the group sort, this formula is not available, and if I try to insert an new group, based on this formula, it also doesn't show up. I think that's because it is not calculated on the detail record level.

Is there any way to do what I want?

Thanks so much!
Meryl
 
If you are subtracting the most recent date from the currentdate, then instead of using the calculation, you could insert a maximum on {table.date} and then go to report->topN/group sort, and choose "Maximum of {table.date}", ascending order. This will automatically result in the differences being displayed in descending order.

-LB
 
LB -
Thanks! That worked like a charm. I see that using the group summary gave me access where the running total did not. An interesting difference. Is there some rule of thumb on when to use each one? Thanks so much for your help!!!
Meryl
 
As far as I know, you can only use TopN with group summaries of database fields or of formulas that don't contain summaries, running totals, or the next() or previous() functions. You can also use the function to order groups in crosstabs.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top