Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
amien
Specialist
Specialist

Can Qlik Sense read .JSON files?

I know there is a REST Connector. But i need to enter a URL there. With HTTP or HTTPS protocol. Is it possible to link to a JSON folder or file?

Thanks in advanced

7 Replies
quriouss
Creator III
Creator III

Yes, absolutely it can (having just done it) but depending on your data structure it might be best not to as it can still involve a lot of editing.

If your JSON data is in a file you should be able to just load it as any other flat table (csv, etc.) but you might have to split it out into sub-tables by hand.

Worst case is probably having to load the JSON into something like MongoDB then load into Qlik from there (that's where I started!!!)

amien
Specialist
Specialist
Author

Thanks for your reply.

What kind of data source do i need to add? When i add a folder, i dont see .Json in the files of files. Or do i need to add a Rest Connector? If so, what do i fill in in the URL box?

jochem_zw
Partner Ambassador
Partner Ambassador

‌you have to use The General web connector.

Qlik General Web Connector ‒ Qlik Connectors

quriouss
Creator III
Creator III

I think that will only connect to web sources (http / https) and the poster is asking about reading from a file.

(I may have also mislead the original poster - I was loading from a QVD, so the JSON transformation had already been done by the REST connector).

Have a look here, which seems like it might help - loop through each row in your file and import the fields one at a time (probably only works if the JSON is un-nested).

Alternatively, just change the filename to *.csv and go to the file-connector and see what happens.

And, another option is to import into Excel then save the table from there and reload into Qlik.  This will work as a one-off, not so sure it's a long-term solution.

Connect to a JSON file - Excel

(My preferred option would be something like MongoDB though - all the work is done automagically then).

stevenkoppens
Partner - Contributor III
Partner - Contributor III

If you want a easy scripting solution, you could use Python to convert to CSV:

import pandas

df = pandas.read_json("example.json")

df.to_csv('example.csv')

Suus
Partner - Contributor III
Partner - Contributor III

You can read json files directly from a file directory.

In QlikView this option was available from table load. In Sense it dissapeared.

The script still works though 😉

Here's an example

YSIS_BarthelScore:

    LOAD

    PatientID

      , Barthelscore

      , Datum_van_afname

      , MomentAfname

    from [lib://YSIS/barthelscore.json] (json, codepage is 1252, embedded labels);

  • If you dont know the column names first perform a select*
  • Create a library/connection to your directory
ansahmad179
Contributor II
Contributor II

Hi there, I have to load data from Linkedin and the response that I get is in the format of JSON. So when I tried to use rest connector it gave me an error and it turns out that error is because of url encoded format which Qlik Sense rest connector doesn't support rn. As a alternative, I wrote a Javascript snippet which extracts data from Linkedin and loads to MongoDB and that Linkedin JSON objects contains nested arrays/associative arrays, so when I connected Linkedin with MongoDB connector I get all fields name but data inside the nested arrays isn't showing up in Qlik Sense. I have attached the images. Can you please elaborate on how you imported the data from MongoDB? or your JSON contained simple objects?

MongoDB GUI:

mongodb.PNG

Qlik Sense: 

 

Qlik SenseQlik Sense