Merging Queries
- Open the workbook with multiple tables that resulted from queries.
- The matching field must be in both tables.
- Click a cell in one of the tables to be merged.
- Click the Merge button [Query tab, Combine group].
- The Merge dialog box opens.
- Select or confirm the table or query name in the upper text box.
- Click the drop-down list to display the names of queries in the workbook.
- Select the table or query from which you want to see all the records.
- The names are the original source data file names.
- Select the column that is the matching field.
- Select the second table name in the lower text box.
- Select the column with the matching field (Figure 10-14).
- The dialog box identifies how many rows were matched initially.
- Click the Join Kind drop-down list.
- Select the matching pattern.
- Join type names are from SQL (standard query language) and include a description of how the queries will be merged.
- Click OK.
- The combined query opens in the Power Query Editor.
- The default query name is MergeN.
- All fields from the first table are displayed; fields from the second table are aggregated or collapsed (Figure 10-15).
- Click the Expand/Aggregate button for the name of the second query.
- The second query name is the last column in the Power Query Editor.
- Select the Expand radio button if necessary and click OK.
- Additional rows display depending on the type of join.
- You can delete columns in the merge query when they duplicate each other.
- Load the data to the workbook.
Do you need help with this assignment or any other? We got you! Place your order and leave the rest to our experts.
