Scenario
Where we have two sources of data that share the same structure, i.e. the same attribute names, we can combine these into a single table without the need to perform a merge. The intention is that we will keep all records, so for every record we pass in we will get one out.For example, if we are passed in, a record is passed out.
This technique is useful when performing a data migration where we are consolidating that consolidates data from 3 separate systems that all follow the same data structure we can use this technique.
Solution
It is assumed that all data sources are imported into their own tables in an
analysis model. Insert excerpt |
---|
| _analysisModel |
---|
| _analysisModel |
---|
nopanel | true |
---|
|
. We will refer to all tables that are due to be combined as input tables and the table where the data is being combined as the output table. - From the Create section of the analysis toolbar, click
Insert excerpt |
---|
| _datasource_show_tables_datasource |
---|
| _show_tables |
---|
nopanel | true |
---|
|
Drag the drop down on the analysis toolbar, click and drag a Insert excerpt |
---|
| _table_calculate_table |
---|
| _table_calculate_table |
---|
nopanel | true |
---|
|
onto table on your model.- In the settingsProperties, set the Name, e.g.
Output Table
For each of the input tables, from its hover over toolbar, select , then click the end of the arrow onto the output table.
Hover over the first input table and from the popup toolbar click
Insert excerpt |
---|
| _attributes_show_hideicon |
---|
| _attributes_show_hideicon |
---|
nopanel | true |
---|
|
.Tick - In the Attributes window, tick all of the attributes and drag them onto the output table.If PhixFlow asks for confirmation
Delect - Select Use original attribute name.
- Click the arrow Image Removed to confirm. Confirm
- This automatically creates the attributes for us in the output table
.
- Close the Attributes window
- We now need to set up the attributes up to pull information from all input tables.
- Click on the output table , in its Attributes section and the tab to keep it open
- In the Attributes section, double click the first attribute
- Remove the pipe prefix, typically this will be "in."
- For example,
in.CompanyName
becomes CompanyName
. - By doing this we are telling PhixFlow to look for this attribute name regardless of which pipe it is coming from
.
For example, in.CompanyName
becomes CompanyName
.
- Repeat this for all of your attributes, the configuration is illustrated below:Image RemovedImage Removed
Click Image Removed OK- f
Image AddedImage Added
- Click
Insert excerpt |
---|
| _finish |
---|
| _finish |
---|
nopanel | true |
---|
|
to save and close the settings for the output table.