By the end of this chapter you will be able to:
In this exercise, you will merge the two sets of data you just loaded into PhixFlow: the data from the file, and the data from the database.
Create a merge table
You will now add a new merge table to your Introduction to Modelling analysis model to merge the two sets of data.
Hover your mouse over
Tables in the toolbar to show the list of options.
- Drag the
Merge Table onto your model. - In the Basic Settings, set Name:
Customer All Details
. - Click
Apply and Close to save and close the settings for the Customer All Details merge table. - In the model, hover your mouse pointer over the Customer Addresses table you created earlier.
- In the popup toolbar, select
Connector, then click the end of the arrow onto the table Customer All Details. This connector will pipe data into the merge table. - Similarly, add a connector from the table SOURCE_CUSTOMER_PHONE_NUMBERS to Customer All Details.
- Double-click on the pipe from Customer Addresses to Customer All Details to open its settings.
- In the Basic Settings section, set:
- Name: this pipe is automatically named in.
In the Sort/Group section, click
Show Attributes. PhixFlow displays the list of attributes (columns).
- Drag CustomerRef from the list into the Sort/Group section.
- Close the list of attributes.
- In the settings, click
Apply.
- Double-click on the pipe from SOURCE_CUSTOMER_PHONE_NUMBERS to Customer All Details. This pipe will be called in_2
.
In the Sort/Group section, click
Show Attributes. PhixFlow displays a list of the attributes (columns) in the SOURCE_CUSTOMER_PHONE_NUMBERS data.
- Drag CUSTOMER_REF into the Sort/Group section.
- Close the list of attributes.
- In the settings, click
Apply.
- Now add attributes from Customer Addresses
to the merge table:- Hover over Customer Addresses
and in the popup toolbar, click
Show Attributes. Drag all attributes from this list and drop them onto the table icon for Customer All Details in your model.
- PhixFlow asks for confirmation. If it is not already selected, select Use original attribute name. Then click Confirm.
![](https://phixflow.atlassian.net/wiki/download/thumbnails/9106741165/image2022-11-24_10-20-25.png?version=1&modificationDate=1669285225063&cacheVersion=1&api=v2&width=400&height=324)
- Similarly, drag all attributes from SOURCE_CUSTOMER_PHONE_NUMBERS to Customer All Details
.
- To see the resulting settings for Customer All Details, double-click its icon to open the settings tab and look at the Attributes section. You can see a list of 8 attributes (data columns).
Run analysis and view the table data
- To run analysis on your new table, hover your mouse pointer over the table Customer All Details, and in the popup toolbar, click
Run Analysis. - To view the data you just loaded, hover over the table and click
Show view. You will see the address data you loaded from the file combined with the phone numbers you loaded from the database, like the image below:![](https://phixflow.atlassian.net/wiki/download/thumbnails/9106741165/Analysis%20Pt%201%20Ch%204%20Table%20View.png?version=1&modificationDate=1686212264062&cacheVersion=1&api=v2&width=600&height=338)
- Click
Apply and Close to finish and close the merge table settings. - In the model window, click
Save.
Check Point
At this point your screen should look like this:
![](https://phixflow.atlassian.net/wiki/download/thumbnails/9106741165/Analysis%20Pt%201%20Ch%204%20Checkpoint.png?version=1&modificationDate=1686212520620&cacheVersion=1&api=v2&width=600&height=252)