Forum Discussion
nsingam
4 years agoEmployee
Hi David,
I have tried to create a sample pipeline that supports multiple labels (ex: 1.1,1.2,1.3,2.1, 2.2 etc). Check the attached pipeline which has the sample data for multiple values. Hope this will help you.
Normalized_Column_Sample_2022_07_08.slp (17.6 KB)
bchaubey
3 years agoNew Contributor
Hi Team, I want to normalize the data like below source
col1;col2
ABC;CC1,CC2,CC3
DEF;CC1,CC2,CC3
Target should be like below
col1;col2
ABC;CC1
ABC;CC2
ABC;CC3
DEF;CC1
DEF;CC2
DEF;CC3
May i know how it is possible in Snaplogic?
- nsingam3 years agoEmployee
Hi,
You can use the below expression a mapper followed by a splitter snap.
$value.split(“;”)[1].split(“,”).map(x =>$value.split(“;”)[0]+“;”+x)
in the above expression, $value is assumed to be the actual source value.
The example source json is as follows.[{“value”:“col1;col2”},
{“value”:“ABC;CC1,CC2,CC3”},
{“value”:“DEF;CC1,CC2,CC3”}]