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.