Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
Below is a simplified version of my code. I am trying to load a field f1 from table1 and table2. I want to then concatenate the results from table2 to the results from table1. Then I want to add the field f2 to the combined table. The code below only adds the field f2 to Table1. f2 is not added to the results returned from Table2. Any help would be much appreciated. Thank you.
load
f1+1 as f2
;
SQL
SELECT
f1
FROM Table1
CONCATENATE
SELECT
f1
FROM Table2
I think you will have to resident load to do any manipulation to the concatenated tables. Preceding load won't work here because the concatenation is done after the preceding load is completed here:
Table1:
SQL
SELECT
f1
FROM Table1;
Concatenat (Table1)
SELECT
f1
FROM Table2;
FinalTable:
LOAD f1 + 1 as f2,
f1
Resident Table1;
DROP Table Table1;
I think you will have to resident load to do any manipulation to the concatenated tables. Preceding load won't work here because the concatenation is done after the preceding load is completed here:
Table1:
SQL
SELECT
f1
FROM Table1;
Concatenat (Table1)
SELECT
f1
FROM Table2;
FinalTable:
LOAD f1 + 1 as f2,
f1
Resident Table1;
DROP Table Table1;
Or:
Table:
load
f1,
f1+1 as f2
;
SQL
SELECT
f1
FROM Table1
CONCATENATE
load
f1,
f1+1 as f2
;
SELECT
f1
FROM Table2
Temp_Tbl:
LOAD
f1;
SQL SELECT
f1
FROM Table1;
CONCATENATE (Temp_Tbl)
LOAD
f1
FROM Table2;
Table:
LOAD
f1+1 as f2,
f1
Resident Temp_Tbl;
Drop Table Temp_Tbl;
Maybe this works?
LOAD f1+1 AS f2 ; // Preceding LOAD
SQL SELECT f1 FROM Table1
UNION
SELECT f1 FROM Table2 ;
UNION is the SQL keywork to perform a SQL concatenate. AFAIK CONCATENATE is a QlikView keyword.
Best,
Peter