
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Parsing JSON in QlikSense?
Hi everyone
Let's say I have a json string in a QlikSense script, like:
let x = '{"name":"foo", "surname":"bar"}';
Can I read a specific value from it, like for example the "name" value, without having to manually manipulate the string? In other words, is there a JSON parser in QlikSense?
- « Previous Replies
-
- 1
- 2
- Next Replies »

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There is a JSON parser in Qlik Sense although it hasn't been documented. Maybe that is because it only handles "flat" JSON files and not nested structures - I don't know.
It can not be invoked on variables but it can read JSON from files.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
An example with your specific JSON in a file called test.json would look like this:
LOAD
name, surname
FROM [lib://DATA/test.json] (json)
;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Unfortunately, reading nested structures is what I need...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is also possible to load from an INLINE table like this:
SOMEJSON:
LOAD * INLINE [
json_field
{"name":"foo", "surname":"bar"}
{"name":"barry", "surname":"fool"}
{"name":"fu", "surname":"bal"}
] (txt,delimiter is \t);
PARSED_JSON:
LOAD
name,
surname
FROM_FIELD
( SOMEJSON,json_field ) (json);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well then you will have to resort to much more load script scripting... It can become pretty complicated if you want want to be able any type of nested nested structure. But if it is a predefined and well-defined static structure with very few levels it would absolutely be feasible.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How did you find out about this feature?
Cheers,
Rick

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I get the following error when I use the From_Field function:
This is my code:
Any help is appreciated!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Petter,
Do you have any solution data load "Qliksense "read the SQL table having couple of fields having various JSON format values ,what is appropriate way to LOAD in model.
Kindly suggest if you aware
Thanks
Harshal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I got the same error, did you find any solution for this?

- « Previous Replies
-
- 1
- 2
- Next Replies »