The process for Merge and Append are essentially the same. This walks through Merge.
Merge = Combines two or more files based on one or more matching columns so that their shared data appears on one row. In this example, starting with 1085 rows, and another with 1082 rows, we will end up with 1085 rows.
Append = Simply combines (add rows from one to another) two or more files and matches columns where they have the exact same name. In this example, starting with 1085 rows, and another with 1082 rows, we would end up with 2167 rows.
- In Excel,
- Open a Blank Workbook
- Choose the Data menu
- Choose Get Data
- > from File
- > from Excel Workbook
- Select a file from the window that opens
- In the subsequent window, click the appropriate tab from that Excel file
- Choose Transform Data
- Power Query Editor window opens
- In Power Query Editor, in the New Query section
- Choose New Source
- > File
- > Excel Workbook
- Select a file from the window that opens
- In the subsequent window, click the appropriate tab from that Excel file, and click OK
- Two reports now appear in the Queries pane (left)
- In the Combine section,
- Choose the drop down next to “Merge Queries”
- Choose Merge Queries as New
- A new Merge window opens, with one of the Excel files already chosen
- Choose the other Excel file from the drop-down in the middle
- Begin choosing which data columns to match on
- Click the column name from the top sample, then click the matching column name in the bottom sample. Both will highlight when selected.
- Choose columns that contain the exact same information. Both tables should contain matches, though not all will match. In this example, the match is between “IDF Form ID” and “Individual Data form ID,” because they will contain the same data.
- If matching on more than one column, CTRL+Click the second column
- Choose the Join Kind at the bottom.
- If unsure, choose “Full Outer” to keep all data from both Excel sheets
- Click OK
- The Merge window disappears, and a new table appears in the Queries in the left panel. This is file containing the merged files.
- Click Close & Load
- The window returns to the initial Excel Workbook and loads the merged files.
- In the Excel Workbook, the right panel will highlight which file is currently being viewed.
No comments:
Post a Comment