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: 
aviralagl
Contributor
Contributor

Make a JSON file

Hi,

My database has the following format of data:

 

      id      |     locale     |      link                   |     attr1      |    attr2      |      attr3

100               en               abc@xyz.com           aaa            lmn             pqr

100               de               abc@xyz.de             aaa            lmn             pqr

100               nl                abc@xyz.nl               aaa            lmn             pqr

100               fr                abc@xyz.fr                aaa            lmn             pqr

100               it                abc@xyz.it                 aaa            lmn             pqr

 

I would like to create a JSON file like the following:

 

[ {

"id" : "100"

"attr1" : aaa

"attr2" : lmn

"attr3" : pqr
"attrRoot" : [ {

 "locale" : "en"

 "link" : "abc@xyz.com"

},

{

 "locale" : "de"

 "link" : "abc@xyz.de"

},

{

 "locale" : "nl"

 "link" : "abc@xyz.nl"

},

{

 "locale" : "fr"

 "link" : "abc@xyz.fr"

},

{

 "locale" : "it"

 "link" : "abc@xyz.it"

}]

}]

I am able to achieve the format and the data correctly, but since I am iterating the rows, I get the same data (as shown above) 5 times, for every row corresponding to the "id".

Labels (4)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi,

 

   Since you are using a custom component, I would recommend to contact the corresponding Talend community member who has developed this component.

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

View solution in original post

7 Replies
Anonymous
Not applicable

Hi,

 

   I am getting an invalid JSON when I am trying to validate it. Could you please share the JSON which pass the JSON validation process?

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

aviralagl
Contributor
Contributor
Author

Sure, here it is:
Also attached an image

 


[
{
"id":"100",
"attr1":"aaa",
"attr2":"lmn",
"attr3":"pqr",
"attrRoot":[
{
"locale":"en",
"link":"abc@xyz.com"
},
{
"locale":"de",
"link":"abc@xyz.de"
},
{
"locale":"nl",
"link":"abc@xyz.nl"
},
{
"locale":"fr",
"link":"abc@xyz.fr"
},
{
"locale":"it",
"link":"abc@xyz.it"
}
]
}
]
0683p000009M5e3.png

 

aviralagl
Contributor
Contributor
Author

I also forgot to mention - I am trying to achieve the result using tJSONDoc custom components

Anonymous
Not applicable

Hi,

 

   Since you are using a custom component, I would recommend to contact the corresponding Talend community member who has developed this component.

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

aviralagl
Contributor
Contributor
Author

@llicould you assist?

Anonymous
Not applicable

Yes I can. Send me your desired json and which sources you have (e.g. some csv example files) and I will provide an example job.

jan.lolling@gmail.com

aviralagl
Contributor
Contributor
Author

Thanks for the quick response, I just send them to you as a message. Please check.