<?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 JSON ordonate in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/JSON-ordonate/m-p/1674010#M12307</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm trying to exploit a french API to retrieve coordinate of each town.&amp;nbsp; (&lt;A href="https://api.gouv.fr/api/api-geo" target="_blank" rel="noopener"&gt;https://api.gouv.fr/api/api-geo&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;LIB CONNECT TO 'API Geo';

RestConnectorMasterTable:
SQL SELECT 
	"__KEY_root",
	(SELECT 
		"type",
		"__KEY_centre",
		"__FK_centre",
		(SELECT 
			"@Value",
			"__FK_coordinates"
		FROM "coordinates" FK "__FK_coordinates" ArrayValueAlias "@Value")
	FROM "centre" PK "__KEY_centre" FK "__FK_centre")
FROM JSON (wrap on) "root" PK "__KEY_root";

[coordinates]:
LOAD	[@Value] AS [@Value],
	[__FK_coordinates] AS [__KEY_centre]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__FK_coordinates]);


[centre]:
LOAD	[type] AS [type],
	[__KEY_centre] AS [__KEY_centre],
	[__FK_centre] AS [__KEY_root]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__FK_centre]);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Infortunatly, the coordinate data&amp;nbsp; latitude and longitude are mixted after loading into coordinate table.&lt;/P&gt;&lt;P&gt;From the API, coordinate's&amp;nbsp;data are ordonate and this order is lost after loading. I can't exploit any extra field (index) to keep my data correctly ordonate. Neither i can't use rowNo() on loading because the data isn't correctly ordonate on RestConnectorMasterTable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question is: it's possible to add an index during the JSON loading? or keep the original array from coordinate?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The resulting JSON produce by the API&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;	
Response body
Download

[
  {
    "centre": {
      "type": "Point",
      "coordinates": [
        4.926,
        46.1567
      ]
    },
    "nom": "L'Abergement-Clémenciat",
    "code": "01001"
  },&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Guerric&lt;/P&gt;</description>
    <pubDate>Tue, 11 Feb 2020 08:03:07 GMT</pubDate>
    <dc:creator>Guerric</dc:creator>
    <dc:date>2020-02-11T08:03:07Z</dc:date>
    <item>
      <title>JSON ordonate</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/JSON-ordonate/m-p/1674010#M12307</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm trying to exploit a french API to retrieve coordinate of each town.&amp;nbsp; (&lt;A href="https://api.gouv.fr/api/api-geo" target="_blank" rel="noopener"&gt;https://api.gouv.fr/api/api-geo&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;LIB CONNECT TO 'API Geo';

RestConnectorMasterTable:
SQL SELECT 
	"__KEY_root",
	(SELECT 
		"type",
		"__KEY_centre",
		"__FK_centre",
		(SELECT 
			"@Value",
			"__FK_coordinates"
		FROM "coordinates" FK "__FK_coordinates" ArrayValueAlias "@Value")
	FROM "centre" PK "__KEY_centre" FK "__FK_centre")
FROM JSON (wrap on) "root" PK "__KEY_root";

[coordinates]:
LOAD	[@Value] AS [@Value],
	[__FK_coordinates] AS [__KEY_centre]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__FK_coordinates]);


[centre]:
LOAD	[type] AS [type],
	[__KEY_centre] AS [__KEY_centre],
	[__FK_centre] AS [__KEY_root]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__FK_centre]);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Infortunatly, the coordinate data&amp;nbsp; latitude and longitude are mixted after loading into coordinate table.&lt;/P&gt;&lt;P&gt;From the API, coordinate's&amp;nbsp;data are ordonate and this order is lost after loading. I can't exploit any extra field (index) to keep my data correctly ordonate. Neither i can't use rowNo() on loading because the data isn't correctly ordonate on RestConnectorMasterTable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question is: it's possible to add an index during the JSON loading? or keep the original array from coordinate?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The resulting JSON produce by the API&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;	
Response body
Download

[
  {
    "centre": {
      "type": "Point",
      "coordinates": [
        4.926,
        46.1567
      ]
    },
    "nom": "L'Abergement-Clémenciat",
    "code": "01001"
  },&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Guerric&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2020 08:03:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/JSON-ordonate/m-p/1674010#M12307</guid>
      <dc:creator>Guerric</dc:creator>
      <dc:date>2020-02-11T08:03:07Z</dc:date>
    </item>
  </channel>
</rss>

