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

Top Percentage averages

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

  • Top Percentage averages

    I am trying to Retrieve the top percentage of numerical data, average it and place it in a ux dialog component field. Can anyone steer me in the right direction. I apologize if I'm not describing it correctly. (example, Retrieve the top 10 percent of sales and place the average in a text area box for display in a ux component.)

  • #2
    How many records are you planning to analyse?
    I assume you want the top 10% of a series, and the MEAN of those data? (Mode/Median?).
    See our Hybrid Option here;
    https://hybridapps.example-software.com/


    In fairness to alcohol, I have done some stupid things when I was sober too!

    Comment


    • #3
      Yes. There will eventually be several thousand. So far I've been able to pull the top 10% and average them in a data series. I can retrieve it in a variable but I don't know how to place the variable value in a dialog text box.

      This is the dataset that I created:

      SELECT

      Avg(asset.TotalAssets)
      from (select top 10 percent TotalAssets
      FROM FinancialInput
      ORDER BY TotalAssets DESC) as asset


      ‚Äč

      Comment


      • #4
        Ah! I am nor the best person to answer. Formule - yes.
        Gregg will probably chip in.
        I don't use Alpha Web. He does.
        See our Hybrid Option here;
        https://hybridapps.example-software.com/


        In fairness to alcohol, I have done some stupid things when I was sober too!

        Comment


        • #5
          Thank you Ted.

          Comment


          • #6
            Sorry about being quiet for so long.
            At the very least, I need to believe I understand the problem or the goal.
            This doesn't mean I understand it, just that I believe I do.
            John, I'm always willing to talk with someone to find a solution.
            Gregg
            https://paiza.io is a great site to test and share sql code

            Comment


            • #7
              Thank you. The end goal is to average the top 10% of a field in a sql table, and then update a different table with that figure. That table would then be used to compare all of the records in the original table to the top percentage. I already have a top percent table with the amounts manually entered, but I want to be able to update the fields after new records are added. The query that I posted retrieves the correct number when I do a preview. I just don't know how to get it into a dialog field so I can update the top percent table. I hope this makes sense.

              Comment


              • #8
                Hi John,

                Please show what you have. It's easier to provide a solution to a partial problem than it is to try to recreate the entire solution.
                Sample data and SQL table (no passwords) go a long way.
                Gregg
                https://paiza.io is a great site to test and share sql code

                Comment


                • #9
                  I too got a bit confused regarding the calculation, Gregg.
                  Having read through John's response, he has the data in a [variable] so the harder part is done.

                  So, with my limited knowledge of the web side, I suspect that inserting a [calculated field] into the UX and populating it with the variable should work.
                  calculated field=variable name

                  At least that is what I did as a test.

                  Try that John - add a calc field and use the var.
                  See our Hybrid Option here;
                  https://hybridapps.example-software.com/


                  In fairness to alcohol, I have done some stupid things when I was sober too!

                  Comment


                  • #10
                    Ted, that's where I got confused. I used a button to read the data series. The action saves the result in a variable named AverageAssets. I have a calculated field in the ux but I don't understand how to get the variable into the calculated field.

                    Comment


                    • #11
                      Without seeing the UX, I would look to set the ux control to the value of the calculated variable using e._set.<control name>.value
                      Gregg
                      https://paiza.io is a great site to test and share sql code

                      Comment


                      • #12
                        Thanks, I kind of understand. Still working on it. The variable that gets retrieved when I press the button is "AverageAssets" The control value name is AverageNumber. I created the following:
                        e._set.AverageNumber.value = variable_exists(AverageAssets as n)
                        I'm not sure where to place it to work when I run the read dataseries script.

                        Comment


                        • #13
                          You can upload the component, complete with code and sample data.
                          This gives us a chance to see what you have and what's preventing it
                          from working as desired.
                          Gregg
                          https://paiza.io is a great site to test and share sql code

                          Comment


                          • #14
                            I can't say enough how much I appreciate your help.
                            I created a test database with just the field that I working with. The UX has a chart that is only in there so I can see that it is pulling the correct information. What I am trying to accomplish is when I push the Average button, it populates the "Average Number" field with the data.
                            Attached Files

                            Comment


                            • #15
                              Hi John,

                              This is nowhere near what I expected but I think there's a chance I did what needed to be done.
                              You will probably want to save the component as something different than what you sent as I
                              did alter the javascript action.
                              Attached Files
                              Gregg
                              https://paiza.io is a great site to test and share sql code

                              Comment

                              Working...
                              X