Forum Discussion

shuang's avatar
shuang
Frequent Visitor
7 years ago
Solved

Combine columns from different tables

 

Hello, Newbie here. I know others have posted similar questions, but couldn't find a way to do mine. 

 

So I have two tables:

Table 1

IDCollection DatespeciesLatitudeLongitudeTest statusaction

 

Table 2:

Sub_IDSample datespeciesLatitudeLongituderesult

 

 

Table 1 and 2 have no relationship. What I want to do is to creat a new table, Table 3 in this way:

 

combine ID from Table 1 and Sub_ID from Table 2 into column "Identification" in Table 3

combine Collection Date from Table 1 and Sample Date from Table 2 into column "Date" in Table 3

combine Test status from Table 1 and result from Table 2 into column "Status" in Table 3

...

 

New Table 3 looks like this

IdentificationdatespecieslatitudeLongitudeStatus

 

I need to keep every single rows from each table. How can I do this?

 

Thanks you. 

 

  • Rename the Column Head of both table, and make sure that the two are equal.


    IN powerquery  select the most recent table, and then "Apend New Queries" 

4 Replies

  • rafaelmpsantos's avatar
    rafaelmpsantos
    Icon for Responsive Resident rankResponsive Resident

    These 2 tables has the same numbers of rows? in each row number of tableA you have in tableB the correspondent value in the same row?

    • shuang's avatar
      shuang
      Frequent Visitor

      They have different rows. Table 1 has 2000 plus rows and Table 2 has about 300 rows. They are totally different set of data and are not related in anyway. Table 1 is from a very old database and Table 2 is a newer one. We just need to put them together. Thanks. 

      • rafaelmpsantos's avatar
        rafaelmpsantos
        Icon for Responsive Resident rankResponsive Resident

        Rename the Column Head of both table, and make sure that the two are equal.


        IN powerquery  select the most recent table, and then "Apend New Queries" 

  • v-piga-msft's avatar
    v-piga-msft
    Icon for Resident Rockstar rankResident Rockstar

    Hi shuang,

     

    Agree with rafaelmpsantos. 

     

    Have you solved your problem?

     

    If you have solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

     

    If you still need help, please share your data sample and your desired output so that we could help further on it.

     

    Best  Regards,

    Cherry