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

How can I tally or count data

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

    How can I tally or count data

    Hey Guru's,

    I am having *another* problem...my guess is that it is a simple fix.

    I am trying to perform a count of the number of times varies items appear in one of my tables.

    I have a table that contains a list of the number of times a safety issue is reported. I want to perform to count the number of times each issue is observed and be able to sort by the highest (greatest number of observations) to the lowest (fewest observations)

    Obsr_ID Obsr_Type
    0001 Electrical
    0002 Fire
    0003 Fire
    0004 Waste
    0005 Fire
    0006 Electrical
    0007 Waste
    0008 Safety
    0009 Fire
    0010 Electrical


    The end result should be something like this:

    Fire 4
    Electrical 3
    Waste 2
    Safety 1

    Or perhaps expressed in a percent:

    Fire 40%
    Electrical 30%
    Waste 20%
    Safety 10%

    Anyone willing to point me in the right direction?

    Thanks.

    #2
    Re: How can I tally or count data

    Still trying to figure this one out. Any ideas?

    Comment


      #3
      Re: How can I tally or count data

      Hi Robert,

      Run a summarize operation first, build your component on the result table.

      Just a suggestion.
      Regards
      Keith Hubert
      Alpha Guild Member
      London.
      KHDB Management Systems
      Skype = keith.hubert


      For your day-to-day Needs, you Need an Alpha Database!

      Comment


        #4
        Re: How can I tally or count data

        Thanks Keith,

        I did think of that but I need this data to be dynamic. It is my understnding that I would have to fire the operation each time I want the table updated. Is that correct? I am surprised this is so difficult, MS Access had a count of option built in. I am assuming I will ultimately need to use a count() expression. I can't get it to work however.

        Comment


          #5
          Re: How can I tally or count data

          Hi Robert,

          I would have to fire the operation each time I want the table updated. Is that correct?
          Yes, but you can make the update dynamic too.

          You mentioned using count() but cant get it to work, maybe you could try TABLECOUNT() instead.
          Regards
          Keith Hubert
          Alpha Guild Member
          London.
          KHDB Management Systems
          Skype = keith.hubert


          For your day-to-day Needs, you Need an Alpha Database!

          Comment


            #6
            Re: How can I tally or count data

            Another option might be to add a count field next to each possibility. i.e. ctelectrical, ctfire, etc.

            Then in the a5w page containing the component where you add the situation have something like this:

            If Obsr_Type = "Fire"

            dim tbl as P
            dim qry as P
            tbl = table.open("[pathalias.adb_path]\your table")
            query.filter = "Postnum="+quote(session.Postnum) OR query.filter = "Recnum= 1"
            qry = tbl.query_create()
            tbl.change_begin()
            tbl.ctfire = tbl.ctfire +1
            tbl.change_end(.T.)
            tbl.close()
            end if

            Have the tb.change for each entry type. This would keep a permanent tally. If the situation is resolved, you can then have something similar in your "problem fixed" page containing tbl.ctfire = tbl.ctfire - 1.

            Or, as Keith suggests, place something like this in your a5w page:
            tablecount("[pathalias.adb_path]\your.dbf", Obsr_Type = "Fire")
            tablecount("[pathalias.adb_path]\your.dbf", Obsr_Type = "waste")
            Last edited by EricN; 12-07-2008, 01:50 PM.
            Eric

            Alpha Five Websites
            longlivepuppies.com
            socialservicenetwork.com
            -------------------------------------------------
            socialservicenetwork.org

            Comment


              #7
              Re: How can I tally or count data

              Thanks for the suggestions guys.

              Not sure how I am going to proceed.

              All I really want to do is be able to have a graphical representation of the percent of each type of finding in my table.

              Out of the 1000 findings in the table, 42% (or 420) are electrical, 31% (or 310) are fire, etc. The chart would update every time new findings are added. The chart would be placed on a dashboard.a5w.

              Comment


                #8
                Re: How can I tally or count data

                Okay...I have created a summary operation which works well.

                How can I make this dynamic? I would like the summary operation to fire and rebuild the results table every time a new item is added to my main table.

                Thanks Keith.

                Comment


                  #9
                  Re: How can I tally or count data

                  Hi Robert,

                  Where is the data being entered? Online or desktop?

                  If it is online then it could be an AfterValidate event, or desktop part of the save record routine.
                  Regards
                  Keith Hubert
                  Alpha Guild Member
                  London.
                  KHDB Management Systems
                  Skype = keith.hubert


                  For your day-to-day Needs, you Need an Alpha Database!

                  Comment


                    #10
                    Re: How can I tally or count data

                    Thanks Keith.

                    All data is entered online. I will use the aftervalidate event. Really appreciate the help.

                    Comment


                      #11
                      Re: How can I tally or count data

                      Hi Keith,

                      Can you lend me a bit more help? I am trying to fire my operation in an aftervalidate event. Here is what I have so for. It gives me a Result stack underfloe error.

                      t = table.open("[pathalias.abd_path]\safety_tour_d")
                      t.enter_begin()
                      t.St_id=alltrim(CurrentForm.Controls.vSt_id.value)
                      t.Std_hazcatdid=(CurrentForm.Controls.vStd_id.value)
                      t.Std_loc=alltrim(CurrentForm.Controls.Vstd_loc.value)
                      t.Std_recm=alltrim(CurrentForm.Controls.vStd_recm.value)
                      t.Std_surveyor=alltrim(CurrentForm.Controls.vStd_surveyor.value)

                      t.enter_end()
                      t.close()

                      If CurrentForm.Controls.Last_Record = "No" then

                      CurrentForm.RedirectTarget="newsafetyrounddetails.a5w?vSt_id="+CurrentForm.Controls.vSt_id.value
                      Else
                      Object_operation("summarize","result1")
                      CurrentForm.RedirectTarget="rounddashboard.a5w"
                      End if

                      Thanks

                      Comment

                      Working...
                      X