Combining Data (Union)

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 passed in, a record is passed out.

This technique is useful when performing a data migration that consolidates data from 3 separate systems that all follow the same data structure. 

Solution

It is assumed that all data sources are imported into their own tables in an  Analysis Model. 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

  1. From the  Table drop down on the analysis toolbar, click and drag a  Calculate table on your model
    1. In the Properties, set the Name, e.g. Output Table
  2. For each of the input tables, from its hover over toolbar, select  Connector, then click the end of the arrow onto the output table

  3. Hover over the first input table and from the popup toolbar click 

  4. In the Attributes window, tick all of the attributes and drag them onto the output table
    1. Select Use original attribute name
    2. Click Confirm
      1. This automatically creates the attributes for us in the output table
    3. Close the Attributes window
  5. We now need to set up the attributes to pull information from all input tables
    1. Click on the output table and  Pin the tab to keep it open
    2. In the Attributes section, double click the first attribute
    3. Remove the pipe prefix, typically this will be "in."
      1. For example, in.CompanyName becomes CompanyName.
      2. By doing this we are telling PhixFlow to look for this attribute name regardless of which pipe it is coming from
    4. Repeat this for all of your attributes, the configuration is illustrated below:
    5. f
  6. Click  Apply and Close to save and close the settings for the output table