Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

jelindbe
New Contributor II

JSON parsing problem

I try to parse JSON code formatted like this:

[ { "nsrId": "1020895", "koordinatLatLng": [ 59.7626, 10.03038 ], "navn": "Stenseth barnehage", "fylkesnummer": "06", "kommunenummer": "0625", "alder": "1 - 5", "eierform": "Privat", "antallBarn": 77 },.........

My Rest connection generates this code:

----------------------

RestConnectorMasterTable:

SQL SELECT

"nsrId",

"navn",

"fylkesnummer",

"kommunenummer",

"alder",

"eierform",

"antallBarn",

"__KEY_root",

(SELECT

"@Value",

"__FK_koordinatLatLng"

FROM "koordinatLatLng" FK "__FK_koordinatLatLng" ArrayValueAlias "@Value")

FROM JSON (wrap on) "root" PK "__KEY_root";

[koordinatLatLng]:

LOAD [@Value] AS [Lat],

[__FK_koordinatLatLng] AS [__KEY_root]

RESIDENT RestConnectorMasterTable

WHERE NOT IsNull([__FK_koordinatLatLng]);

[root]:

LOAD [nsrId] AS [nsrId],

[navn] AS [Barnehage],

[kommunenummer] AS [Kommunenummer],

[alder] AS [Aldersspenn],

[eierform] AS [Eierform],

[antallBarn] AS [Antall barn],

[__KEY_root] AS [__KEY_root]

RESIDENT RestConnectorMasterTable

WHERE NOT IsNull([__KEY_root]);

DROP TABLE RestConnectorMasterTable;

------------------------------

My problem is that latitude/longitude ("koordinatLatLng": [ 59.7626, 10.03038 ]) is read like a sum. I need to read latitude and longitude as separate entities but I cannot figure out how to change the code to accomplish that.
Tags (1)
2 Replies

Re: JSON parsing problem

I think this will be helpful for you: Re: Parsing JSON data with loop

- Marcus

jelindbe
New Contributor II

Re: JSON parsing problem

Thank you for your contribution Marcus. However, I am not a developer and could not figure out any solution. I guess I must wait until our overloaded developer team can help me.