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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Spool a JSON file into a table

Hi all,

 

i have the next JSON file:

 

{
"store":	[
				{
					"name": "Sunshine Department Store",
					"address": "Wangfujing Street",
					"goods":	[
									{
										"book":	[
													{
														"category": "Reference",
														"title": "Sayings of the Century",
														"author": "Nigel Rees",
														"price": 8.88
													},
													{
														"category": "Fiction",
														"title": "Sword of Honour",
														"author": "Evelyn Waugh",
														"price": 12.66
													}
												]
									},
									{
										"bicycle":	[
														{
															"type": "GIANT OCR2600",
															"color": "White",
															"price": 276
														}
													]
									}
								]
				}			
			]
}

I would like to have the next table:

 

StoreName StoreAddress Good_Type Category Title Author Price Type Color
Sunshine Department Store Wangfujing Street Book Reference Sayings of the Century Nigel Rees 8.88 NULL NULL
Sunshine Department Store Wangfujing Street Book Fiction Sword of Honour Evelyn Waugh 12.66 NULL NULL
Sunshine Department Store Wangfujing Street Bicycle NULL NULL NULL 276 GIANT OCR2600 White

 

Is this possible? I was trying a lot but i cannot figured it out!

 

Thanks in advance!

 

Labels (3)
1 Reply
Anonymous
Not applicable
Author

Hi
There are two loop elements in this json file, using two tFileInputJson components to read each loop element separately, one for Book node and another for bicycle node, and then do an inner join on tMap to merge the two flow on based on field Stored Name, the job design looks like:
tFileInputJson--main---tMap--->
|lookup
tFileInputJson

Regards
Shong