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 question

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

    calculated fields question

    I had a calculated expression that seemed to resolve properly when I edited the field rules in the table. The expression was
    if(fieldy=0,field1+field2+field3),0).
    The result in the expression builder was showing a numeric value Type N.
    But when I went to layout I only see 0.00 in the field.

    I then dropped a calculated field with the same formula as above onto a form layout and it shows up with the correct results. (Is this a virtual field or are results stored in table?)

    I guess I need to understand the difference between field rules calculated expression and the drag-and drop approach. I was approaching it from another database world where my calculated expressions were always built into the original field definitions. So, I am a bit unclear as to the approach I need to take.

    #2
    probably need to recalculate the field

    Hi Ken,

    From the help files:

    When Calculated Fields are Calculated
    Merely adding a field to a table and giving it a field rule calculation expression does not fill the field with values. A field rule does not calculate until one of three events occurs.
    • A record is added to the table
    • One of the fields in the calculation is changed or edited in a record
    • Run the Re-Evaluate rules function.
    To re-evaluate field rules for a table:
    1. Select the table in the Table/Sets tab of the Control Panel.
    2. Select Table > Utilities > Recalculate Calc Fields (Field Rules).
    Note: When running an operation that updates records in a table, Alpha Five updates only the calculated fields directly affected by changing table field values. Alpha Five does not update calculated fields that depend on the contents of other calculated fields. Adding the following piece of code in your operation will solve the problem.
    dim tbl as P

    tbl = table.open(tablename)
    tbl.Recalc_CalcFields()
    tbl.close()

    Good luck
    Cheryl
    Cheryl
    #1 Designs By Pagecrazy
    http://pagecrazy.com/

    Comment


      #3
      table recalc still has zeroes

      Cherly,

      I did the table recalc and zeroes still show up. Yet the calculated field that is dropped on the form layout correctly displays and dynamically changes as one of component fields is changed.

      I guess I am unclear as to why this is occurring.

      Comment


        #4
        zip table

        Hi Ken,

        Can you zip the table and attach it here for us to look at? I am assuming your report is based on the table. Let us know which field in the table and which object on the report to compare. With that we can better find a resolution for you.

        Thanks
        Cheryl

        Also, not sure if this was a typo or not, but your field expression is: if(fieldy=0,field1+field2+field3),0). Shouldn't this be: if(fieldy=0,(field1+field2+field3),0).
        Cheryl
        #1 Designs By Pagecrazy
        http://pagecrazy.com/

        Comment


          #5
          Originally posted by ken doucet
          Cherly,

          I did the table recalc and zeroes still show up. Yet the calculated field that is dropped on the form layout correctly displays and dynamically changes as one of component fields is changed.

          I guess I am unclear as to why this is occurring.
          Time to attach a sample and let us take a look.
          There can be only one.

          Comment


            #6
            zip attached

            This is the dbf file I am working on. It has one record in it.

            How do I attach the layout view?

            Comment


              #7
              zip the set the report is based on

              If you zip the set that the report is based on, it will include the layout.
              Cheryl
              #1 Designs By Pagecrazy
              http://pagecrazy.com/

              Comment


                #8
                what field am I looking for

                I can't seem to find any fields in your attached table that has a calculated expression in it :(

                You need to provide us with the table that has the expression in it which is returning the incorrect value .... and tell us which field and where we can see the incorrect value being returned.
                Cheryl
                #1 Designs By Pagecrazy
                http://pagecrazy.com/

                Comment


                  #9
                  My source is only a table - I have not established a set

                  Originally posted by Cheryl Lemire
                  I can't seem to find any fields in your attached table that has a calculated expression in it :(

                  You need to provide us with the table that has the expression in it which is returning the incorrect value .... and tell us which field and where we can see the incorrect value being returned.
                  Please bear with me and I will get what you need out. Since My TABLES/SET tab only contains the source table (for which I have also created a form layout) I am not sure what files to forward you or what I need to do next.

                  The field with the calculated expression is called SUNLIFE.
                  Thanks

                  Comment


                    #10
                    Hi Ken,

                    I found the sunlife field but it is not set as a caculated field so I do not know what expression should be there, ie which fields are supposed to be calculated.

                    Can you rezip your table to include the field rules that you have setup in it?

                    If it is easier and not a problem, would be best if you just zip the entire db, that way we know we will get everything we need.

                    Thanks
                    Cheryl
                    Cheryl
                    #1 Designs By Pagecrazy
                    http://pagecrazy.com/

                    Comment


                      #11
                      Originally posted by Cheryl Lemire
                      Hi Ken,

                      I found the sunlife field but it is not set as a caculated field so I do not know what expression should be there, ie which fields are supposed to be calculated.

                      Can you rezip your table to include the field rules that you have setup in it?

                      If it is easier and not a problem, would be best if you just zip the entire db, that way we know we will get everything we need.

                      Thanks
                      Cheryl
                      I have been adding tables to the AlphaSports directory and some of these tables have client Social Security Numbers so would prefer to give you a subset. What file names do you require that would provide the layout I set up for this hlthmstr.dbf file since this would probably be more meaningful to you.
                      Maybe a backup (no data) is an option? If so, I need to check documentation on doing this.

                      Comment


                        #12
                        In addition to the .dbf, include the .ddd, .ddm, and .ddx files for the table that you already zipped and sent. Those files should provide me with the field rules and report layout.
                        Cheryl
                        #1 Designs By Pagecrazy
                        http://pagecrazy.com/

                        Comment


                          #13
                          revised zip

                          Originally posted by Cheryl Lemire
                          In addition to the .dbf, include the .ddd, .ddm, and .ddx files for the table that you already zipped and sent. Those files should provide me with the field rules and report layout.
                          Here they are :)

                          Comment


                            #14
                            Sorry Ken, but that did not work either. I don't have a problem with you removing the records from the table ... but unless I can see your actual field rules as they are setup, I am stuck with being able to help you.

                            The report layout still was not included. Are you 100% sure that the report layout is based on the hlthmstr table?

                            I do not know why I am not getting your field rules or report layout. Can you take screen shots of the calculated field rule and the report layout and attach those? I am grabbing at straws now :)
                            Cheryl
                            #1 Designs By Pagecrazy
                            http://pagecrazy.com/

                            Comment


                              #15
                              here are screen shots

                              Originally posted by Cheryl Lemire
                              Sorry Ken, but that did not work either. I don't have a problem with you removing the records from the table ... but unless I can see your actual field rules as they are setup, I am stuck with being able to help you.

                              The report layout still was not included. Are you 100% sure that the report layout is based on the hlthmstr table?

                              I do not know why I am not getting your field rules or report layout. Can you take screen shots of the calculated field rule and the report layout and attach those? I am grabbing at straws now :)
                              This should give you a view of my core content and maybe we can figure out why my zip approach is not fruitful.
                              Thanks

                              Comment

                              Working...
                              X