Example: Union All

This scenario shows how the Join function merges the two input tables based on a set of rules.

Input Tables
JO - Material Table
Material Code Material Cost per Order Currency
M1001 Paper 3 USD
M1002 Plastic 3 USD
M1003 Wax 4 USD
M1006 Botton 1 USD
M1007 Cotton 10 USD
M1009 Glass 50 USD
M1010 Lace 5 USD
M1011 Leather 10 USD
M1012 Thread 5 USD
JO - Product Table
Product Code Product Price Currency
P0001 Shoe 75 EUR
P0002 Watch 300 EUR
P0003 Shirt 80 EUR
P0004 Shorts 20 EUR

Filter the tables first so that you have only the required entries:

  • For the Material Table, we set the condition to M1001, M1002 and M1003.

  • For the Product Table, we set the condition to P0001, P0002 and P0003.

Based on the selection conditions we set in the subview of each rule, we will have the following tables:

Interim Result
Material Table
Material Code Material Cost per Order Currency
M1001 Paper 3.00 USD
M1002 Plastic 3.00 USD
M1003 Wax 4.00 USD
Product Table
Product Code Product Price Currency
P0001 Shoe 75 EUR
P0002 Watch 300 EUR
P0003 Shirt 80 EUR

If we are using an explicit type of join, the fields that we define in the subview of each rule will be the output. However, we need to specify all the fields that we need in the subview of each rule because we need to have the same fields across the subview for the explicit view to work.

Union All is used to combine the result sets of two or more tables. It does not remove duplicate rows and all rows are returned.

Expected Result
Material Code Material Product Code Product Cost per Order Price Currency
M1001 Paper     3 0 USD
M1002 Plastic     3 0 USD
M1003 Wax     4 0 USD
    P0001 Shoe 0 75 EUR
    P0002 Watch 0 300 EUR
    P0003 Shirt 0 80 EUR