3 Replies Latest reply on Jan 21, 2016 7:11 AM by sunniar

    How to merge two records

    sunniar

      The database structure as follow

      UID               position               B               P

      123               head                    1.9               0.9

      123               tail                         1.88              0.91

      456               tail                         1.87               1.02

      456               head                       1.91               0.89

       

      And i want to merge the records like below:

       

      UID               B_head          P_head          B_tail          P_tail

      123               1.9                    0.9               1.88                    0.91

      456               1.91               0,89               1.87                    1.02

       

       

      please help,thx!

        • 1. Re: How to merge two records
          DanielShanahan

          I'm presuming that you started one way and want to change the process and data storage a different way.  In other words, this merge process is a one time thing.

           

          One way to do this is to create a new table and run a couple of imports.  The import should "Update matching records in found set" and match on the UID field.  You'll need to run the import a couple of times.  The first time, find all the position = head and export the results.  Import matching the UID field as mentioned above and B ---> B_head and P ---> P_head.

           

          Repeat the process for tails: find position = tails, export, import matching UID and B ---> B_tail, P---> P_tail.

          • 2. Re: How to merge two records
            siplus

            define 2 dummy fields, calculated. posHead = "head" and posTail = "tail".

             

            create 2 relationships based upon 2 criteria:

             

            RelTable_Head:

            UID = UID and posHead = Position

             

            RelTable_Tail:

            UID = UID and posTail = Position

             

            define the 4 fields you mention as autoenter lookup via these 2 relations.

             

            Select all records, relookup on UID, you're done.

             

            To prevent bad news, if it's a one-time only job, take away the lookup once done (delete the 2 dummies and the relationships, too)

            • 3. Re: How to merge two records
              sunniar

              It works,thank you very much。