4 Replies Latest reply: May 26, 2017 9:27 AM by Andreas Hoehn RSS

    REST data additional field from variable

    Lukas Ignatavicius

      Hello,

       

      I have an issue with creating link between two tables. I am new to Qlick Sense and I cannot find any information on this.

       

      I have two REST endpoints one to get items list and one to get item details.

       

      GET http:/api/items

      GET http:/api/items/$(id)/details


      I am using this to get the data from the API details:

      LET NumRows=NoOfRows('items');
      FOR i=1 to $(NumRows)
      
        Let id = Peek('item_id',$(i),'items');
        timeTmp:
        SQL SELECT
            "field1",
           ....
        FROM JSON (wrap off) "root" PK "field1"
        WITH CONNECTION(Url "http:/api/items/$(id)/details");
      next;
      
      

       

      And I want each line to have $(id) value in it. How can I achieve this?

       

      I have tried (with no luck):

        timeTmp:
        SQL SELECT
            "field1",
           ....,
            '$(id)' as "item_id",
        FROM JSON (wrap off) "root" PK "field1"
        WITH CONNECTION(Url "http:/api/items/$(id)/details");