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

Add new fields to existing table and populate just those fields with an import or append?

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

    Add new fields to existing table and populate just those fields with an import or append?

    I have an existing alpha table (Table1) with 8000 records with fields A thru M some of which are calculated fields. Data in an excel spreadsheet (Table2) collected by another system has some fields not included in Table1, say fields N thru Z. Table1's structure has been modified in design mode to include those new fields N thru Z. Table1 and Table2 share a unique identifier but I don't want to work with the tables in a one-to-one relationship, I would rather import the data from Table2 into the records of Table1 using the unique identifier for correct placement.

    I have been trying to use operations to accomplish this but to little success. It seems that my only option is the import the excel Table2 into a new alpha table and then Join Table1 and Table2 into a new Table3. Of course all of the components, security and reports are based on Table1 so I guess I will have to rename the original Table1 to something like Table1_old and rename Table3 to Table1 and hope all the components and reports work???

    So in explaining that pain staking process I am hoping to invoke a sympathy resolution that is simpler. Like and operation that allows me to identify the unique identifier, map the fields I need imported into the new impty fields created in Table one and import/append/update (whatever) only those fields to the existing records in Table1.

    Append operation will import the new fields from Table2 to the proper records in Table1 but in the process it says it will erase the existing data in Table1 for any fields not imported. Why??

    Does anyone have a simple solution or can point out an operation or option I am not finding?

    Thank you.

    #2
    Re: Add new fields to existing table and populate just those fields with an import or append?

    Please supply where you found the idea that an append will blank out fields. That doesn't sound right to me.

    Sounds like an append or update will do what you want.
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.
    "Make it as simple as possible, but not simpler."
    Albert Einstein

    http://www.iadn.com/images/media/iadn_member.png

    Comment


      #3
      Re: Add new fields to existing table and populate just those fields with an import or append?

      Here is a screen shot of the last screen of the builder before committing to the operation for an import of selected fields from one table (excel or Alpha dbf) to the master table (alpha dbf).
      AlphaDAO import.jpg

      Note:
      If I chose for alpha not to check for duplicate records, it will import all the data from the fields specified but all the other existing fields in the Master Table will be empty.

      If I chose for it to check for duplicates I can only ignore the current record which will not import the values for the new fields or I can tell it to replace the record in the Master which also then renders the fields that I don't want effected blank.

      Comment


        #4
        Re: Add new fields to existing table and populate just those fields with an import or append?

        Here is a screen shoot of an append operation. In this case I have already imported the excel table into my project as a new dbf table.
        append.jpg

        Note:
        The text at the top says "If you leave a blank entry in a cell, the corresponding field in the master table will not contain data." So see the field Edittracki in the Master. The Master has everything I want already in all the records for that field. If I leave the mapping blank, the operation then renders Editteacki blank for all the records in the master. They were not blank before the operation! This occurs for all fields I leave not mapped.

        I am just trying to bring in data from a few new fields to the master but then lose the data in all the other fields that I leave unmapped. I don't want to map all the other fields because the transaction table doe not have corresponding fields to those in the master.

        Selecting next from the above screen shot I again get the duplicate option.
        duplicate.jpg

        If I select No, then I get all new records not values updated in the existing records. If I select Yes I can either have them not appended which defets the purpose or it replaces the entire record so that now only the mapped fields have data. All the others will have the values wiped out.

        So this is where I get the idea that appending from one table to another blanks out the not mapped fields in the same record that the append occurred. If there is another way please do share.

        Thanks.
        Last edited by Hansolo; 06-21-2014, 06:26 PM.

        Comment


          #5
          Re: Add new fields to existing table and populate just those fields with an import or append?

          The most important part I forgot wit the two options above. I do not get the opportunity to select a unique field shared between the tables with which to match the data to the correct records so those operations (Import and Append) are pretty unless.

          The operation called Update does not give you the option of selecting fields from another table. With Update it seems you can only change what is in an existing table from values from withing the existing table. Not useful in this case.
          Last edited by Hansolo; 06-21-2014, 06:48 PM.

          Comment


            #6
            Re: Add new fields to existing table and populate just those fields with an import or append?

            Well join does not work very well either. Besides the operation failing every time it seems it will not maintain my calculated field definitions from the Master to the new table. So I will have to recreate those if I actually got Join to work.

            Comment


              #7
              Re: Add new fields to existing table and populate just those fields with an import or append?

              Decided to match each table precisely with the same exact records. They both have exactly 8231 records and are ordered based on a unique ID. So lets go old school and just cut an paste. Doesn't work. The Paste just places the data from the Cut into new records so I go from 8231 records to 16462. AN extra 8231 useless records. Clearly I don't know how to use Alpha. Those of you more experienced would never have made this so popular if what I am trying to do were really so hard.

              Comment


                #8
                Re: Add new fields to existing table and populate just those fields with an import or append?

                Having searched the Forum and Wiki, it seem that no one in the history of Alpha has ever wanted to redesign an existing table to include some new fields and then import values from another table to populate those fields in the Master table. Amazing. Or I just don't know the correct terms for the search.

                Comment


                  #9
                  Re: Add new fields to existing table and populate just those fields with an import or append?

                  Originally posted by Hansolo View Post
                  Here is a screen shoot of an append operation. In this case I have already imported the excel table into my project as a new dbf table.
                  [ATTACH=CONFIG]38381[/ATTACH]

                  Note:
                  The text at the top says "If you leave a blank entry in a cell, the corresponding field in the master table will not contain data." So see the field Edittracki in the Master. The Master has everything I want already in all the records for that field. If I leave the mapping blank, the operation then renders Editteacki blank for all the records in the master. They were not blank before the operation! This occurs for all fields I leave not mapped.

                  I am just trying to bring in data from a few new fields to the master but then lose the data in all the other fields that I leave unmapped. I don't want to map all the other fields because the transaction table doe not have corresponding fields to those in the master.

                  Selecting next from the above screen shot I again get the duplicate option.
                  [ATTACH=CONFIG]38382[/ATTACH]

                  If I select No, then I get all new records not values updated in the existing records. If I select Yes I can either have them not appended which defets the purpose or it replaces the entire record so that now only the mapped fields have data. All the others will have the values wiped out.

                  So this is where I get the idea that appending from one table to another blanks out the not mapped fields in the same record that the append occurred. If there is another way please do share.

                  Thanks.
                  Build the operation but don't use the genie. Build by opening the card to fill out the operation options.
                  Al Buchholz
                  Bookwood Systems, LTD
                  Weekly QReportBuilder Webinars Thursday 1 pm CST

                  Occam's Razor - KISS
                  Normalize till it hurts - De-normalize till it works.
                  Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
                  When we triage a problem it is much easier to read sample systems than to read a mind.
                  "Make it as simple as possible, but not simpler."
                  Albert Einstein

                  http://www.iadn.com/images/media/iadn_member.png

                  Comment


                    #10
                    Re: Add new fields to existing table and populate just those fields with an import or append?

                    Solution:

                    Export Master alpha table to Excel. Merge that master excel table with the fields from the other excel table manually. Import the new merged table into alpha as a new dbf. Edit the structure of the new dbf to be exactly like the original master dbf. Redefine all calculated fields. Finally, rename old master table and then rename new table to the previous name of the Master table. Test that all components and reports work with the new table that now has the mane of the table they were all built around. Many many hours later wonder why you can't automate such a process. Prey that it all works.

                    Thanks. :-)

                    Comment


                      #11
                      Re: Add new fields to existing table and populate just those fields with an import or append?

                      Thanks I did both. Same choices different dialog boxes in the process and it was just easier to get the screen shots by using the genie to get to them rather than traverse the builder for that purpose.

                      This is the builder choices for an append.

                      All (This one will just assign the values to entirely new records)
                      Unique only (This one will not allow any of the new data to be added because the records are not unique)
                      Unique, replace existing (This one will replace all the existing data in the fields I did not map with blank data)

                      So Results are the same at least in my hands. I am sure this will get figured out in a few days and I will wonder why I couldn't figure it out when I needed it. :-)
                      Last edited by Hansolo; 06-21-2014, 07:22 PM.

                      Comment


                        #12
                        Re: Add new fields to existing table and populate just those fields with an import or append?

                        Originally posted by Hansolo View Post

                        All (This one will just assign the values to entirely new records)
                        Unique only (This one will not allow any of the new data to be added because the records are not unique)
                        Yes you don't want this choice.

                        Originally posted by Hansolo View Post
                        Unique, replace existing (This one will replace all the existing data in the fields I did not map with blank data)
                        I don't know where you get the idea that the unmapped columns will be blanked out in existing rows. That does not happen.

                        The text you referred to previously is discussing what happens when a new row (record) is generated.

                        In new rows you must map all of the columns that you want data in, but that's not what you are doing.

                        In some other software that I've used prior to Alpha the terminology was add update. ie add if the key doesn't exist otherwise update the existing record.

                        Same thing is happening with the Alpha append choice - Unique, replace existing
                        Last edited by Al Buchholz; 06-21-2014, 11:23 PM.
                        Al Buchholz
                        Bookwood Systems, LTD
                        Weekly QReportBuilder Webinars Thursday 1 pm CST

                        Occam's Razor - KISS
                        Normalize till it hurts - De-normalize till it works.
                        Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
                        When we triage a problem it is much easier to read sample systems than to read a mind.
                        "Make it as simple as possible, but not simpler."
                        Albert Einstein

                        http://www.iadn.com/images/media/iadn_member.png

                        Comment


                          #13
                          Re: Add new fields to existing table and populate just those fields with an import or append?

                          Thanks for your response. After doing this dozens of times I can assure you that at least in my hands the data in existing fields which I don't want to change do get blanked when the fields I mapped actually get values.

                          However, as cryptic as it sounds there is an operator called "Post" that at least got most of this work done for me. It still required me to import the data into a new alpha table first and of course make sure field types were the same between the master and transaction table but then it had the correct logic to "replace" each of the NULL fields in the Master with Values from the fields mapped in the transaction table.
                          post.jpg

                          I would like to meet the guy that named these Operation titles and wrote the short descriptions. One operation could be called "Append Records" which is what "Append" does and another could have been called "Append Fields" which is what "Post" does. Anyway, 12 hours later.....

                          Now all I have to do is remember this when I need to do it again in a year or so on another project!

                          Thanks for the moral support Al.

                          Comment

                          Working...
                          X