Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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");
I have managed to do it by loading inside cycle:
LET NumRows=NoOfRows('issue')-1;
FOR i=0 to $(NumRows)
Let issue_id = Peek('issueID',$(i),'issue');
RestConnectorMasterTable:
SQL SELECT
"id",
.....
"__KEY_root"
FROM JSON (wrap off) "root" PK "__KEY_root"
WITH CONNECTION(Url "http:/api/items/$(issue_id)/timetracking/workitem");
[work_items]:
LOAD [id] AS [work_item_id],
.......
[__KEY_root] AS [work_item_KEY],
'$(issue_id)' as [issue_id]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__KEY_root]);
DROP TABLE RestConnectorMasterTable;
next;
Hello,
Have you found a solution?
I am stuck in a very similar situation.
I have managed to do it by loading inside cycle:
LET NumRows=NoOfRows('issue')-1;
FOR i=0 to $(NumRows)
Let issue_id = Peek('issueID',$(i),'issue');
RestConnectorMasterTable:
SQL SELECT
"id",
.....
"__KEY_root"
FROM JSON (wrap off) "root" PK "__KEY_root"
WITH CONNECTION(Url "http:/api/items/$(issue_id)/timetracking/workitem");
[work_items]:
LOAD [id] AS [work_item_id],
.......
[__KEY_root] AS [work_item_KEY],
'$(issue_id)' as [issue_id]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__KEY_root]);
DROP TABLE RestConnectorMasterTable;
next;
Hi,
Yes I do. I have provided example as correct answer. I hope it will solve your issue.
Thank you very much!
I had a similar situation.
Thank you so much for sharing your solution.