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

calculated fields problem

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

    calculated fields problem

    I'm using A4V4 DOS. For many years. Just had occasion for the first
    time to use calculated fields. The results, to put it charitably,
    are not reassuring. The calculation in this instance is extremely
    simple - just dividing one numerical field's value by another
    numerical field's value - with the foreknowledge BTW that all
    results are guaranteed to be positive numbers only, formatted
    to one decimal place.

    So - I get *three* different answers in three different places,
    none of which are accurate. F7 (test while creating the expression)
    gives one (wrong) result, the screen gives nothing but a row
    of questionmarks, and the report print gives garbage which is
    mathematically incorrect.

    So what is the arcane secret for successful calculated fields
    that I have apparently overlooked? I've RTFM not once or twice
    but several times - I've verified what operator symbol is used
    in an expression when dividing - I've looked for "format"
    whizzies which I may be omitting - and nothing.

    Anyone have any ideas?

    Alpha is apparently in the process of relocating, and their
    support staff are completely unavailable. None of the numbers
    you can call, including their main line, do anything but
    eventually dump your call back into the ether.

    I love the software, but am becoming somewhat unimpressed
    with their support committment.


    Brewster Gillett
    [email protected]

    #2
    RE: calculated fields problem

    Hi Brewster,

    If the fields are numeric, it should be a simple field3=field1/field2.

    Are you sure all the fields are numeric?

    Keith (Cornwall UK)

    Comment


      #3
      RE: calculated fields problem

      Yes, they're all numeric.

      I get the impression from your message that the expression needs
      to lead with the target fieldname - the manual examples do not
      seem to indicate such, so I did not craft the expression that way.
      Since when you are creating the calc field you are doing it *from*
      that field, it would seem unnecessary to invoke the field name as the
      lead expression element, but I'll try it that way.

      Thanks for your response.

      Brewster

      Comment


        #4
        RE: calculated fields problem

        Brewster;
        The reasons for your "incorrect" answers could be several. If you could provide a little more information, we might be able to narrow down the problem. For example, what section of the report is your calculated field found in i.e. detail, or summary, or is it in a group section? Are you trying to calculate a total, or an average or some other data type? Any further detail you could provide would be helpful to address your question.

        Duncan Greenshields

        Comment


          #5
          RE: calculated fields problem

          Brewster:
          Sometimes when I do calc fields, I find it easier to just add the fields to the database.
          In your case add them as numeric 10,2
          make them a calculated field in the field rules and add the formula.( field1/field2)
          choose and open the database and browse the records.
          scroll over to the new fields so you can see them.
          press the "C" to change, arrow down to the other records and see if the field calculates correctly.
          If it does, then all you have to do is to print the field in the report.

          Sometimes this method works better than using calc fields in reports.
          you can also craete a global update to reclaculate the fields without going to the browse screen.
          Charlie Crimmel

          Comment


            #6
            RE: calculated fields problem

            My intent was to have the caculated field as part of the database,
            as a subsequent respondent has suggested. In this specific instance
            the calculated field is not intended to form a total, or be a part of
            any summary - it simply is a ratio expression based on the
            division of one of the existing fields (weight) by another (horsepower).
            Naturally I wish to be able to sort on it in an appropriate order
            just like any other field. And I figured that if it's in the database,
            then naturally it would appear in any reports I would generate.
            I am beginning to suspect that I may have been in error :-)


            Brewster

            Comment


              #7
              RE: calculated fields problem

              Adding it to the db *is* what I was attempting.

              Why 10,2?

              I'll try that "CHANGE" sequence you mention to see if that
              will produce the right figures. Using a Global Update did
              not.

              I confess to being a trifle mystified as to how a simple
              division of one numeric field by another could produce
              such wildly inaccurate results.

              Thanks for your reply.


              Brewster

              Comment


                #8
                RE: calculated fields problem

                Brewster;
                It sounds like the field length for your calculated field has not been set large enough. Try reconfiguring the data base to enlarge the field by several spaces (also remember the decimal point counts as 1 space). I suspect this will solve your issue, as a too short field length will give you **** in a browse table and ???? in the actuial data field.

                I am also wondering about the incorrect answers you get when pressing F7. By any chance were you within a "search" when using F7? The reason I ask is that even though the record you are looking at is #245 for example, I believe that when you press F7, the programme starts at record #1 and then progresses record by record. So while it would appear that F7 is giving the incorrect answer, it is really referencing a different record.

                I hope this might help.

                Duncan

                Comment


                  #9
                  RE: calculated fields problem

                  What are the names of your fields? What are they set to, including type, such as character or number, and their width and decimals, if numeric? Also, please include some sample data examples that were providing you with different results and also list the different answers that you received in different places.

                  From what you stated previously, you want to enter data in two particular fields and have the result automatically determined in a third field. If so, you'll need 3 fields. I'll assume that you have them as actual fields in your table.

                  Let's assume the name's of your fields are what you provided above...weight, horsepower, ratio.

                  For the field rules of the table you'll need to set the field "ratio" to calculated. It's expression should be simply enough "weight/horsepower".

                  You should get the correct answer. Also, on your form, check that the format of your fields match that of how your fields are formatted in the table, including matching the decimal places.

                  Mike
                  Thank you,
                  Mike Konoff

                  Comment


                    #10
                    RE: calculated fields problem

                    The best way to test calculated fields is to set up a test database
                    with only a few records. Have record 1 to calculate to the value of
                    1, record 2 to the value of 2, etc. This way you know what the
                    results should be for each record. When you press F7 to check the
                    calculations Alpha starts with the first record in the database.
                    Yes, you can use the calculated field on forms & reports. In the
                    default setting, do you have the Recalculation mode set to Automatic?
                    Edwin Spencer
                    [email protected]

                    Comment

                    Working...
                    X