Forum Discussion

rds_2019's avatar
rds_2019
Icon for Helper I rankHelper I
7 years ago
Solved

Join 2 tables by using LIKE or containstring

Hi,

Is it posible to join 2 tables using LIKE instead of equal.

 

So if there are 2 tables tables1 and table 2 and join is on column1 and column11 respectively.

So can we use something like

 

WHERE table1.column1 like (%Table2.column11%)..

 

the purpose is to find like 

if column11 = xyz

and column1= axyz.... We can still join these 2

 

Presently when w join 2 tables in Model Tab it is as per = , so like

table1.column1 = table2.column11

 

Thanks

RDS

  • Hi rds_2019 ,

    You can try to use the function of SEARCH to find the keyword. Is there any column in your table that can link two tables? I created a sample using the function of  RELATED to combine two columns based on id. 

    Column = IF(SEARCH("*efg*",'Table 1'[Column1]),RELATED('Table 2'[Column1]),BLANK())

    Best Regards,

    Xue

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

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    rds_2019  what is the purpose of joining?

    If you just want to relate them you can create an index coumn in each table and then relate them. If not you like to compare and match data values between tables, you can use Calculate and firstnotblank. If you don't know how to use them let me know to make and example.

    • rds_2019's avatar
      rds_2019
      Icon for Helper I rankHelper I

      Thanks for replying. My purpose is of relating or joining 2 tables so that i can use one table's values in anoher .

      So in Table1.column1 has value =

       

      Column1
      efg

      and table2.column2 has values = 

       

      Column2Column3
      efgrr
      efgttmm

       

      I want to make sure when i design report for table1. it considers both values of table2.Column3..

      Currently since join is between efg and efg.. column3's value "rr" will be considered .

      I want both rr and mm of column3 should get considered in the report against value efg of table1.column1.

       

      I hope i made sense to you.

       

      Cheers,

      RDS

      • v-xuding-msft's avatar
        v-xuding-msft
        Icon for Community Support rankCommunity Support

        Hi rds_2019 ,

        You can try to use the function of SEARCH to find the keyword. Is there any column in your table that can link two tables? I created a sample using the function of  RELATED to combine two columns based on id. 

        Column = IF(SEARCH("*efg*",'Table 1'[Column1]),RELATED('Table 2'[Column1]),BLANK())

        Best Regards,

        Xue

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

  • v-xuding-msft's avatar
    v-xuding-msft
    Icon for Community Support rankCommunity Support

    Hi rds_2019 ,

    Could you tell me if your problem has been solved? If it is, kindly mark the helpful answer as a solution if you feel that makes sense. Welcome to share your own solution. More people will benefit from here.

     

    Best Regards,

    Xue Ding

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