Hitachi Vantara Pentaho Community Wiki
Access Keys:
Skip to content (Access Key - 0)

Description

What this step does is implement the Switch/Case statement found in popular programming languages like Java.

In our case we route rows of data to one or more target steps based on the value encountered in a certain field. 



Version

This step was first introduced in version 3.1.0-RC1 (trunk revision 7777, PDI-1217)

Options

Option Description
Step name
The name that uniquely identifies the step.
Field name to switch
The field name that contains the value to use as a bases for the row routing.
Use string contains comparison
If checked, the comparison will be true if the value is found anywhere in the field being tested. Unchecked and the value has to exactly match the field.
Case value data type
The data type of the values specified in this dialog
Case value conversion mask
The conversion mask of the values specified in this dialog (numeric / date values)
Case value decimal symbol
The decimal symbol of the values specified in this dialog (numeric values)
Case value grouping symbol The grouping symbol of the values specified in this dialog (numeric values)
Case values
Here you can specify a value-target step pair, one per row.
To specify a null value, simply leave the value column blank while entering a target step.
Please note that it is possible to specify the same target step more than once.
Default target step
All the rows that don't match any of the case values above are sent to this target step.
   

Example

A sample transformation demonstrating the capabilities of this step is available in the distribution package (in samples folder)

samples/transformations/Switch-Case - basic sample.ktr

Metadata Injection Support (7.x and later)

All fields of this step support metadata injection. You can use this step with ETL Metadata Injection to pass metadata to your transformation at runtime.


This documentation is maintained by the Pentaho community, and members are encouraged to create new pages in the appropriate spaces, or edit existing pages that need to be corrected or updated.

Please do not leave comments on Wiki pages asking for help. They will be deleted. Use the forums instead.

Adaptavist Theme Builder (4.2.0) Powered by Atlassian Confluence 3.3.3, the Enterprise Wiki