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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
NMANJESHWAR
Contributor
Contributor

JSON parsing multiple values

Hi, I am trying to parse below json, which has multple nested lists (input & output), how do I parse it ?

{

"data": {

"Days": [0, 1, 2, 3, 4, 5, 6],

"amount": [0, 0, 0, 234, 0, 0, 0]

}

}

Labels (3)
1 Reply
anselmopeixoto
Partner - Creator III
Partner - Creator III

Hi @Niranjan MANJESHWAR​ 

 

To create an array element you'll need to "add an attribute named class and set its static value to array, and then add a sub-element named element set as a loop" (reference), then you map the source column to that element.

 

However, tWriteJSONField allows setting only one loop per tree. If you have access to Talend Data Mapper, you could use it to overcome this limitation.

 

Now if you're using TOS I'd suggest that, depending on your data volume, you create multiple arrays and store them in memory and then concatenate them to construct the full json structure.