Splitting the comma separated values in a column into multiple columns in Snaplogic

716 views Asked by At

I have table data like below.

OTDATA

"ABC,CDE,EDF,123,10/20/2020"

"WDE,RED,ERT,231,09/22/2020"

"ERT,WED,TGY,453,08/10/2020"

I am trying to split into below through snaplogic.

OTDATA,OTDATA,OTDATA,OTDATA,OTDATA

ABC,CDE,EDF,123,10/20/2020

WDE,RED,ERT,231,09/22/2020

ERT,WED,TGY,453,08/10/2020

I have used mapper to do $OTDATA.split(',') but I am not achieving the desired output. Can you please give me a way to do it?

1

There are 1 answers

0
Bilesh Ganguly On

You can use two mappers one after the other with one mapper that splits the string and the other mapper that maps the elements of the resulting array to its corresponding fields.

Please note that you can't have fields with the same name.

Please refer to the following screenshots.

#1 Mapper that splits the string

Split string

#2 Mapper that maps the array elements to corresponding fields

Final mapper