cancel
Showing results for 
Search instead for 
Did you mean: 

How to split column values into new row

rbikash7758
New Contributor III

Hi Guys ,

I have below given json as input and i wanted to spilt it into difference rows based on multi valued columns .

Input: “Cost_Center_Hierarchies”: [
{
“Fucntional_Lvl4”: “CC6140”,
“F_Lvl_4_Descr”: “Corporate - G&A”
},
{
“Fucntional_Lvl4”: “SF509”,
“F_Lvl_4_Descr”: “Corporate - G&A”
}
],
“Business_Unit_ID”: “LOB0022”,
“Business_Unit”: “Corp LiveRamp Dedicated LOB BU”,
“Cost_Center_ID”: “C6001”,
“Cost_Center_Name”: “C6001 Restructuring”

output :
Row-1
“Fucntional_Lvl4”: “CC6140”,
“F_Lvl_4_Descr”: “Corporate - G&A”
“Business_Unit_ID”: “LOB0022”,
“Business_Unit”: “Corp LiveRamp Dedicated LOB BU”,
“Cost_Center_ID”: “C6001”,
“Cost_Center_Name”: “C6001 Restructuring”

 Row-2
 "Fucntional_Lvl4": "SF509",
 "F_Lvl_4_Descr": "Corporate - G&A"
 "Business_Unit_ID": "LOB0022",
 "Business_Unit": "Corp LiveRamp Dedicated LOB BU",
 "Cost_Center_ID": "C6001",
 "Cost_Center_Name": "C6001 Restructuring"  

Please suggest.

Thanks,
Biksah

1 REPLY 1

nsingam
Employee
Employee

Hi Biksah,

You can use the Json Splitter snap. As per your example, in the Json Splitter snap for the field Json Path provide the value as $Cost_Center_Hierarchies[*], and select the Include scalar parents check box. Hope this is what you are looking for.