Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
MMejía
Contributor
Contributor

Data mapper array JSON output from delimited txt file

I have a delimited file with rows ans sub-rows like:

Parent1Name, Parent1Age, Parent1Location // row

Child1AName, Child1AAge, Child1AHobby , Child1APet // sub-row

Parent2Name, Parent2Age, Parent2Location // row

Child1Name, Child1Age, Child1Hobby , Child1Pet // sub-row

Child2Name, Child2Age, Child2Hobby , Child2Pet // sub-row

And I want a Json file like:

 

{ childs:[

{

"ParentName": Parent1Name,

"ChildName": Child1AName,

"ChildAge": Child1AAge

},{

"ParentName": Parent2Name,

"ChildName" : Child1Name,

"ChildAge": Child1Age

},

{

"ParentName": Parent2Name,

"ChildName": Child2Name,

"ChildAge": Child2Age

}

    ]

}

I'm using Data Maper and I already set the structure to get the info from the dilimited file, but when I try to creat the estructure for JSON file I'm having issues with loops getting a wrong JSON like:

{ childs:[

{

"ParentName": Parent1Name,

"ChildName": Child1AName,

"ChildAge": Child1AAge,

}]}

{ childs:[

{

"ParentName": Parent2Name,

"ChildName": Child1Name,

"ChildAge": Child1Age

},

{

"ParentName": Parent2Name,

"ChildName" : Child2Name,

"ChildAge" : Child2Age

}

]

}

How should I define the output structure or the map in this case ? 

I attach my map example

Labels (3)
0 Replies