Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to set multiple loop elements in tWriteJSONField

I am not able to set multiple as Loop Elements as i am getting multiple values from database in same same column for one particular id, so i want to generate json file and then want to insert to Mongodb.

Labels (3)
4 Replies
Anonymous
Not applicable
Author

Hi,

 

   Could you please provide 5 or 6 sample records and its expected output in a sample file? Please also include your current output along with overall job and component screen shots. This will give us idea about how to analyse in detail.

 

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 🙂

Anonymous
Not applicable
Author

The input table :

 

Produit

Marque

Client

Année

A

Toyota

1

2018

B

Toyota

2

2019

C

Renault

3

2017

D

Toyota

4

2017

 

The json file to generate: 

{

  ‘Datas’ : [

             {Marque : ‘Toyota’, Produits : [A, B, D], Clients : [1,2,4], Année : [2017,2018,2019]},

             {Marque : ‘Renault, Produits : [C], Clients : [3], Année : [2017]}

  ]

}

 

The components of the job: 0683p000009M4rf.png

 

I have used a tSortRow in order to sort the data on the field Marque and then used the tWriteJsonField in order to generate the json file, the problem is that i can't use multiple loop elements in order to group the data into different arrays.

SUDHAKAR2
Contributor
Contributor

Hi,

 

did you got the solution for this?

if yes,can you share the sample job for this