Sorting by Sum in a report

Clarencephil

New member
Local time
Today, 14:52
Joined
Apr 27, 2006
Messages
8
This may be a simple question but I'm baffled.

I have a report which groups sales by individual salesman and gives a sales total or aggregate ( Sum() ) for each individual, whether there is 1 or 5 sales.
So far so good.
Burt how do I then sort the total sales from highest to lowest in my report ?
 
you can try sorting and grouping. Right click on any of he headers or detail or whatever and choose sorting and grouping. Create a new sort and choose the field you want to sort by and whether it is ascending or descending. You can give it it's own header and footer but I don't think you'll need that. Give it a try.
 
I'm already sorting and grouping by salesman. That's how I get their individual sales total or aggregate.
But since I'm sorting by salesman, I'm getting:

Salesman.........Aggregate sales
Salesman A .. ....$ 5000
Salesman B . ..... $ 8000
salesman C ........$ 4000
Salesman D.........$ 9000

Whereas I want to get:

Salesman.........Aggregate sales
Salesman D ...... $ 9000
Salesman B........$ 8000
Salesman A........$5000
Salesman C........$4000
 
I think if you sort by Total Sales first and then Salesman second it should sort by sales first and then salesman alphabetically second. Just add Total sales to the sorting and grouping properties before salesman. I am pretty sure this works. Let me know if it doesn't so I can find something that does.
 
If you apply a descending sort order to your aggregate sales field that should work.
 
neileg said:
If you apply a descending sort order to your aggregate sales field that should work.

Maybe I was not clear !
I do not have an aggregate sales field. Just individual sales for each salesman
What I did in myreport was sorting and grouping by salesman and I have a Sum(Sales) in the group footer, which gives aggregate sales by salesman.
I would like however to be able to print a report which sorts salesmen by their respective aggregate sales rather than alphabetically.
Thanks
 
Until the report runs, you don't have a total sales value for the report to sort on, so you can't do it in the report.

However, if you do a totals query, this will calculate your sales by salesman. Join this to your original query so that each record in the query has the relevant salesman total against it and sort on that in your report.
 
neileg said:
Until the report runs, you don't have a total sales value for the report to sort on, so you can't do it in the report.

However, if you do a totals query, this will calculate your sales by salesman. Join this to your original query so that each record in the query has the relevant salesman total against it and sort on that in your report.

I should have thought about that !
I did it according to your suggestion (Joining totals query to original query and ordering by sales total ) and it worked perfect. Thanks for taking the time.
 

Users who are viewing this thread

Back
Top Bottom