<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Help with loaded JSON data in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-with-loaded-JSON-data/m-p/1526529#M1230149</link>
    <description>&lt;P&gt;Yes - sorry if this is really obvious, but I'm not finding the link between the "columns" and the data in the "rows".&lt;/P&gt;&lt;P&gt;In the example below, how can I tell that the ID is 8?&amp;nbsp; Do I need to modify the select statement to produce the necessary foreign key?&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="column names2.PNG" style="width: 529px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/3078iAA83AE0F1A049352/image-size/large?v=v2&amp;amp;px=999" role="button" title="column names2.PNG" alt="column names2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;SQL SELECT 
	"__KEY_root",
	(SELECT 
		"tableName",
		"count",
		"__KEY_items",
		"__FK_items",
		(SELECT 
			"@Value",
			"__FK_columnNames"
		FROM "columnNames" FK "__FK_columnNames" ArrayValueAlias "@Value"),
		(SELECT 
			"__KEY_rows",
			"__FK_rows",
			(SELECT 
				"@Value" AS "@Value_u0",
				"__FK_rows_u0"
			FROM "rows" FK "__FK_rows_u0" ArrayValueAlias "@Value_u0")
		FROM "rows" PK "__KEY_rows" FK "__FK_rows")
	FROM "items" PK "__KEY_items" FK "__FK_items"),
	(SELECT 
		"rel",
		"href",
		"mediaType",
		"__FK_links"
	FROM "links" FK "__FK_links")
FROM JSON (wrap on) "root" PK "__KEY_root";

[columnNames]:
LOAD	[@Value],
	[__FK_columnNames] AS [__KEY_items]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__FK_columnNames]);


