Splits one input data set into two outputs based on a true/false condition that you define.
The simplest way to split your data is by using the Criteria grid in the Split property. Alternatively, for more advanced techniques, you can use the Advanced tab.
If the input data meets the condition(s) that you have specified it will be listed in the first output pin (true), if the data does not meet the condition(s) that you have specified it will be listed in the second output pin (false).
Simple split
- Firstly, connect the Split node to a node that has run successfully to ensure that the input data is available.
- Select the Split node and view the Properties panel.
- In the Criteria grid of the Split property, select a Field on which you want to base the split from the drop-down menu. You can type in the drop-down to filter the list of fields to those which contain the typed text.
- Choose an operator and specify a value.
The Criteria grid allows you to specify one or more split criteria groups. In the simplest case, you may wish to create just a single split criteria. However, if you specify multiple criteria, you can choose to Match all (AND in boolean logic terms), Match any (OR) or Match none (NAND) of these criteria in order to output a row of data.
By default, a single filter criteria group is created for you to populate. You can create further groups by clicking Add new criteria group. When you have multiple groups, you can then choose whether to Satisfy all groups or Satisfy any group in order to output a row from the input data set. This allows you to specify filter logic such as:
- Match all in group 1 AND Match any in group 2
- Match all in group 1 OR Match any in group 2 OR Match any in group 3
Example
You have the following input data to a Split node:
Product_Codeunicode | Product_Nameunicode | Payment_Methodunicode | Payment_Amountunicode |
---|---|---|---|
15 | Tea | Card | 1.2 |
2 | Coffee | Cash | 1.5 |
3 | Water | Cash | NULL |
15 | Tea_EarlGrey | Cash |
1.75 |
15 | Tea_Herbal | Card | 1.75 |
15 | Tea | Card | 1.2 |
You want to split off any records where the Payment_Method
is Card
:
- In the Criteria grid of the Split property, select the
Payment_Method
field. - From the list of operators, select Equals.
- In the Value column, type
Card
. - Run the Split node.
All records that match the condition that you have specified, that is all records where the Payment_Method
is Card
, are output to the first pin (true), and the remaining three records where the Payment_Method
is Cash
are output to the second pin (false):
Output pin 1 (true)
Product_Codeunicode | Product_Nameunicode | Payment_Methodunicode | Payment_Amountunicode |
---|---|---|---|
15 | Tea | Card | 1.2 |
15 | Tea_Herbal | Card | 1.75 |
15 | Tea | Card | 1.2 |
Output pin 2 (false)
Product_Codeunicode | Product_Nameunicode | Payment_Methodunicode | Payment_Amountunicode |
---|---|---|---|
2 | Coffee | Cash | 1.5 |
3 | Water | Cash | NULL |
15 | Tea_EarlGrey | Cash | 1.75 |
Properties
Split
The simplest way to split your data is by using the Criteria grid to select the field(s) that you want to split by. If the input data meets the condition(s) that you have specified in this property, it will be listed in the first output pin (true), if the data does not meet the condition(s) specified in this property, it will be listed in the second output pin (false).
Alternatively, for more advanced techniques, select the Advanced tab. A value is required for this property.
Example data flows
A number of sample Data Flows are available from the Samples workspace, found in the Analyze Directory page.
In the Directory under the /Data360 Samples/Node Examples/
folder, you will find "Filtering Splitting and Concatenating Data", which shows examples of how to use this node.
Inputs and outputs
Inputs: in1.
Outputs: true, false, multiple optional.