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 Expression in Field Rules

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

    Calculated Field Expression in Field Rules

    Hello Alpha people. This is my first post ever. Maybe someone can help me with this problem. I am using Alpha 5 version 4.5 build 266. My first question is: how many characters are allowed in creating an expression for a Calculated Field Expression in the Field Rules? I thought I read somewhere that was being expanded, maybe in version 5? but I can't find where I read that now. I have a very long expression (mainly because my field names are too long)in an existing large database, but now I need to add to the expression and it won't fit. I'm not a programmer and maybe this expression could be made more concise and still work. The fact that I got it to work at all still amazes me. I guess that shows the power of Alpha5. The expression I need to fit is attached as a .txt file. Maybe someone who really knows expression construction could take a look at it and give me some feedback.
    Thanks.
    David Francis

    #2
    RE: Calculated Field Expression in Field Rules

    I attached the .txt file and it said it uploaded but I don't see it here. The expression is copied and pasted here:
    IF(GROUP_AGENT_NUM=23.OR.GROUP_AGENT_NUM=24,
    ((NUM_OF_TIX_1*PRICE_1+NUM_OF_TIX_2*PRICE_2+NUM_OF_TIX_3
    *PRICE_3+NUM_OF_TIX_4*PRICE_4+NUM_OF_TIX_5*PRICE_5+
    NUM_OF_TIX_6*PRICE_6)-(TOTAL_TIX_ON_ORDER*2))*.05,
    IF(DOW="SAT".OR.DOW="SUN".AND.TIME="MAT".AND.PERF
    "10/15M-00",0,IF(PERF>="11/24E-00".AND.PERF="12/24E-00".AND.PERF

    Comment


      #3
      RE: Calculated Field Expression in Field Rules

      Wow.
      Welcome aboard! Without breaking that apart in too much detail I saw right off...

      NUM_OF_TIX_n*PRICE_n

      repeated many times. I would make a calculated field in the database to multiply those 2 fields ahead of time.

      Then it would be the your field calc would shorten to..
      ...TotTix1+TotTix2+TotTix3...

      You could also take that 1 step farther and have a grand total on in the database (for each record) to add up all the individual TotTix if you are always adding all 6.

      So your first line would end up to be

      IF(GROUP_AGENT_NUM=23.OR.GROUP_AGENT_NUM=24,
      (ALLTIX-(TOTAL_TIX_ON_ORDER*2))*05,.....

      Where ALLTIX is the sum of all TotTix, which is number of tickets times the price. Clear as mud huh? lol. Well, I'm sure you will get more help. Probably clearer explainations too.

      Mick

      Comment


        #4
        RE: Calculated Field Expression in Field Rules

        Mick,
        Thanks. What you're saying is perfectly clear. I'm just chicken. I'd have to add those fields to the data base, then an update operation to do all the calculations into the new fields on the 500,000 or so records (that's scarey). If I screwed it up the evil empire would have my head. :) But everything is copied to CD, and I guess I could copy everything to a separate folder on the hard drive and do the updates there to see if it works without me destroying all the data. Once again, thanks, you may have given me the solution.
        David

        Comment


          #5
          RE: Calculated Field Expression in Field Rules

          David,

          When you copy the files from the CD back onto your hard drive, remember to take the read-ony attribute off of the files, or you will have a slight heart attack when you try to open the database. The files CANNOT have read only access, which is what happens when you copy files to a CD and then back onto a hard drive.

          Good luck.

          Regards,

          Jay Talbott
          Jay Talbott
          Lexington, KY

          Comment


            #6
            RE: Calculated Field Expression in Field Rules

            If putting the calculated field in the table scares you, why not make calculated fields in the report?? You could do this:

            TT1 NUM_TIX_1 * Price_1
            TT2 Num_TIX_2 * Price_2

            etc.

            This way, you don't modify your tables, but you do get a shorter expression in your calc.

            As I recall, you now only have 255 characters in any given calc expression.

            Tom Henkel

            Comment


              #7
              RE: Calculated Field Expression in Field Rules

              Mick has given you the best advice.

              If you're still way of changing your table you could try building calculations up to your final expression as in:

              Calculated field for the report only

              TT1 = NUM_OF_TIX_1*PRICE_1
              TT2 = NUM_OF_TIX_2*PRICE_2
              etc

              Then building your final expression you could refer to

              calc->TT1 + calc->TT2......

              saving 11 characters per instance.

              Don't know whether that would get you under the 1024 character limit or not, but it is an option to remember for future use.
              There can be only one.

              Comment


                #8
                RE: Calculated Field Expression in Field Rules

                You beat me there.

                Thanks,

                Stan
                There can be only one.

                Comment


                  #9
                  RE: Calculated Field Expression in Field Rules

                  Sorry, I didn't completely read that you wanted to put this in a field rule. This will work for a report or a form.

                  Tom

                  Comment


                    #10
                    RE: Calculated Field Expression in Field Rules

                    Just another thought.

                    I don't understand why you are keeping all of these calculations in the table to begin with. As long as you have the raw data; # tix, price of tix,etc, you can do all of the massaging when you need it, you don't necessarily need to hold all of that calculated info in the table. It would grow dramatically if you needed to add another calculated condition.

                    Try rethinking about what data is necessary to store, and what can be calculated on the forms, reports, and letters. Granted, having the calculated totals in the record make building reports easier( you just need to retrieve one field), I just don't think that this is the most efficient way to store data. It is just my opinion that calculations should be performed only where needed. If you are holding the raw information in your table, you can make your reports, forms, letters, etc do or say anything you want.

                    Tom Henkel

                    Comment


                      #11
                      RE: Calculated Field Expression in Field Rules

                      Thomas,
                      Calculating these on the record is there for data entry verification. The total # tix, total $, commissionable total $, and commission $ are all on the group contract from which data is entered. Then an eyeball check to make sure totals match ensure the data was entered correctly for each record. Even though all the prices, etc are in lookup tables, it's possible to enter wrong # of tix with different price, etc. And Alpha5 is great for this because it allows that real time calculation to be done. For the life of me I couldn't figure out how to get Access to do it in real time. If I didn't need this data entry check I would have just done the calcs on the reports.
                      Thanks,
                      David

                      Comment


                        #12
                        RE: Calculated Field Expression in Field Rules

                        James,
                        Thanks for that read-only advice. I would have had a heart attack or at least a major stress attack trying to figure out why I couldn't access those files.
                        David

                        Comment

                        Working...
                        X