Forum Discussion

jscivias's avatar
jscivias
Icon for Helper I rankHelper I
3 years ago
Solved

Comparing two databases and removing rows of identical (& similar) entries from one database

Hello, suppose I have two different excel files:   File 1:     File 2:   Company  Type    Company  Type  AAA A   AAA Inc. B BBB A   BBB B CCC A   DDD B   I h...
  • v-yueyunzh-msft's avatar
    3 years ago

    Hi, rsbin 

    You want to remove obscure data as well as duplicate data (first table is removed first). Right?

    Here are the steps you can refer to in Power Query Editor:

    (1)This is my test data:

     


    (2) For fuzzy data, we can first let the data get back to normal format.

    We can use this M language:

    = Table.TransformColumns(test, {"Company",(x)=>Text.Split(x," "){0}   }  )

    (3)Then we can remove the duplicates between the two tables and combine the two tables (we can create a blank query and enter):

    = Table.SelectRows(Sheet2 , (x)=>not List.ContainsAny({x[Company]},List.Intersect({Sheet2[Company],Sheet3[Company]}) )   ) & Sheet3

    (4)Then we can meet your need , the result is as follows:

     

    If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.

     

    Best Regards,

    Aniya Zhang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly