Question

I'm looking for a step that merges 4 columns into 1 new column. For each row, only one of the four columns has a populated cell. Additionally, the columns are of type String.

Was it helpful?

Solution

You can also do this with the Calculator step. The advantages are that it doesn't require dropping into code, thus maintaining the visual metaphore, and it's faster than JavaScript.

In the calculator step, when you define a new field, that field becomes available to subsequent calculations within the same step. So if I have Field_000 ... Field_003, I can configure the step like this:

Calculator Setup

The output from the calculator step will have two new fields, 'tmpField1' and 'outField' which has the concatenation of the four fields.

BTW, if by 'populated' you mean the field has a non-null value, you could use the calculator's NVL function to achieve the same thing. That would essentially be a Coalesce operation.

OTHER TIPS

One of the process.

you can use modified java script step,

there you can give the field title what ever you want to give and perform concatenation their.

This very simple. Fastest and the best way to achieve is using Concat Fields Step.

Go To Transform Folder - > Drag "Concat Fields" Step into design canvas,

In the FIELDS Tab, just select the column you want to concatenate, In addition, you can supply format and Type ( even if you try to concatenate integer fields it will work).

Type your concatenate Column name in the "TARGET FIELD NAME" and specify the separator for the concatenate Column values And Finally click OK.

Note: Not to use Javascript for simple transformation it will decrease the performance

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top