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

Extract Json file

Hi team,

I use tWriteJsonFile with a group element (VervotechId) as mentioned in the screenshot

0695b00000QFgOiAAL.png.

in my input i have 2 VervotechId so i want to separate the json files for each VervotechId.

I try to use tFileOutputRaw but it does not work for me.

0695b00000QFgRDAA1.png

Any help please !

Labels (4)
4 Replies
Anonymous
Not applicable

If you remove your tFileOutputRaw and add a tLogRow in its place, do you see the JSON Strings output as separate Strings in the way you want? If so, you are half way there. The tFileOutputRaw will be initialised once for the whole Subjob. It won't create a new file for each row or by group. So, to get round this you can use a tFlowToIterate followed by a tIterateToFlow. This is demonstrated pretty well in this video....

 

https://www.youtube.com/watch?v=WpEH7hIAB4k

 

Once that is done, your tFileOutput will be initialised for each iteration. So you can have a new file created (or appended to) for each row of data.

hiba1
Contributor
Contributor
Author

Hi @Richard Hall​  ,

thank you for your reply,

I add the tlogRow but I can't get the JSON Strings output as separate Strings however it displays 2 rows.

0695b00000QFuaEAAT.png

Anonymous
Not applicable

You appear to have 2 outputs there. I can't see the complete JSON for the first String, but it looks like you have many sections in an Object array. Using the method I mentioned with the tFlowToIterate and tIterateToFlow, that would lead to 2 files being created. Is that not correct?

hiba1
Contributor
Contributor
Author

unfortunately , no .

I get this error

0695b00000QFy13AAD.png0695b00000QFy0oAAD.png