Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
How can we compare two same fields across table 1 and table 2 and load the same in Qlikview like below script?
EG.,
Table1:
LOAD *;
SELECT A, B;
FROM Table1
WHERE Table1.A = Table2. A;
Thanks,
Swathi
In a query like the one you have written, to access both tables you must at first join them:
SELECT A, B;
FROM Table1 join table2 on field1 = field2
WHERE Table1.A = Table2. A;
Hope it helps
Hi Swathi,
Try like this
Data:
SELECT
KeyField,
'
'
'
FROM Table1;
INNER JOIN (Data)
SELECT
KeyField,
'
'
'
FROM Table2;
OR simply
Table1:
LOAD *;
SELECT Table1. A, B
FROM Table1, Table2
WHERE Table1.A = Table2. A;
Regards,
jagan.
You can simply try with
Table1:
LOAD *;
SELECT A, B;
FROM Table1;
Inner Join(Table1)
Table2:
LOAD *;
SELECT A;
FROM Table2;
Thanks All..
But requirement is instead of loading all the raw tables into a QVD then to join the tables on top of it.
Want to restrict the load in first level ie., i want to load the A field only for "WHERE Table1.A = Table2. A".
I understand but table2 is unknown until you load it ....
try to:
1. load table2
2. load table 1 with "where exists (A)" clause;
3. drop table2
regards
Darek
Yes Table2 is unknown till we load it.. So only way to do is
1. load all the tables separately.
2. Do the Joins on top of it. ?
or any other options?
try this script:
tab1:
LOAD * INLINE [
A
1
2
3
5
];
NoConcatenate tab2:
load * Where Exists(A);
load * inline
[
A
4
5
];
drop Table tab1;
If you have qvd then load them separately
Table1
noconcatenate
load * from qvd1;
join (or left join)
Table2
noconcatenate
load * from qvd2;
Hope it helps