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



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 to perform Calculations on many records

  • Filter
  • Time
  • Show
Clear All
new posts

    How to perform Calculations on many records

    in a loan and savings application, how do i compute the interest on a million records, will i use looping? how is this done in xbasic wherein
    the program will compute the interest based on individual records, e.g the interest is computed based on average daily savings,every member has different basis for computation so the program must
    compute on a per record basis, how long will alpha five compute millions of records?how is this done as a transaction, all or nothing will be computed?
    Thank you!

    Re: How to perform Calculations on many records


    Tell us the steps you'd want Alpha to do in order to compute the interest on a single account.

    It's critical to understand this before beginning a discussion of how one might tackle multiple accounts. Clear thinking is key. For example, you want to compute interest on "Records", but "Records" never ever earn interest. Records are simply rows in a table.


      Re: How to perform Calculations on many records

      Thanks for the reply Tom, here is the scenario, Interests are computed every quarter of the a current year, e.g. all beginning balances are forwarded last january 1, 2011, Mr. Smith has $10,500 beg . bal, he deposited 1,000 last January 30 - , another amount of $ 2000 last feb. 5, the formula is computed based on AVERAGE DAILY BALANCE, the first interest should be computed from January 1 to 30, another computation should be computed from january 30 to feb 5 and if there are no transactions until March 31, another interest will now then be computed from Feb 5 to march 31,Whatever is the formula of interest computation, How do we compute in xbasic for the number of days between transactions and compute the Interest, then sum up all the interest at the end of the quarter plus the total amount deposited/withdrawn. A button will be clicked any day with in a quarter and interest will be computed for inquiry purposes, and for sure At the end of the quarter for final report.So given that situation, the main problem that is bugging me is how to identify number of days between transaction and compute for the interest, after that, the program will now move to another record and the process is repeated...................for lets say a million records, how long will alpha five computes this kind of batch computation?
      Last edited by doorscomputers; 11-25-2011, 11:10 PM.


        Re: How to perform Calculations on many records

        Thanks, Roman, that begins to fill in a few more of the pieces. Are you looking for help in doing this specific calculation ? If so, you need to tell us how interest is to be computed. For example, is the interest rate fixed? How frequently does interest accrue?

        Take a look at the date / time functions in Alpha Five. If you subtract one date from another you get the number of days in between. For example:

        beg_date = {01/01/2011}
        end_date = {01/31/2011}
        ?end_date - beg_date
        = 30
        I don't know how long it would take Alpha Five to do this. Are you trying to determine whether Alpha Five is a good candidate to run this kind of calculation for a financial institution?


          Re: How to perform Calculations on many records

          Roman, if you have a copy of Excel, suggest you look at Help/Compound Interest. There are many calculations to choose from.
          Else Google for more calcs.
          Another way you might want to consider is to have the AVERAGE DAILY BALANCE really calculated daily, and the interest also calculated daily so that changes in daily rates can be accommodated. It might also mean that you don't have to calculate on the spot.
          In my experience, based on 900k big records doing a complex Join, on an Toshiba XP laptop, it took about 7 minutes, so certainly not that long.
          See our Hybrid Option here;

          We are the
          Department of Sunshine and Rainbows!

          Hope restored, faith renewed, spirits lifted!


            Re: How to perform Calculations on many records

            I think the important issue is being able to validate (read demonstrate) that your calculation is factual and based on what facts...
            Like for ex, is interest calculated on daily balance?, capitalized daily or not?, in arrears - or at one date in the month cap monthly etc
            which are all stated contractually.
            Historically computers have never been as fast as now, time was never an issue - banks run the calcs overnight


              Re: How to perform Calculations on many records

              Thank you Tom for this
              beg_date = {01/01/2011}
              end_date = {01/31/2011}
              ?end_date - beg_date
              = 30
              How do i do this in a record , interest is computed after every transaction but it is done at the end of the quarter, it doesnt matter what the formula for interest computation, to make it simple, its so easy if every client has one transaction , ill just get the number of days between two dates, what if a depositor deposits and withdrawn many times?

              Yap i'm trying to know the capability of alpha five when it comes to simple and complex calculations with millions of records.


                Re: How to perform Calculations on many records

                I have done it this way for mortgage recalculations used for judicial appeals on foreclosure to ensure that while the bank obtains maximum legal interest accrual it has not overcharged, which is fair for investment interest, but banks won't necessarily like.
                This method has proved successful in actual cases, in that any part (segment) of it can be validated using a simple calculator (and some time)
                Main Loop - for one account holder's records
                - Second loop - for each day from selected start to finish
                - - If daily cap, calculate and capitalize interest
                - - Third loop - stop at date of ANY financial transaction (a payment, interest capitalization, credit etc)
                - - - If daily cap, insert the interest and cap accrued to date this my scenario
                - - - else in yours probably,
                - - - - calculate the interest for the days as Tom suggested - fairly common,
                - - - - and capitalize or not depending on whether interest was changed

                No loopholes - to excuse the pun


                  Re: How to perform Calculations on many records

                  Something like that Ray, how is this done in Alpha Five? Thanks


                    Re: How to perform Calculations on many records

                    Emily, you may find the programming puzzles forum useful. Try your hand at solving the problems, then compare your code (script) with others that have been posted there.


                      Re: How to perform Calculations on many records

                      Quite correct as Tom says, you need to know loops and record manipulation.
                      My answer wasn't the simple one - just a response to Roman's question about Xbasic and Loops -
                      will i use looping? how is this done in xbasic
                      I'm presuming he asked 'cos he knows how.

                      You should start off doing batch record manipulation using the built in Operations of Alpha without using Xbasic code except a tiny bit for the arithmetic calculations perhaps.
                      Last edited by Ray in Capetown; 11-28-2011, 05:57 AM.


                        Re: How to perform Calculations on many records

                        How do we loop in each record for thousands of records in alpha five for computations?


                          Re: How to perform Calculations on many records


                          Have you looked at the first few puzzles? If not, why not?

                          -- tom