Forum Discussion

CharmaineSilver's avatar
CharmaineSilver
Qrew Member
5 years ago

Splitting one table into two

Hi
I want to "create a new table" from a field in one table and want to move the address field across to the new table but it doesn't show as an additional field I can move. Currently have one table with companies and contacts - want to split it so one company(parent) has many contacts(child). So the data I split out should be the company info (I think).- ie parent info) And address is one of the company fields I want to move....but it wont let me. Any help would be appreciated.

------------------------------
Charmaine Silverman
------------------------------

5 Replies

  • To my knowledge, your best bet is to start fresh. If you are familiar with Excel or Google Sheets you can do this in a rather short amount of time. There are several steps, but they are pretty simple and you only have to do this once.

    1. Export the data
    2. Copy & paste the company fields to a new sheet
    3. Delete duplicates
    4. Add a key field to the right of the primary company field
    5. Populate the key field with ascending numbers starting at 1
    6. Add a key lookup field to the contacts sheet on the right and next to the company field
    7. vlookup the key from the company field in the company sheet
    8. Copy the key lookup column and paste values
    9. Delete the company field from the contacts sheet
    10. Delete the key field from the company sheet
    11. Upload the two sheets to two Quick Base tables creating new fields and verifying the fields are of the correct type
    12. Create a relationship where one company has many contacts and use the key lookup field from the contacts table as the reference field and add any other lookup fields you may have in the company table
    A key field must be unique and so you remove the duplicates of your company field. Quick Base generates Record ID#'s and assigns them to records in ascending order as they are located within the upload file. That is why you added the key field and populated it with ascending numbers so that the key lookup field in the child table will match the correct Record ID# in Quick Base when you upload the data and create the relationship. This will give you the parent/child relationship you are wanting and will add the company info to the contacts records for you.

    Here is a post that shows step by step details of creating the relationship; it was for a different use case, but the relationship set-up is the same:
    Building Relationships Using Keys

    You should notice that the data in this example has the key lookup field on the far left and is titled ID; this field is what allows the child table to lookup to the parent table and also allows the parent table to summarize the child table when the relationship is created.

    Hope this helps you out Charmaine.

    ------------------------------
    Adam Keever
    ------------------------------
    • MarkShnier__You's avatar
      MarkShnier__You
      Icon for Qrew Legend rankQrew Legend
      Charmaine
      This can be done natively with a few clicks.

      You can copy the table to create the new table and then hack away all the fields that you do not need. Just run a checkbox down all the fields you don't need. There will be a button to Copy Table on the Table Home page. 

      Just set up a saved table to table import and copy across the records into the contacts table.  You will find it lets you map across the address field components. In fact, the fields will auto line up correctly as they will have the identical spelling if you create the table as a copy  Be sure to map the [Record ID#] field into the field for [Related Company] in Contacts.

      ------------------------------
      Mark Shnier (YQC)
      Quick Base Solution Provider
      Your Quick Base Coach
      http://QuickBaseCoach.com
      mark.shnier@gmail.com
      ------------------------------
      • CharmaineSilver's avatar
        CharmaineSilver
        Qrew Member
        Thank you - please can you confirm which records I should delete from the copied table - the contact details or the company details?
        And then copy the contacts details from the original table  ? or copied table to a new table? Sorry I am getting myself confused. Can you just add which tables I am using in your above answer and I should then be able to do it.

        ------------------------------
        Charmaine Silverman
        ------------------------------