Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Join data sources before importing data

Hello - i have question that i think should be very easy to solve.  I need to help an end user who does not know SQL.   I have two tables:  Table A with 20k rows with a key value Table B with 10M...
  • v-jingzhang's avatar
    3 years ago

    Hi Anonymous 

     

    Are these two tables from the same database? If they are in the same database, the "Merge Query" feature supports Query Folding, which means that this merging operation will be transformed into a native SQL query automatically and it sends the native query to the data source to make the data source execute it. In this scenario, you can right click on Table B query and uncheck the "Enable load" option. This will make Table B not be imported. 

    And in Table A query, right click on the "Expanded Table B" step or "Merged Queries" step, then check whether "View Native Query" option is clickable. If it's clickable, you can click it to see the generated native query. This means it supports query folding. If it's disabled, this means it cannot be folded. Please notice that query folding is supported when you merge Table B into Table A with "Merge Queries". If you use "Merge Queries as New" to have the merged result in a third query, this doesn't support query folding. So please ensure that query folding is enabled on this step in Table A query. 

     

    Another option is to enter the left outer join SQL statement under "Advanced option" in the database connection window directly. This can also send this query to the database to make database execute it directly.  

    Import data from a database using native database query - Power Query | Microsoft Learn

    For example, 

    Best Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as Solution to help other members find it.