Alpha DevCon 2018
Results 1 to 11 of 11

Thread: Sorting on Totals in Report

  1. #1
    Member
    Real Name
    Tom Mills
    Join Date
    Nov 2000
    Posts
    497

    Default Sorting on Totals in Report

    Sample database attached. I can total up the sales by Company, but I'd like to Sort the report by those totals. (So that the company with highest sales is first, etc.)

    How can I do this?

  2. #2
    "Certified" Alphaholic
    Real Name
    Jeff Kletrovets
    Join Date
    Oct 2005
    Location
    Columbus, OH
    Posts
    1,130

    Default Re: Sorting on Totals in Report

    Tom

    See attached.

    Regards,

    Jeff

  3. #3
    Member
    Real Name
    Tom Mills
    Join Date
    Nov 2000
    Posts
    497

    Default Re: Sorting on Totals in Report

    Jeff won't that just sort on the Sales Amount and not the Total of the Sales?

  4. #4
    "Certified" Alphaholic
    Real Name
    Jeff Kletrovets
    Join Date
    Oct 2005
    Location
    Columbus, OH
    Posts
    1,130

    Default Re: Sorting on Totals in Report

    Oops, I slightly misread your post.

    What I mentioned won't get you want you want.

    I need to go play with your example.

    Sorry for the confusion....

    Jeff

  5. #5
    "Certified" Alphaholic
    Real Name
    Jeff Kletrovets
    Join Date
    Oct 2005
    Location
    Columbus, OH
    Posts
    1,130

    Default Re: Sorting on Totals in Report

    Tom

    I am now at a loss. I thought I could just go into Group Properties and set the order to the calculated field but I get an error when I try to save it. See attached.

    Maybe one of the more experienced folks around here can help out.

    Regards,

    Jeff

  6. #6
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,005

    Default Re: Sorting on Totals in Report

    If you make the calculated field a table field, probably with a dbsum() epression, and force the field to be recalculated before the report is printed then you should be able to sort on it.

    What you are asking Alpha to do currently is to

    look at all the records in the table and decide which ones are to be included
    look at all the records to be included and compute a total sales by company
    next order the records by that total and by company
    then start processing the records into groups and imaging the report


    What Alpha does

    look at all the records in the table and decide which ones are to be included
    group those records by company
    start with the first company
    compute any summary calculations - for that group
    record by record compute any calculated fields
    image the report

  7. #7
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,190

    Default Re: Sorting on Totals in Report

    Done.

  8. #8
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,299

    Default Re: Sorting on Totals in Report

    G, thanks for that. I haven't used an expression to set the group ordering before. Using dbSum() to define the order of the groups was very clever. -- tom

  9. #9
    "Certified" Alphaholic G Gabriel's Avatar
    Real Name
    G. Gabriel
    Join Date
    Oct 2004
    Posts
    7,190

    Default Re: Sorting on Totals in Report

    "Everyone is a genius at least once a year. The real geniuses simply have their bright ideas closer together." Georg Christoph Lichtenberg

    This is my one day of being genius, from now on, you should expect a lot of stupidity!

  10. #10
    "Certified" Alphaholic
    Real Name
    Jeff Kletrovets
    Join Date
    Oct 2005
    Location
    Columbus, OH
    Posts
    1,130

    Default Re: Sorting on Totals in Report

    G.

    I'll second what Tom said. NICE!

    Jeff

  11. #11
    "Certified" Alphaholic Rich Hartnett's Avatar
    Real Name
    Richard Hartnett
    Join Date
    Nov 2002
    Location
    Bowie, MD
    Posts
    1,447

    Default Re: Sorting on Totals in Report

    I know this is an old thread, but I am currently trying to sort a parent-child report in a "column total" order, and even after using Gabriel's expression within my group break, it's still not working.

    I'm trying to sort the report by the "FIRE" field in a descending order. The first picture shows how the report is ordered normally, which is by Member Name & ID Number. (The member's names have been blocked out.)

    The second picture shows how it displays when I use the following expression:

    dbsum("apparatus","Sum",Systemid,"Apparatus->Fire_Cnt")

    (Apparatus is the table name, SystemID is the Member's ID Number in the parent table, and Apparatus->Fire_Cnt is a field in the Apparatus table that counts "1" for each incident.)

    The goal here is to display the firefighters with the highest number of FIRE runs starting at top, and working down to 0, but I can never seem to make that happen.

    What am I doing wrong??
    Attached Images Attached Images
    Sergeant Richard Hartnett
    Hyattsville City Police Department
    Maryland

Similar Threads

  1. Report Totals
    By Thomas Holt in forum Alpha Five Version 4
    Replies: 6
    Last Post: 06-18-2004, 03:42 AM
  2. Report-getting totals
    By Robert Widgren in forum Alpha Five Version 5
    Replies: 1
    Last Post: 11-05-2003, 04:08 PM
  3. Sorting Report On Group Totals
    By Chuck Kirkpatrick in forum Alpha Five Version 5
    Replies: 2
    Last Post: 03-07-2003, 06:19 AM
  4. Report Totals
    By David Day in forum Alpha Five Version 4
    Replies: 3
    Last Post: 06-21-2001, 07:11 PM
  5. Report sub-totals
    By Tony Watts in forum Alpha Five Version 4
    Replies: 4
    Last Post: 04-12-2001, 07:13 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •