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 Field - Expected Value

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

    Calculated Field - Expected Value

    I have a mapped table. In the grids' calculated Fields, The expression builder says the expressions are good to go, showing the amounts as I step through the records. However, the calculated values window does not like the expressions, stating in bright red, Expected Value. Does a mapped table require further code? If so, what might that code be? If not, any ideas why the expression builder agrees with the expressions but the calculated values window says, 'not so fast'?
    TYVM :) kenn

    Knowing what you can achieve will not become reality until you imagine and explore.

    #2
    Re: Calculated Field - Expected Value

    Ken, not sure whats going on there or how to even begin to guess. We don't know so much about whats going on. I would suggest a video of your issue, unless you can really clarify whats going on. For instance what exactly is the "calculated values window?" is this a message box popup? It sounds to me like something is missing in the calculation, perhaps if you left out a value or you have or have not checked NULL if blank (in a UX) then the calculation might be trying to calculate a char field...so many scenarios.
    NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

    Comment


      #3
      Re: Calculated Field - Expected Value

      Hi Charles,

      This a grid built on a mapped table. Even though it's a mapped table, the fields are all from 1 of the 3 tables which make up the mapped table. Exp-1 shows the expression builder. Exp-2 shows the Calculated Values window, which pops up when the Grids' calculated Fields button is pressed (Grid Query view for selecting the table). Exp-3 shows both together. AS you can see, the expression builder it works fine but in the Calculated Values window, it wants another value. Independently, the same expression in the regular table, works OK so it must be something to do with the Mapped Table. Hopefully, this will be of some help.
      Attached Files
      TYVM :) kenn

      Knowing what you can achieve will not become reality until you imagine and explore.

      Comment


        #4
        Re: Calculated Field - Expected Value

        if you have defined a calculated field in the mapped table why do you need to redefine the same field in the grid builder, is that field not available?
        thanks for reading

        gandhi

        version 11 3381 - 4096
        mysql backend
        http://www.alphawebprogramming.blogspot.com
        [email protected]
        Skype:[email protected]
        1 914 924 5171

        Comment


          #5
          Re: Calculated Field - Expected Value

          Hi Gandhi,

          The expressions must be defined in the grid. They will not work when defined in the table itself. Using a field, such as Total Invoice, and defining the expression in the fields Calculated Field Expression will work but the Display Format does not work. Special formatting must be used as noted in the Important Information link at the top of the Display Format window. Unfortunately, the suggested format does not work either because the OK button does not activate. I tried 2 suggested formats:

          Alltrim(str( (Sale*Comborate),250,2,�,�))

          alltrim(st(<value>,250,2,�,�))

          Neither will trigger the OK button. That leaves the window for defining the calculated fields in the grid itself.

          EDIT: The expressions work when using the grid which is based on the non mapped table. Obviously, it has to do with the mapped table. More code needed? A bug? Documentation? The only reference to a calculated field I found in the mapped table documentation is the reference to Combining the firstname and and lastname fields into one. It referrs to the field with the original table, not the mapped table.

          I tried doing that. salestax= if(tlc_3apps->Exempt="Y",0,tlc_3apps->Sale*tlc_3apps->Comborate). Now the error message is that the Exempt field is not found. If I remove the table name, then it's back to the 'expected value' error. Time for a break.
          Last edited by forskare; 04-13-2015, 11:33 PM.
          TYVM :) kenn

          Knowing what you can achieve will not become reality until you imagine and explore.

          Comment


            #6
            Re: Calculated Field - Expected Value

            Try just putting this for the calculated field value: if(Exempt="N",Sale*Comborate,"0")
            NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

            Comment


              #7
              Re: Calculated Field - Expected Value

              I would create some placeholder fields if the mapped tables are causing an issue - then just perform the calculation and save it within the table your after.
              NWCOPRO: Nuisance Wildlife Control Software My Application: http://www.nwcopro.com "Without forgetting, we would have no memory at all...now what was I saying?"

              Comment


                #8
                Re: Calculated Field - Expected Value

                can you please post sample fields from your table ( not necessary to include all the fields only the one that matters to do the map and calculations)
                thanks for reading

                gandhi

                version 11 3381 - 4096
                mysql backend
                http://www.alphawebprogramming.blogspot.com
                [email protected]
                Skype:[email protected]
                1 914 924 5171

                Comment


                  #9
                  Re: Calculated Field - Expected Value

                  Originally posted by GGandhi View Post
                  can you please post sample fields from your table ( not necessary to include all the fields only the one that matters to do the map and calculations)
                  salestax= if(tlc_3apps->Exempt="Y",0,tlc_3apps->Sale*tlc_3apps->Comborate)

                  Salestax - The field in the grid( Not the mapped table)
                  Exempt - Field in the mapped table
                  Sale - Field in the mapped table
                  Comborate - Field in the mapped table

                  The Salestax is determined by: if the Exempt field value = "Y", then the salestax value is 0, else the salestax value is determined by multiplying the value in the Sale field by the tax rate in the comborate field.
                  TYVM :) kenn

                  Knowing what you can achieve will not become reality until you imagine and explore.

                  Comment


                    #10
                    Re: Calculated Field - Expected Value

                    There's not much info on Mapped Fields and I have not been able to identify the issue is with defining calculated fields in the Query/Calculated fields box. Perhaps Alpha cannot add these fields to a mapped table using this method. It would be most helpful to all if Alpha would shed some light on this.

                    I did, however, find 2 ways to define a calculated field in a mapped table.

                    1) If the field is already in the physical table, go to the Fields' Field Properties and define the expression in the Display Expression box.

                    2) If the field is not in the physical table, it can be added by clicking the 'Add Computed Column' link located just below the field selection list and defining the field and expression there.

                    The rest of the formatting can be defined in the form, browse, report, grid or ux.

                    Edit:

                    Since a Mapped table can be made 'Updateable', It can also be used to data entry. For instance, if you have a need to update or perform data entry with 2 or more fields but only need a few fields, a mapped table might be a solution.
                    Last edited by forskare; 04-15-2015, 09:47 PM.
                    TYVM :) kenn

                    Knowing what you can achieve will not become reality until you imagine and explore.

                    Comment


                      #11
                      Re: Calculated Field - Expected Value

                      Perhaps Alpha cannot add these fields to a mapped table using this method
                      it is quite possible that the mapped table is in-memory table not a physical table alpha cannot access the fields to calculate a new field until those tables are combined, in memory of course. i was not interested in your mapped tables. i wanted to see your tables (without any mapping) and your desired outcome. many times another pair of eyes will spot the solution that is evading lot easier than the original. definitely i can vouch for that from my own experience. it is quite possible you have solved your situation, if so very good.

                      edit:
                      from alphapedia:
                      A mapped table is a virtual table that displays data from one or more physical tables
                      Last edited by GGandhi; 04-16-2015, 06:48 AM.
                      thanks for reading

                      gandhi

                      version 11 3381 - 4096
                      mysql backend
                      http://www.alphawebprogramming.blogspot.com
                      [email protected]
                      Skype:[email protected]
                      1 914 924 5171

                      Comment


                        #12
                        Re: Calculated Field - Expected Value

                        Hi Gandhi,

                        All the fields in the expression are from the physical table except the outcome field, which of course, has to be from the virtual table. In my experimenting, it makes no differene if the mapped table is in a state of creation or has been saved. The behavior is the same.

                        Mapped tables are a great feature and can play a vital roll in an application be it in a desktop or web application. Come to think of it, I remember some talk several years ago about a new method on the horizon to link tables without using a set. If Alpha would tweak this a bit, how great would mapped tables be for displaying data, reports, etc. The ability to use a mapped table in a web app is really, very cool.
                        TYVM :) kenn

                        Knowing what you can achieve will not become reality until you imagine and explore.

                        Comment

                        Working...
                        X