Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Order on Calc Field

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Order on Calc Field

    I have a database of customers and one of invoicing.

    How do I print a report that orders the customers by the most invoicing amount to the least.

    There seems to be no way to do this in the report ordering. I can not order on a calculated or summary field.

    It seems so simple.

    #2
    RE: Order on Calc Field

    Bruce

    You should add a field to the table and call it report_total. Have a procedure that zeros out the field, puts the total value in the field, and then the value can be used in the filter.

    It's easier to do than to explain.
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.
    "Make it as simple as possible, but not simpler."
    Albert Einstein

    http://www.iadn.com/images/media/iadn_member.png

    Comment


      #3
      RE: Order on Calc Field

      I would agree it is easier to do.

      You lost me.

      Could you attach an example?

      Comment


        #4
        RE: Order on Calc Field

        Bruce:

        I do this with a field-rule add post. The customer record has a field [n] 'purch'. Each invoice's total is posted to that field accumulative [add]. When report time comes it is quite easy to order on that field ascending or decending.

        Reconfigure and insert this field in the customer db then you can globally update the field as calculated wih value with DBSUM() from you invoice records. After the update, create the field rule to post the totals from now on.

        I'll make you a model and attach it when I get the time, if you don't understand.

        Ken

        Comment


          #5
          RE: Order on Calc Field

          I completely understand.

          I have always ben leary of the post command.

          It takes a great deal of planning to make sure things aren't posted twice or what about alterations, deletions, .....

          Would it really be that tough to include as part of Alpha? I was shocked to find that there are few threads on this topic. It seems like a fundamental part of database reporting.

          Comment


            #6
            RE: Order on Calc Field

            Bruce,

            Here is an example of the kind of thing I think Al was referencing.

            Unzip the attachment to an empty folder.

            Enter new child table records, or edit existing records.

            Then run the only update operation you'll find.

            The update opn will calculate new values for the Customers->ReportTotal field. This field can be used to set the report sequence in ascending or descending order.

            The scenario would be like this:

            1) Data entry session ends
            2) Update opn run
            3) Report run

            Simple.

            -- tom

            Comment


              #7
              RE: Order on Calc Field

              oops.

              Here's the example.

              Comment


                #8
                RE: Order on Calc Field

                Bruce/Tom

                This is a sample database that Bruce sent me with the code that I'm suggesting.

                There are two approaches that I've shown.

                1. The first is to total all the sales for a customer. I added a field to Bruce's table called:
                Customer->Posted_Total_Sales.

                This field is kept up to date with a posting rule for sales->sales_amount for new and changed records. Since Bruce sent me data in the table, so I wrote a posting operation (Post sales 2 cust post) to fill the field for existing records.

                I changed his report to use the new field to sort on.

                This is very similar to what you did, it just uses posting instead of the update and dbsum approach.

                This should give the results needed if total sales is calculated based on all the sales for a particular customer. Since most of the time what is really needed is just a selected group of sales records, I created approach two.

                2. The second approach uses a query to find a subset of sales records and then figures out the total sales by customer for only those sales records.

                In this case I created another new field:
                customer->Report_Total_Sales

                The sequence is a little more involved but is:
                a. Query by form to get the records desired
                b. Zero out the field customer->Report_Total_Sales
                c. summarize the queried records to get the total by customer
                d. post the summary table to the customer table
                e. report on the queried records and use the Report_Total_Sales field

                These 2 routines are in the buttons on the MenuMenu form and can be followed from there. The second approach requires knowledge of query by form.

                I also have this in version 5 code since it didn't see that this was in version 4 forumn until I was ready to post it. The only difference is that the query by form genie is more user friendly.

                The caveat that I see in the second approach is that is not multi user friendly. Two users doing the same sequence at the same time could overwrite each other in the total field. It may be necessary to use a control table/field to allow only one person at a time to do this.

                Hope this helps.
                Al Buchholz
                Bookwood Systems, LTD
                Weekly QReportBuilder Webinars Thursday 1 pm CST

                Occam's Razor - KISS
                Normalize till it hurts - De-normalize till it works.
                Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
                When we triage a problem it is much easier to read sample systems than to read a mind.
                "Make it as simple as possible, but not simpler."
                Albert Einstein

                http://www.iadn.com/images/media/iadn_member.png

                Comment

                Working...
                X