Qlik Community

Connectivity & Data Prep

Discussion board where members can learn more about Qlik Sense Data Connectivity.

Announcements
Join us on May 23rd, Q&A with Qlik - Developer Series, Customizing Extensions: Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
teamxanalytics
Contributor II
Contributor II

How to load REST API key/value data?

Hi,

I'm trying to get data from an API to load in QlikSense (using a REST connector).

The data comes from an OpenTSDB web service and looks like this:

[

  {

    "metric": "metric1",

    "dps": {

      "1503217340": 1

      "1503217345": 1

      "1503217350": 1

    }

  },

  {

    "metric": "metric2",

    "dps": {

      "1503217350": 1

      "1503217355": 1

      "1503217350": 1

    }

]

How do I load the data such that the content of "dps" is loaded as a table?

All the Qlik examples assume the JSON data uses fixed attribute names.

I have no idea how to refer to the dps's key/values.

I was able to get this far:

RestConnectorMasterTable:

SQL SELECT

"__KEY_root",

(SELECT

    --

    -- How to access the key/value here?

    --

"__FK_dps"

FROM "dps" FK "__FK_dps")

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

Can someone please help me finish this statement?

Thanks,

Jill

1 Reply
sandeep_roy
Creator II
Creator II

Can you try to convert first into XML?