Concat Processor

The Concat processor is used to concatenate the records of two or more data sources. If the schemas of the inputs are different, you can choose either the union of schemas (fields which don't exist in a particular input will be null) or the intersection of schemas (only fields which exist in all schemas will be retained).

The Concat processor is selected from the menu bar of the Designer window and then placed in the designer window workspace.

Properties

The editable properties are shown in Figure 4.31, “Concat Wizard”.

Figure 4.31. Concat Wizard

Concat Wizard

The Schema combo box contains the Union and Intersection options to choose which fields are passed through to the output.

The data sources that are connected to the Concat processor are listed in the window list box. The Up and Down arrows are used to move the selected data source up or down to change the order in which the records are concatenated.

Working with Concat Processor

As an illustration, let's concat the Stores and Sales data sources:

  1. Add a Composite DataSource named Concat.

  2. Select the Sales data source and drag and drop it onto the diagram. Repeat for the Stores data source.

  3. Add a Concat processor to the diagram.

  4. Connect the Stores data source and Sales data source to the Concat processor. Then connect the output of the Concat to the Result. The diagram appears as shown in Figure 4.32, “Sample Concat Flow”.

    Figure 4.32. Sample Concat Flow

    Sample Concat Flow

Combining all the fields of the data sources using the Union option

  1. Open the Concat Properties and select the Union option from the Schema combo box.

  2. The names of the data sources are listed in the window provided below the combo box.

  3. Use the up and down arrows to order the inputs as desired - for example to ensure Stores records come before Sales.

  4. Click Finish button in the Concat Wizard and review the output of Result. All the fields in the two data sources are combined together and displayed. Where no field data is available, the processor inserts nulls.

Combining the common field of the data sources using the Intersection option

Follow the procedure as outlined above, but now choose the Intersection option from the Properties dialog. Now when you review the Result output, you will see that only one field exists in both datasource schemas, store_id.