Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am pulling in data from 2 rest api connections and want to union them both together in a single table.
They currently union if they are the only tables in the app when others are present they join in seperate tables :
Can anyone please advise how to union them
This is my load script
LIB CONNECT TO 'APIv1';
RestConnectorMasterTable:
SQL SELECT
"name",
"code",
"Was",
"Now",
"image"
FROM JSON (wrap off) "Clearance";
[ClearancePricing]:
LOAD [name] AS [Lipname],
Replace([code],'-','') AS [Lipcode],
[Was] AS [LipWas],
[Now] AS [LipNow],
[image] AS [Lipimage]
RESIDENT RestConnectorMasterTable;
DROP TABLE RestConnectorMasterTable;
LIB CONNECT TO 'APIv2';
RestConnectorMasterTable:
SQL SELECT
"name",
"url",
"Now",
"Was",
"image"
FROM JSON (wrap off) "selection2";
LOAD [name] AS [Lipname],
mid(image,Index(image,'/',-1)+1,len(image)-Index(image,'.',-1)-1) AS Lipcode,
[Was] AS [LipWas],
[Now] AS [LipNow],
[image] AS [Lipimage]
RESIDENT RestConnectorMasterTable;
DROP TABLE RestConnectorMasterTable;
Figured it out please ignore, just had to shift things around a little and concatenate
LIB CONNECT TO 'APIv1';
RestConnectorMasterTable:
SQL SELECT
"name",
"code",
"Was",
"Now",
"image"
FROM JSON (wrap off) "Clearance";
LIB CONNECT TO 'APIv2';
RestConnectorMasterTable1:
SQL SELECT
"name",
"url",
"Now",
"Was",
"image"
FROM JSON (wrap off) "selection2";
[Pricing]:
LOAD [name] AS [Lipname],
Replace([code],'-','') AS [Lipcode],
Replace([Was],'Original ','') AS [LipWas],
[Now] AS [LipNow],
[image] AS [Lipimage]
RESIDENT RestConnectorMasterTable;
concatenate
LOAD [name] AS [Lipname],
mid(image,Index(image,'/',-1)+1,len(image)-Index(image,'.',-1)-1) AS Lipcode,
[Was] AS [LipWas],
[Now] AS [LipNow],
[image] AS [Lipimage]
RESIDENT RestConnectorMasterTable1;
DROP TABLE RestConnectorMasterTable;
DROP TABLE RestConnectorMasterTable1;
Figured it out please ignore, just had to shift things around a little and concatenate
LIB CONNECT TO 'APIv1';
RestConnectorMasterTable:
SQL SELECT
"name",
"code",
"Was",
"Now",
"image"
FROM JSON (wrap off) "Clearance";
LIB CONNECT TO 'APIv2';
RestConnectorMasterTable1:
SQL SELECT
"name",
"url",
"Now",
"Was",
"image"
FROM JSON (wrap off) "selection2";
[Pricing]:
LOAD [name] AS [Lipname],
Replace([code],'-','') AS [Lipcode],
Replace([Was],'Original ','') AS [LipWas],
[Now] AS [LipNow],
[image] AS [Lipimage]
RESIDENT RestConnectorMasterTable;
concatenate
LOAD [name] AS [Lipname],
mid(image,Index(image,'/',-1)+1,len(image)-Index(image,'.',-1)-1) AS Lipcode,
[Was] AS [LipWas],
[Now] AS [LipNow],
[image] AS [Lipimage]
RESIDENT RestConnectorMasterTable1;
DROP TABLE RestConnectorMasterTable;
DROP TABLE RestConnectorMasterTable1;