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

Building a Report - Set needed?

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

    Building a Report - Set needed?

    Hi All,

    I'm working on a report to show the number of early failures based on the total number of product repaired grouped by technician for the prior month.
    The report is based on a table that stores all the repair work orders.
    I'm 90% there with the report, all the numbers are correct with the exception the total repairs... the problem arises because the report detail is filtered on DOA="Y". This gives me the correct detail records but allow me to help to calculate the total repairs.
    The goal is to see the ratio of quantity doa="y" / total repairs.

    For Example, the attachment shows the month of September and Technician DL. Looking at Part Number 2320993-R, the total quantity should by 89 (based on total repairs for September). The total DOA is 2 which is correct. We can see the 2 work orders matching that criteria as well.


    The red circled areas on the report should show the total of repairs for the month.
    report.JPG
    report_designer.JPG

    Here is the filter:
    year(date_in)=year(date()).AND.month(date_in)=month(date())-1.AND.doa="Y"

    So my thoughts are:
    1)ideally come up with some calculation that does not require an index addition (this table already have too many indexes)
    2)create a filtered index, sorted by product so I can place a calculated field on the report and use db_count() to count those records
    2)create a set... would probably need a Summarize operation but not sure how to structure it all

    #2
    Re: Building a Report - Set needed?

    If you are wanting the total of repairs for the previous month for all technicians try this for the calculated field:

    tot_repairs = tablecount("yourtablename","(year(date_in)=year(date())).AND.(month(date_in)=month(date())-1).AND.(doa='Y')")

    You should be able to test it as a variable in the IW before adding it to the report as a calc.
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

    Comment


      #3
      Re: Building a Report - Set needed?

      Hi Robin, thanks for the reply.
      Your calculation looks good, I used without the .AND.(doa='Y') since my report is already filtered on (doa='Y').

      So this calc gives me the total for the month, but how can we apply it to the grouping as well (per tech, per product)?
      Also, it does take 5-10 seconds to run the calculation, is there a more efficient method?
      Capture.JPG

      Comment


        #4
        Re: Building a Report - Set needed?

        A very wise old alpha developer said to me that all reports should be based on a set even if there was only one table.
        Dave Mason
        [email protected]
        Skype is dave.mason46

        Comment


          #5
          Re: Building a Report - Set needed?

          Tablecount() is based on the table outside of any other filters in the report itself - so it works for the number circled in green using its own filter. I am not sure what you want the numbers circled in red to reflect. Is it the count of the records in the group or a percentage of the total?

          I would test the query on a browse view of the table and check the STAT button on the toolbar. With the query in place you can resort or use quick filter on whichever field you want to test. A sample table would help us help you...
          Last edited by MoGrace; 10-26-2019, 11:03 AM.
          Robin

          Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

          Comment


            #6
            Re: Building a Report - Set needed?

            Thanks for all the responses so far.
            Robin, the numbers circled in red and green are supposed to reflect the total counts of repairs.
            So the green one is working correctly, it is the calculation you suggested (although it does take a bit of time for the form to run this)
            Next, I'm looking at the red circled fields. These are counts based on the report grouping (Technician -> Product)
            In the photo, "DL" is the technician, and 3 products repaired by that technician are below him (underlined in red).
            We can we see the total # of units that technician repaired as well as the breakdown per product.

            Comment


              #7
              Re: Building a Report - Set needed?

              If you use a script to run this report you can get the tablecount() info into a global var and display that var on the form, which might be faster.

              Is there a condition where DOA would NOT equal FOA?
              Robin

              Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

              Comment


                #8
                Re: Building a Report - Set needed?

                Originally posted by DaveM View Post
                A very wise old alpha developer said to me that all reports should be based on a set even if there was only one table.
                Words to report by.
                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


                  #9
                  Re: Building a Report - Set needed?

                  Al - I know you wrote about the reasons for that in here somewhere, could you provide the link for why we ought to do that?
                  Robin

                  Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                  Comment


                    #10
                    Re: Building a Report - Set needed?

                    Originally posted by MoGrace View Post
                    Al - I know you wrote about the reasons for that in here somewhere, could you provide the link for why we ought to do that?
                    I am not aware of a single link or a series of links that would explain a relatively complex topic like that.

                    Some ideas I use to help with it are:

                    1. Most reports that are based on a normalized data structure are going to be in a set anyway.

                    2. While table relationships can be handled in multiple ways, the set linkages are usually more efficient.

                    3. A report usually needs a different set to hold different but similar relationships than a form or browse that does data entry. That said, I use a browse based on the report set to help me 'see' the data the way the report does. That really helps in multiple one to many relationships. Showing the data from key fields and linkages shows me where issues might be.

                    4. External data sources that are imported or passive linked tables can overwrite the support files for that table, but won't touch the support files for a set. Therefore a report(or other objects) stored in the table support files won't disappear when the data is refreshed and the support files overwritten with new ones.

                    5. As a carry over from older versions, transporting the support files for a set was/is a good way to move a report from development systems to production. The export/import a report(or other objects) has lessened that need.

                    6. Sets are a very powerful tool in the Alpha toolbox. Moving forward from dbf to relational databases, views are a natural progression from the set concept and should be used there also.

                    Like all tools whether software, hardware, word working, metal working, etc... all have a purpose that may or may not work in a specific circumstance.

                    We could collectively build reasons for the use of an Alpha tool. Please feel free to add to this list or present caveats.
                    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


                      #11
                      Re: Building a Report - Set needed?

                      Thanks, I think it was #4 I was thinking of.
                      Robin

                      Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                      Comment

                      Working...
                      X