-1

I have a requirement where I need to fetch data from Qlik API in JSON format (just as we did in Power BI dataset) and parse it in CSV format.

Essentially, attached is kind of data I'm trying to extract from Qlik Engine/QRS API.

Image Excel

Anyway of achieving this requirement ?

Stefan Stoichev
  • 4,615
  • 3
  • 31
  • 51
Dipanjan Mallick
  • 1,636
  • 2
  • 8
  • 20
  • I don't know Qlik API but yout task seems to be broken in two phases. First, get the json using the `requests` library. Next parse it and use the `csv` module in the standard library in order to write the CSV. – Andrea Pollini Jul 16 '21 at 12:02
  • yeah to get json we can use requests library. but the requirement is related to extracting from Qlik API only. Though haven't worked on it but trying to investigate how to achieve this – Dipanjan Mallick Jul 16 '21 at 12:08
  • Here you find how to make a request using requests and get the json. https://stackoverflow.com/questions/6386308/http-requests-and-json-parsing-in-python#6386366 – Andrea Pollini Jul 16 '21 at 12:15
  • Thanks but this wouldn't solve my requirement entirely. – Dipanjan Mallick Jul 16 '21 at 12:48

1 Answers1

1

Communication with Qlik Engine is done via web sockets (JSON-PRC)

Please, have a look at the official documentation

In your case the workflow should be:

  • establish communication channel with the Engine
  • connect to the app that contains the data
  • contruct table object and provide the required measures/dimensions in the definition
  • get the layout of the table/object
  • extract the data from the layout (if the data is more than 10 000 data cells then you'll have to implement paging)
  • once have all the data - do whatever you want with it

There a few basic exmples how to, at least, connect with Python. For example Qlik Sense: call Qlik Sense Engine API with Python

Stefan Stoichev
  • 4,615
  • 3
  • 31
  • 51