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

Can anyone help me with this expression?

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

    Can anyone help me with this expression?

    Attached is a description of what I would like to do.
    I am not good at math.

    #2
    Re: Can anyone help me with this expression?

    Originally posted by jdoyle View Post
    Attached is a description of what I would like to do.
    I am not good at math.
    Where are you trying to do this? On a report, on a form? What is the field name of the field containing "# in Class"?

    Given a "# in class" (num) the expression for first place points is

    Code:
    case(between(num,3,4),1,num=5,2,num=6,3,num=7,4,between(num,8,15),5,between(num,16,23),6,between(num,24,31),7,between(num,32,39),8,num>39,9)
    for second place points

    Code:
    case(between(num,3,4),0,num=5,1,num=6,2,num=7,3,between(num,8,15),4,between(num,16,23),5,between(num,24,31),6,between(num,32,39),7,num>39,8)
    and you see the pattern for the rest.
    Last edited by Stan Mathews; 01-31-2007, 10:32 AM.
    There can be only one.

    Comment


      #3
      Re: Can anyone help me with this expression?

      Trying to use it on a form. I want to total the number of entries in a class.
      In class 1 there are 3 animals entered. So if there are 3 entries, the first place wnner would be awarded 1 point to be posted in the field ALSA Points. and so no according to formula in the doc. Attached in my first post.

      In Class Column labled Class the field name is Classid
      In the column labled Placed the field name is Placed
      In the column labled ALSA Points the field name is ALSA_points

      Screen shot of form attached.

      I am new to Alpha5 v8, appreciate your help.

      Comment


        #4
        Re: Can anyone help me with this expression?

        Trying to use it on a form. I want to total the number of entries in a class.
        In class 1 there are 3 animals entered. So if there are 3 entries, the first place wnner would be awarded 1 point to be posted in the field ALSA Points. and so no according to formula in the doc. Attached in my first post.

        In Class Column labled Class the field name is Classid
        In the column labled Placed the field name is Placed
        In the column labled ALSA Points the field name is ALSA_points

        Screen shot of form attached in thread

        I am new to Alpha5 v8, appreciate your help.
        Last edited by jdoyle; 01-31-2007, 01:02 PM. Reason: posted twice

        Comment


          #5
          Re: Can anyone help me with this expression?

          Originally posted by jdoyle View Post
          Trying to use it on a form. I want to total the number of entries in a class.
          In class 1 there are 3 animals entered. So if there are 3 entries, the first place wnner would be awarded 1 point to be posted in the field ALSA Points. and so no according to formula in the doc. Attached in my first post.

          In Class Column labled Class the field name is Classid
          In the column labled Placed the field name is Placed
          In the column labled ALSA Points the field name is ALSA_points

          Screen shot of form attached in thread

          I am new to Alpha5 v8, appreciate your help.
          The expression you want is

          Code:
          case(between(tablecount("llama_data","class = "+class),3,4).and.placed = 1,1,tablecount("llama_data","class = "+class)=5,case(placed=1,2,placed=2,1),tablecount("llama_data","class = "+class)=6,case(placed=1,3,placed=2,2,placed =3,1),tablecount("llama_data","class = "+class)=7,case(placed=1,4,placed=2,3,placed =3,2,placed=4,1),between(tablecount("llama_data","class = "+class),8,15),case(placed=1,5,placed=2,4,placed =3,3,placed=4,2,placed=5,1),between(tablecount("llama_data","class = "+class),16,23),case(placed=1,6,placed=2,5,placed =3,4,placed=4,3,placed=5,2,placed=6,1),between(tablecount("llama_data","class = "+class),24,31),case(placed=1,7,placed=2,6,placed =3,5,placed=4,4,placed=5,3,placed=6,2,placed=7,1),between(tablecount("llama_data","class = "+class),32,39),case(placed=1,8,placed=2,7,placed =3,6,placed=4,5,placed=5,4,placed=6,3,placed=7,2,placed=8,1),tablecount("llama_data","class = "+class)>39,case(placed=1,9,placed=2,8,placed =3,7,placed=4,6,placed=5,5,placed=6,4,placed=7,3,placed=8,2,placed=9,1))
          Last edited by Stan Mathews; 01-31-2007, 01:24 PM.
          There can be only one.

          Comment


            #6
            Re: Can anyone help me with this expression?

            Holly Cow, Stan!

            Jim posted his reply at 11:30 and you had that Leviathan code complete by by 12:18! Amazing! (I threw in that fancy word that I got from Peter Greulich to help me find this thread in the future).
            Mike W
            __________________________
            "I rebel in at least small things to express to the world that I have not completely surrendered"

            Comment


              #7
              Re: Can anyone help me with this expression?

              Originally posted by Mike Wilson View Post
              Holly Cow, Stan!

              Jim posted his reply at 11:30 and you had that Leviathan code complete by by 12:18! Amazing! (I threw in that fancy word that I got from Peter Greulich to help me find this thread in the future).
              Sorry to be so slow. I am at work and somewhat distracted.

              Perhaps it won't look so imtimidating if you break it down in a word processor and see the repetitive nature of the solution. Most was just cut, pasted, and slightly altered.

              Code:
              case(
              between(tablecount("llama_data","class = "+class),3,4).and.placed = 1,1,
              tablecount("llama_data","class = "+class)=5,case(placed=1,2,placed=2,1),
              tablecount("llama_data","class = "+class)=6,case(placed=1,3,placed=2,2,placed =3,1),
              tablecount("llama_data","class = "+class)=7,case(placed=1,4,placed=2,3,placed =3,2,placed=4,1),
              between(tablecount("llama_data","class = "+class),8,15),case(placed=1,5,placed=2,4,placed =3,3,placed=4,2,placed=5,1),
              between(tablecount("llama_data","class = "+class),16,23),case(placed=1,6,placed=2,5,placed =3,4,placed=4,3,placed=5,2,placed=6,1),
              between(tablecount("llama_data","class = "+class),24,31),case(placed=1,7,placed=2,6,placed =3,5,placed=4,4,placed=5,3,placed=6,2,placed=7,1),
              between(tablecount("llama_data","class = "+class),32,39),case(placed=1,8,placed=2,7,placed =3,6,placed=4,5,placed=5,4,placed=6,3,placed=7,2,placed=8,1),
              tablecount("llama_data","class = "+class)>39,case(placed=1,9,placed=2,8,placed =3,7,placed=4,6,placed=5,5,placed=6,4,placed=7,3,placed=8,2,placed=9,1))
              Last edited by Stan Mathews; 01-31-2007, 02:37 PM. Reason: attachment displays structure more clearly
              There can be only one.

              Comment


                #8
                Re: Can anyone help me with this expression?

                Tried the expression but get an "invalid or incomplete expression" error

                I have attached data base zip if that might help.

                Again thanks for your help.
                You stated that your are work. This is not an immediate emergency.

                Comment


                  #9
                  Re: Can anyone help me with this expression?

                  Originally posted by jdoyle View Post
                  Tried the expression but get an "invalid or incomplete expression" error

                  I have attached data base zip if that might help.

                  Again thanks for your help.
                  You stated that your are work. This is not an immediate emergency.
                  Placed is a character field in your table, I assumed numeric. Added quotes around all the placed = result tests.

                  Code:
                  case(between(tablecount("llama_data","class = "+class),3,4).and.placed = "1",1,tablecount("llama_data","class = "+class)=5,case(placed="1",2,placed="2",1),tablecount("llama_data","class = "+class)=6,case(placed="1",3,placed="2",2,placed ="3",1),tablecount("llama_data","class = "+class)=7,case(placed="1",4,placed="2",3,placed ="3",2,placed="4",1),between(tablecount("llama_data","class = "+class),8,15),case(placed="1",5,placed="2",4,placed ="3",3,placed="4",2,placed="5",1),between(tablecount("llama_data","class = "+class),16,23),case(placed="1",6,placed="2",5,placed ="3",4,placed="4",3,placed="5",2,placed="6",1),between(tablecount("llama_data","class = "+class),24,31),case(placed="1",7,placed="2",6,placed ="3",5,placed="4",4,placed="5",3,placed="6",2,placed="7",1),between(tablecount("llama_data","class = "+class),32,39),case(placed="1",8,placed="2",7,placed ="3",6,placed="4",5,placed="5",4,placed="6",3,placed="7",2,placed="8",1),tablecount("llama_data","class = "+class)>39,case(placed="1",9,placed="2",8,placed ="3",7,placed="4",6,placed="5",5,placed="6",4,placed="7",3,placed="8",2,placed="9",1))
                  There can be only one.

                  Comment


                    #10
                    Re: Can anyone help me with this expression?

                    Alternative expression using character based "placed" field.

                    Code:
                    case(between(tablecount("llama_data","class = "+class),3,4).and.placed = "1",max(val(placed),0),tablecount("llama_data","class = "+class)=5,max(3-val(placed),0),tablecount("llama_data","class = "+class)=6,max(4-val(placed),0),tablecount("llama_data","class = "+class)=7,max(5-val(placed),0),between(tablecount("llama_data","class = "+class),8,15),max(6-val(placed),0),between(tablecount("llama_data","class = "+class),16,23),max(7-val(placed),0),between(tablecount("llama_data","class = "+class),24,31),max(8-val(placed),0),between(tablecount("llama_data","class = "+class),32,39),max(9-val(placed),0),tablecount("llama_data","class = "+class)>39,max(10-val(placed),0))
                    After creating an index for the table on the class field, expression class, this expression evaluates significantly faster and the calc field updates more smoothly.

                    Code:
                    case(between(dbcount("llama_data","class",class),3,4).and.placed = "1",max(val(placed),0),dbcount("llama_data","class",class)=5,max(3-val(placed),0),dbcount("llama_data","class",class)=6,max(4-val(placed),0),dbcount("llama_data","class",class)=7,max(5-val(placed),0),between(dbcount("llama_data","class",class),8,15),max(6-val(placed),0),between(dbcount("llama_data","class",class),16,23),max(7-val(placed),0),between(dbcount("llama_data","class",class),24,31),max(8-val(placed),0),between(dbcount("llama_data","class",class),32,39),max(9-val(placed),0),dbcount("llama_data","class",class)>39,max(10-val(placed),0))
                    Last edited by Stan Mathews; 01-31-2007, 05:42 PM. Reason: another idea
                    There can be only one.

                    Comment


                      #11
                      Re: Can anyone help me with this expression?

                      Stan,
                      Sorry for the trouble, but I am still having problems in making the expressions work. I have tried all of them and keep getting error of "Invalid or incomplete expression. I am not sure about the syntax of the fields. In your expression you have "llama_data" and the label in my data base is "llama data", you have "class" and I have "classid". I have changed the syntax to mach my labels and still does now work. Have attached screen shots and current ziped data base.

                      Thanks
                      Jim

                      Comment


                        #12
                        Re: Can anyone help me with this expression?

                        Originally posted by jdoyle View Post
                        Stan,
                        Sorry for the trouble, but I am still having problems in making the expressions work. I have tried all of them and keep getting error of "Invalid or incomplete expression. I am not sure about the syntax of the fields. In your expression you have "llama_data" and the label in my data base is "llama data", you have "class" and I have "classid". I have changed the syntax to mach my labels and still does now work. Have attached screen shots and current ziped data base.

                        Thanks
                        Jim

                        I'll take a look in the morning.
                        There can be only one.

                        Comment


                          #13
                          Re: Can anyone help me with this expression?

                          Originally posted by Stan Mathews View Post
                          I'll take a look in the morning.
                          Looks like I lost track of this post, sorry. I'm making a note to look at it in the morning, really.
                          There can be only one.

                          Comment


                            #14
                            Re: Can anyone help me with this expression?

                            Originally posted by Stan Mathews View Post
                            Looks like I lost track of this post, sorry. I'm making a note to look at it in the morning, really.
                            I assumed from your screenshot that Placed was a character field (it was aligned left) so the places where I had val(placed) were causing the error on your end. ( Val(anynumber) is invalid. )

                            Should be

                            Code:
                            case(between(tablecount("llama data","Classid = "+Classid),3,4).and.placed = 1,max(placed,0),tablecount("llama data","Classid = "+Classid)=5,max(3-placed,0),tablecount("llama data","Classid = "+Classid)=6,max(4-placed,0),tablecount("llama data","Classid = "+Classid)=7,max(5-placed,0),between(tablecount("llama data","Classid = "+Classid),8,15),max(6-placed,0),between(tablecount("llama data","Classid = "+Classid),16,23),max(7-placed,0),between(tablecount("llama data","Classid = "+Classid),24,31),max(8-placed,0),between(tablecount("llama data","Classid = "+Classid),32,39),max(9-placed,0),tablecount("llama data","Classid = "+Classid)>39,max(10-placed,0))
                            and/or a similar editing of the dbcount version.

                            I am working in A5V5 so feel free to ignore the following if it doesn't pertain to your version.

                            One should never have punctuation in a table or field name, other than an underscore. You have a # and an &. I also avoid spaces in table names.

                            While it is possible to have long table and field names, their use can lead to problems. There is a limit to the number of characters you can have in an expression like the above (something like 1024 in A5V5). If such an expression needed to be written for the "llama_class_shownumber" table, one could quickly run over the limit.
                            There can be only one.

                            Comment


                              #15
                              Re: Can anyone help me with this expression?

                              Stan,
                              Thanks, the code worked, but it does not store the calulated points.
                              When you enter how the animal placed and go to the next field (ALSA_points) it shows the points but will not save the points in that field.
                              Any suggestions?
                              Jim

                              Comment

                              Working...
                              X