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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tFileList to tFileInputJSON problem : Fields are null

Hi ,

 

Here is my job :

 

0683p000009M9lc.png

 

 

i have three json files ( file1.json , file2.json , file3.json ) i used tiflelist to get them but the problem is that in my output json file all fields are null except fields from the last file ( file3.json )

 

and here is my json file output :

 

 

0683p000009M9k7.png

 

 

Can any one help me solve this problem ?

 

Thank you 

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

The file structure are different, you can't use one tFileInputJson to read data from these 3 files, use 3 tFileInputJson components for each file, and merge all columns together on tMap, eg:
tFileinputJson1--
tFileinputJson2--tMap---tFileOutputJson
tFileinputJson3---

Regards
Shong

View solution in original post

8 Replies
Anonymous
Not applicable
Author

For testing, put only one file in the folder and make sure the job can extract data from all fields. Can you show us an example of your input file? and the basic settings of tFileInputJson?

Regards
Shong
Anonymous
Not applicable
Author

Hello 
I put one file in the folder like you said and it works 
this is my input json file :


 

and this is my output json file : 



and this are my basic settings of tFileInputJson : 



 

 

So what could be the problem ? 

Thank you 

Anonymous
Not applicable
Author

Hi
Where are the columns such as _id, _class come from? The Json output looks strange, all of the files has the structure? Do you want to merge the data from the three files and then create only one Json file? Or you want to 3 different Json files for each input file?

Regards
Shong
Anonymous
Not applicable
Author

Hi ,

I have 3 json files 

here is the frst json file (file1.json) : 



here is the second json file (file2.json) :



 

here is the third json file (file3.json) :

 



here is the output file : 

 

 


I get only the values of the last input file (file3.json)

The idea is to build a single json file from these three files and save it in mongodb I just wanted to test the possibility of building a json file from three files

 

Can you help me with this ? 

Thank you

Anonymous
Not applicable
Author

The file structure are different, you can't use one tFileInputJson to read data from these 3 files, use 3 tFileInputJson components for each file, and merge all columns together on tMap, eg:
tFileinputJson1--
tFileinputJson2--tMap---tFileOutputJson
tFileinputJson3---

Regards
Shong
Anonymous
Not applicable
Author

Hi , 

Thank you it works now but the structure of the output file is this : 

 

 

but i want to get this structure : 


 

 

how i can get the second structure ? 


Thank you for help 

Anonymous
Not applicable
Author

Use tWriteJsonField to write a json string and check 'remove root node' box, this box does not exist on tFileOutputJson.

Regards
Shong
Anonymous
Not applicable
Author

Hi 

Thank you for your help it works