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

A challenge for someone!

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

    A challenge for someone!

    Hi

    I have been utilising the top_records() facility within a report to show the top 10 entries in a list.

    However say the list is sorted by numerical values in descending order and the 9th thru 12th entries have the same value. There must be a way of (in that example) of showing the top 12?

    I guess this is similar to the Crystal Reports facility called "include ties"

    I am reliant on action scripting and I figure this will need some xbasic work?

    Does anyone have any suggestions?

    Regards

    Glen Schild
    Glen Schild



    My Blog


    #2
    RE: A challenge for someone!

    Take a look at these topics at Alpha Five Help. Navigate to Alpha Five User Guide > Records > Common Functions > Print Layout Genie and Additional Record Selection Criteria.

    Comment


      #3
      RE: A challenge for someone!

      Edward

      Thanks for the quick response but I don't think that helps (unless I am missing something obvious?) I did check the pdf manuals (as per the online help file) and the most likely options are to select the top N records BUT that does not distinguish between records if there is a tie in values as stated in my previous note)

      I cannot hard code a specific value to capture any ties as the values themselves will change.

      Regards

      Glen
      Glen Schild



      My Blog

      Comment


        #4
        RE: A challenge for someone!

        Glen,

        Have a look at the script for the Stats report in my
        Lotto app. I report the top n, ties included. :)
        code is for v4.5 but should work fine on v5 also

        http://msgboard.alphasoftware.com/alphaphorum/read.php3?sortby=lastreply&direction=desc&num=7&id=581&thread=270#MSG270

        btw, if you win, please remember me.

        Comment


          #5
          RE: A challenge for someone!

          Melvin

          Thanks for the response. I have had a look at the app, but again, unless I am missing something, the reports are only showing the top 6 numbers and is not including ties? Have reset the date and tried several times but the latest report showed 6 values, 3,3,3,2,2,2, but does not show an additional 5 numbers that have the value 2.

          Regards

          Glen
          Glen Schild



          My Blog

          Comment


            #6
            RE: A challenge for someone!

            Glen

            I would also think you would have an issue with displaying the ranking.

            Ranking Interceptions
            1 10
            2 9
            3(tie/3) 8
            8
            8
            6 5
            7 4
            8(tie/5) 3
            3
            3
            3
            3


            You may need to write your own function to determine what should be printed (a hidden flag) and how to write the rankings.
            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


              #7
              RE: A challenge for someone!

              Sorry, the previous message should display better in a txt file.
              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


                #8
                RE: A challenge for someone!

                Al

                I don't actually need to display the ranking (it would be a nicety rather than a neccesity) Just the top 10's + ties.

                As for writing my own function (did you hear the loud crash as I fell off my chair!!) :-) )

                Regards

                Glen
                Glen Schild



                My Blog

                Comment


                  #9
                  RE: A challenge for someone!

                  Glen

                  With the complexity of the reports that you have and your ability to solve the issues so far, you're a great candidate for learning to write your own functions.

                  Don't sell yourself short. You're doing somethings that some/many Alpha users wouldn't attempt.

                  And while you may not display that ranking number, that is the number that needs to be calculated and then used in the filter.
                  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


                    #10
                    RE: A challenge for someone!

                    Basic steps:
                    sort table by topn element ( eg YTD_Sales )
                    step thru 1st 10 records - doesn't matter if there are ties
                    put the value of the YTD_Sales into a global variable
                    then run the report

                    in the report selection - YTD Sales "= global variable

                    Comment


                      #11
                      RE: A challenge for someone!

                      John

                      Sounds so simple!! Know lets see if I can do this using action scripting.

                      Regards

                      Glen
                      Glen Schild



                      My Blog

                      Comment


                        #12
                        RE: A challenge for someone!

                        Actually, all you have to do is to use the script as a model.

                        The number of records reported is based on a variable.

                        Comment


                          #13
                          RE: A challenge for someone!

                          Okay

                          I have come up with a rudimentary xbasic script detailed below which does work BUT I do have some questions/concerns.

                          ----------------------
                          'Date Created: 18-Feb-2004 08:08:28 PM
                          'Last Updated: 18-Feb-2004 10:22:54 PM
                          'Created By :
                          'Updated By :
                          dim GLOBAL vleadrush as n

                          tbl = table.open("rushplayeryear.dbf")
                          tbl.index_primary_put("Leaders")
                          tbl.fetch_first()
                          tbl.fetch_next()
                          tbl.fetch_next()
                          tbl.fetch_next()
                          tbl.fetch_next()
                          tbl.fetch_next()
                          tbl.fetch_next()
                          tbl.fetch_next()
                          tbl.fetch_next()
                          tbl.fetch_next()

                          vleadrush = tbl.Total_rushyards

                          ----------------------------------------

                          The global variable vleadrush is set as a filter in the report. However there are 2 filters needed the second one being to filter out records that do not occur in the year of the report.

                          Before any reports are run a global variable is set to the required year and I have placed that variable in the filter expression for the index. I feel uncomfortable with this (and also referencing an external index from within the script)

                          This is where my xbasic scripting falls down as I cannot see how to order and filter the table from directly within the script?

                          The second issue is that, although the script works, there has to be a more elegant way to fetch through 10 records rather than hard coding fetch_next so many times. I presume a loop is needed but again this has stumped me.

                          Any help appreciated

                          Regards

                          Glen
                          Glen Schild



                          My Blog

                          Comment


                            #14
                            RE: A challenge for someone!

                            Bottom line is that what you want to do seems to demand some kind of precalc - forget about elegance - get the job done first and make it pretty later.
                            Also don't put a filter in the index for a year. Assuming that you are getting the top 10 numeric sale_amount values in a year:
                            Create an index tag in the table something like:

                            alltrim(str(year(datefield())))+ invert(str(sale_amt,13,2))

                            This could also be a query and not an index:

                            Then in your script do a
                            tb1.fetch_find("2002") rather than a tb1.fetch_first()
                            this will put the record pointer to the highest sale_amt for the year 2002

                            Then read the first 10 records - you may need to check on the possibility that there will be less than 10 records in the year 2002 - save that for later.

                            Comment


                              #15
                              RE: A challenge for someone!

                              John,
                              I think you're making this task more complex then it has to be. You also have a problem in your plan for the report -- if the tie occurs in records 5,6,and 7, then simply selecting for records in which YTD_sales"=(value in record 10) will not move down the list to get records 11 and 12.

                              The most straightforward way, I think, is to create a descending index or a query ordered on the field in question and use the "Unique" attribute. Then select the first 10 records by this Unique index for the report.

                              Comment

                              Working...
                              X