Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Partial match and return value across two tables

Hi team,

I have the data in following two tables where i want to match phone numbers in one of the column without country code with another column in a different table that contains phone number and country code together. I was envisioning an approach that uses Text.End function based on the length dynamically.

 

Table A

Phone Number
9823456789
9923456788
9022334455

 

Table B

Phone (with country code)id
190223344553344
9199234567883311

 

Final Output

Phone Numberid
9823456789null
99234567883311
90223344553344
  • Anonymous's avatar
    Anonymous
    3 years ago

    You could use add a column like:

     

    Table.AddColumn(TableOrPriorStepName, "NewValues", each Table.FindText(TableB,  [Phone Number]))

     

    --Nate

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    You could use add a column like:

     

    Table.AddColumn(TableOrPriorStepName, "NewValues", each Table.FindText(TableB,  [Phone Number]))

     

    --Nate

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Anonymous 

      Thanks for your response. It works but can we please improve performance by specifying a column in TableB?

      • Anonymous's avatar
        Anonymous
        Not applicable

        You can try this:

         

        Table.AddColumn(TableOrPriorStepName, "NewValues", each Table.FindText(TableB[[Phone (with country code)id]],  [Phone Number])

         

        --Nate