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

split field

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

  • split field

    I have 16,000 plus records. One field is "Name" and it is as follows; without the brackets: [Smith, John]. Some records have: [Smith, ], others [, John].
    I want to create two fields: first name and last name. Is there a way to split the name field into Fname and Lname?
    Jim [email protected]
    Jim Belanger

  • #2
    Re: split field

    Hi Jim,
    An update operation should do it. If you use the genie, there is an option to break a field into its parts.
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

    Comment


    • #3
      Re: split field

      Bare with me. Does the Genie take the one field and create two new ones or do I have to create two new fields ahead of time and let the genie populate them?
      Jim Belanger

      Comment


      • #4
        Re: split field

        Jim,
        Robin is right. You still have to do a little work
        create your 2 new fields First and Last
        Go to operations, new, update fields(at the bottom on the left), then choose the table.
        Int the left column, choose a field like "fname" and in cter column choose the expression button.
        Here you can use the built in funtions to sort for first name.
        Last name = next line
        Dave Mason
        [email protected]
        Skype is dave.mason46

        Comment


        • #5
          Re: split field

          Thanks to both of you.
          1. I don't see a Genie.
          2. I added Lname and Fname for two new fields in the table.
          3. I went to operations and picked Update Field
          4. In left column, I selected Lname for field.
          5. In center column (expression) I went to function, searched for split names and got this expression
          set_ext_field_name_get(
          6. Then, I clicked on Help on Current Function, at the bottom but nothing happens.
          7. Not sure now if I want to select Field Name or Field Value to keep going.
          Jim Belanger

          Comment


          • #6
            Re: split field

            Later versions are slightly different but if you choose the Operations tab of the control panel, New you should be presented a screen where you choose the operation type, the table, and see buttons for Create Using Genie and (simply) Create. If you press the Create using genie button you should see the selection for character fields to Break a field into its parts.


            updare.pngparts.png
            There can be only one.

            Comment


            • #7
              Re: split field

              I no longer have V9 loaded but I am quite sure it, like V10, has a "Create Using Genie" button for creating a new Update operation. Assuming that is true, and assuming your name field data is as simple as you say it is, there are 2 genie options:
              1. Break a Name into its parts
              2. Break a Field into its parts

              Because Break a Name into its parts won't deal with ", John", you should use Break a Field into its parts, as this will deal with ", John". It will also deal with "Smith, Jane K" assuming "Jane K" would be okay for the first name field. If you don't want the "K" in there just create another (Genie created) update operation to remove what comes after the 1st word. Oh my, what to do if you have common first names such as Mary Ann or any number of other possibilities? If you have those, come back here and someone may help. And oh yes, if you have last names that are more than one word, fortunately for you the comma in the full name field is going to take care of those.

              Of course there are other ways of dealing with your situation, but given everything you state, using the Genie is clearly the way to go.

              Ray Lyons

              Comment


              • #8
                Re: split field

                Hopefully Jim will check back and tell us if he sees the same screens that Stan showed above. I checked back to v8 and the Create Using Genie button is definitely there. But even without the genie, on the create update screen he could write the code he needs using a different function - like word().
                Robin

                Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                Comment


                • #9
                  Re: split field

                  OK
                  I'm getting closer. Don't know how I missed the Genie but I did find it now.
                  I ran the operation. First four records changed as follows.
                  Name was Belanger, Hercule. It entered Lname as Belanger and Fname as a blank.
                  Name was Belanger, Joseph Alfred W. It entered Lname as Belanger and Fname as Joseph.
                  Name was Belanger, Marguerite Jane. It entered Lname as Belanger and Fname as Marguerite.
                  Name was Belanger, Domithilde. It entered Lname as Belanger and Fname as a blank.

                  The Genie wrote the Fname operation as:
                  WORD(NAME,1))<>"REV".AND.W_COUNT(NAME)>1.AND.ATC(",",NAME)=0,WORD(NAME,1),IF(W_COUNT(NAME)<3.OR.((UT(WORD(NAME,1))="MR".OR.UT(WORD(NAME,1))="MRS".OR.UT(WORD(NAME,1))="MS".OR.UT(WORD(NAME,1))="MISS".OR.UT(WORD(NAME,1))="DR".OR.UT(WORD(NAME,1))="REV").AND.ATC(",",NAME)>0.AND.W_COUNT(NAME)=3),"",WORD(NAME,2)))

                  Lname operation as:
                  IIF(ATC(",",NAME)=0,WORD(NAME,-1),WORD(SUBSTR(NAME,1,(ATC(",",NAME)-1)),-1))
                  Jim Belanger

                  Comment


                  • #10
                    Re: split field

                    Success!

                    I re read the instructions. Split a name did not work right. But, Split a field did. This has now been accomplished.

                    For those with patience for a 73 year old who is not a computer geek, can I ask for another piece of help for the same table???

                    I have three different character fields. Each is set up for a field length of 5 characters.
                    All the characters are actually numbers; no letters.
                    Field one is a day
                    Field tow is a month
                    Field three is a year

                    All year fields have a full four character number.
                    Day and month fields have a one or two character number.

                    Can I make it one date field? Or, do I live with it as is?
                    Jim Belanger

                    Comment


                    • #11
                      Re: split field

                      Yes you can
                      create a date field and following the same procedures you did above. In the code area, it will be something like:
                      ctod(alltrim(Month)+"/"+alltrim(day)+"/"+alltrim(year))

                      ctod = character to date
                      Others may make it better for you.
                      Dave Mason
                      [email protected]
                      Skype is dave.mason46

                      Comment


                      • #12
                        Re: split field

                        In the Update genie select the General tab and Assign a Calculated Value to a Field. Then select your new date field as the field you want to update and in the expression builder use Dave's expression substituting your actual field names.
                        Robin

                        Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                        Comment


                        • #13
                          Re: split field

                          So
                          I would reverse the calucation if I wanted Day/Month/Year?
                          ctod(alltrim(Day)+"/"+alltrim(Month)+"/"+alltrim(year))

                          Also, in my first quest to record first name and last name; that worked well EXCEPT, there was a space after the comma and before the first letter of the first name so all first names have a space in front of them. Can that be deleted?

                          I'll do what I can with the dates and let you know how I make out.
                          Jim Belanger

                          Comment


                          • #14
                            Re: split field

                            Originally posted by Beltronics View Post
                            So
                            ....Also, in my first quest to record first name and last name; that worked well EXCEPT, there was a space after the comma and before the first letter of the first name so all first names have a space in front of them. Can that be deleted?
                            ....
                            Yes. In your case it would probably be best to use an Update operation with the Search and Replace option on the first name field and replace the space with nothing. This will create an expression: STRITRAN(FNAME," ","")

                            Ray Lyons

                            Comment


                            • #15
                              Re: split field

                              Jim,
                              Now you have me curious

                              The Genie wrote the Fname operation as:
                              WORD(NAME,1))<>"REV".AND.W_COUNT(NAME)>1.AND.ATC(",",NAME)=0,WORD(NAME,1),IF(W_COUNT(NAME)<3.OR.((UT(WORD(NAME,1))="MR".OR.UT(WORD(NAME,1))="MRS".OR.UT(WORD(NAME,1))="MS".OR.UT(WORD(NAME,1))="MISS".OR.UT(WORD(NAME,1))="DR".OR.UT(WORD(NAME,1))="REV").AND.ATC(",",NAME)>0.AND.W_COUNT(NAME)=3),"",WORD(NAME,2)))
                              How did you get the genie to filter out these titles? And what will you do about the 'period' that most titles include?

                              I think you know more than you are letting on!
                              Robin

                              Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                              Comment

                              Working...
                              X