Split (Deprecated) - Data360_Analyze - Latest

Data360 Analyze Server Help

Product type
Software
Portfolio
Verify
Product family
Data360
Product
Data360 Analyze
Version
Latest
Language
English
Product name
Data360 Analyze
Title
Data360 Analyze Server Help
Copyright
2024
First publish date
2016
Last updated
2024-11-28
Published on
2024-11-28T15:26:57.181000

This deprecated node splits one input data set into two outputs based on a true/false condition that you define.

CAUTION:
This node has been deprecated and will not be supported in a future release. As an alternative, the Split node can be used to provide similar functionality, but the underlying code is Python rather than Data360 Analyze Script.

The simplest way to split your data is by using the Criteria grid in the PredicateExpr property. Alternatively, for more advanced techniques, you can use the Advanced tab.

Note: You must choose to work in either the Criteria grid or the Advanced tab, as working in one will reset the other.

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

  1. Firstly, connect the Split node to a node that has run successfully to ensure that the input data is available.
  2. Select the Split node and view the Properties panel.
  3. In the Criteria grid of the PredicateExpr 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.
  4. 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.

Tip: To remove a row from the criteria grid, click the menu on the far right of the row that you want to remove and select Delete.

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
Tip: If you have connected the Split node to a node that has not yet run, the list of fields in the criteria grid will not be populated. In this case, you can add a split criteria by typing the name of a field and pressing Enter. When the node is executed, an error will be generated if this field does not exist.

Basic example using the Criteria grid

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:

  1. In the Criteria grid of the PredicateExpr property, select the Payment_Method field.
  2. From the list of operators, select Equals.
  3. In the Value column, type Card.
  4. 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

To further modify the output, for example, to exclude the Product_Code information, enter the following additional Script in the Script property and re-run the node:

emit *exclude Product_Code

In this case, the output of the first pin (true) would be as follows:

Product_Nameunicode Payment_Methodunicode Payment_Amountunicode
Tea Card 1.2
Tea_Herbal Card 1.75
Tea Card 1.2

Advanced configuration

If you wish to create a more complex split, there are several Script functions that you can use to return a true or false result. The following tables give an overview of some common operators that you can use within a Split or Transform node.

Comparison operators

Operator Description
== Equals
> Greater than
>= Greater than or equal to
< Less than
<= Less than or equal to
!= Not equal to
+ Add or plus
- Subtract or minus
* Multiply
/ Divide
Tip: A single "=" declares a new object and associates a name to it. For more information, see the [%=GeneralProduct%] Script help.

Logical operators

Operator Description
not Returns values that do not match the specified condition.
or Returns the Boolean value of true if one or more of the conditions is true.
and Returns the Boolean value of true if both of the conditions are true.

Example using the Advanced tab

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_Amount is NULL:

  1. Select the Advanced tab of the PredicateExpr property.
  2. Type: Payment_Amount.isNotNull()
  3. Run the Split node.

All records that do not contain a NULL value in the Payment_Amount field (i.e. where the condition that you specified is true) are output to the first pin (true), and the Payment_Amount record that contains a NULL value is output to the second pin (false):

Output pin 1 (true)

Product_Codeunicode Product_Nameunicode Payment_Methodunicode Payment_Amountunicode
15 Tea Card 1.2
2 Coffee Cash 1.5
15 Tea_EarlGrey Cash

1.75

15 Tea_Herbal Card 1.75
15 Tea Card 1.2

Output pin 2 (false)

Product_Codeunicode Product_Nameunicode Payment_Methodunicode Payment_Amountunicode
3 Water Cash NULL

Properties

PredicateExpr

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.

Script

Optionally specify Script to further modify the split output, for example to exclude a specific field.

Inputs and outputs

Inputs: in1.

Outputs: true, false, multiple optional.