[rows]:
LOAD	[@Value_u0],
	[__FK_rows_u0] AS [__KEY_rows]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__FK_rows_u0]);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 04 Jan 2019 16:59:59 GMT</pubDate>
    <dc:creator>msime</dc:creator>
    <dc:date>2019-01-04T16:59:59Z</dc:date>
    <item>
      <title>Help with loaded JSON data</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-loaded-JSON-data/m-p/1523516#M1230139</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm struggling to find any help with loading JSON data that is returned from an API.&amp;nbsp; It's generating a table for the "column names" array but it seems to assign the same&amp;nbsp;key to each column&amp;nbsp;- is there some documentation that would help me understand this?&lt;/P&gt;&lt;P&gt;Sample data:&lt;/P&gt;&lt;PRE&gt;{
    "items": [
        {
            "tableName": "incidents",
            "count": 4,
            "columnNames": [
                "id",
                "subject",
                "referenceNumber"
            ],
            "rows": [&lt;/PRE&gt;&lt;P&gt;Generated Select script:&lt;/P&gt;&lt;PRE&gt;RestConnectorMasterTable:
SQL SELECT 
	"__KEY_root",
	(SELECT 
		"tableName",
		"count",
		"__KEY_items",
		"__FK_items",
		(SELECT 
			"@Value",
			"__FK_columnNames"
		FROM "columnNames" FK "__FK_columnNames" ArrayValueAlias "@Value"),&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="columnNames.PNG" style="width: 204px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/2548iD7689DD2B3705C29/image-size/large?v=v2&amp;amp;px=999" role="button" title="columnNames.PNG" alt="columnNames.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jan 2026 21:26:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-loaded-JSON-data/m-p/1523516#M1230139</guid>
      <dc:creator>msime</dc:creator>
      <dc:date>2026-01-26T21:26:37Z</dc:date>
    </item>
    <item>
      <title>Re: Help with loaded JSON data</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-loaded-JSON-data/m-p/1523546#M1230143</link>
      <description>&lt;P&gt;The json data is hierarchical. That hierarchy has to be translated to tables at each level of the hierarchy. The __Key* and __FK* fields are used to link those tables to each other so each child table is correctly linked to its parent table.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Dec 2018 17:40:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-loaded-JSON-data/m-p/1523546#M1230143</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2018-12-21T17:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: Help with loaded JSON data</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-loaded-JSON-data/m-p/1525046#M1230145</link>
      <description>Hi Gysbert,&lt;BR /&gt;can you please write some sample code for better understanding of your answer if it possible means?&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
      <pubDate>Mon, 31 Dec 2018 07:02:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-loaded-JSON-data/m-p/1525046#M1230145</guid>
      <dc:creator>Ajeeth11</dc:creator>
      <dc:date>2018-12-31T07:02:06Z</dc:date>
    </item>
    <item>
      <title>Re: Help with loaded JSON data</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-loaded-JSON-data/m-p/1526429#M1230147</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/18624"&gt;@Gysbert_Wassenaar&lt;/a&gt;&amp;nbsp;I think&amp;nbsp;I'm OK with the idea of parent-child relationships using foreign keys, but&amp;nbsp;can you explain why the primary key is the same for each of the different "columns" in my example screenshot?&amp;nbsp; Or can you point me to some documentation that will help me understand?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2019 14:14:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-loaded-JSON-data/m-p/1526429#M1230147</guid>
      <dc:creator>msime</dc:creator>
      <dc:date>2019-01-04T14:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: Help with loaded JSON data</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-loaded-JSON-data/m-p/1526517#M1230148</link>
      <description>&lt;P&gt;The different 'columns' are field values in the same field. All three records are child records of the same parent. So they all get the same key value.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2019 16:49:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-loaded-JSON-data/m-p/1526517#M1230148</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2019-01-04T16:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: Help with loaded JSON data</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-loaded-JSON-data/m-p/1526529#M1230149</link>
      <description>&lt;P&gt;Yes - sorry if this is really obvious, but I'm not finding the link between the "columns" and the data in the "rows".&lt;/P&gt;&lt;P&gt;In the example below, how can I tell that the ID is 8?&amp;nbsp; Do I need to modify the select statement to produce the necessary foreign key?&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="column names2.PNG" style="width: 529px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/3078iAA83AE0F1A049352/image-size/large?v=v2&amp;amp;px=999" role="button" title="column names2.PNG" alt="column names2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;SQL SELECT 
	"__KEY_root",
	(SELECT 
		"tableName",
		"count",
		"__KEY_items",
		"__FK_items",
		(SELECT 
			"@Value",
			"__FK_columnNames"
		FROM "columnNames" FK "__FK_columnNames" ArrayValueAlias "@Value"),
		(SELECT 
			"__KEY_rows",
			"__FK_rows",
			(SELECT 
				"@Value" AS "@Value_u0",
				"__FK_rows_u0"
			FROM "rows" FK "__FK_rows_u0" ArrayValueAlias "@Value_u0")
		FROM "rows" PK "__KEY_rows" FK "__FK_rows")
	FROM "items" PK "__KEY_items" FK "__FK_items"),
	(SELECT 
		"rel",
		"href",
		"mediaType",
		"__FK_links"
	FROM "links" FK "__FK_links")
FROM JSON (wrap on) "root" PK "__KEY_root";

[columnNames]:
LOAD	[@Value],
	[__FK_columnNames] AS [__KEY_items]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__FK_columnNames]);


[rows]:
LOAD	[@Value_u0],
	[__FK_rows_u0] AS [__KEY_rows]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__FK_rows_u0]);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2019 16:59:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-loaded-JSON-data/m-p/1526529#M1230149</guid>
      <dc:creator>msime</dc:creator>
      <dc:date>2019-01-04T16:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: Help with loaded JSON data</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-loaded-JSON-data/m-p/1548858#M1230150</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Did you manage to solve this? I got the same issue and I’m far from a JSON pro.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;James&lt;/P&gt;</description>
      <pubDate>Mon, 25 Feb 2019 18:14:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-loaded-JSON-data/m-p/1548858#M1230150</guid>
      <dc:creator>james_butler</dc:creator>
      <dc:date>2019-02-25T18:14:58Z</dc:date>
    </item>
    <item>
      <title>Re: Help with loaded JSON data</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-loaded-JSON-data/m-p/1549741#M1230151</link>
      <description>&lt;P&gt;Unfortunately not. I've got as far as adding a column index to the columnNames and rows tables but I can't see how to join them together and organise the results. Here's how I added indexes:&lt;/P&gt;&lt;PRE&gt;[columnNames]:
LOAD RowNo( )-1 AS ColumnIndex,
	[@Value],
	[__FK_columnNames] AS [__KEY_items]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__FK_columnNames]);&lt;BR /&gt;&lt;BR /&gt;[rows]:&lt;BR /&gt;LOAD Mod(RowNo( )-1,14) AS ColumnIndex,&lt;BR /&gt;[@Value_u0],&lt;BR /&gt;[__FK_rows_u0] AS [__KEY_rows]&lt;BR /&gt;RESIDENT RestConnectorMasterTable&lt;BR /&gt;WHERE NOT IsNull([__FK_rows_u0]);&lt;/PRE&gt;&lt;P&gt;Note that I've got 14 columns in my source data, and I've had to hard-code that number in the script&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2019 10:32:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-loaded-JSON-data/m-p/1549741#M1230151</guid>
      <dc:creator>msime</dc:creator>
      <dc:date>2019-02-27T10:32:19Z</dc:date>
    </item>
    <item>
      <title>Re: Help with loaded JSON data</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-loaded-JSON-data/m-p/1549777#M1230152</link>
      <description>&lt;P&gt;Thanks for letting me know.&lt;/P&gt;&lt;P&gt;If I find anything useful I'll let you know.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2019 11:37:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-loaded-JSON-data/m-p/1549777#M1230152</guid>
      <dc:creator>james_butler</dc:creator>
      <dc:date>2019-02-27T11:37:06Z</dc:date>
    </item>
  </channel>
</rss>

