Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Qlik Experts!
I have a question about load datas from difference sources.
Let's explain with an example:
first, I have this table from DataBase 1:
Table1:
LOAD
*
;
SQL SELECT
Person
FROM DataBase1;
The result is:
Person |
---|
p1 |
p2 |
p3 |
p4 |
Now, I should do the same thing with DataBase2:
Table2:
LOAD
*
;
SQL SELECT
Person
FROM DataBase2;
The result is:
Person |
---|
p1 |
p2 |
p5 |
I decide to use both the script in the same time (and I need one table), so the result is clearly this:
Table1_2:
LOAD
*
;
SQL SELECT
Person
FROM DataBase1;
Table1_2:
LOAD
*
;
SQL SELECT
Person
FROM DataBase1;
Person |
---|
p1 |
p2 |
p3 |
p4 |
p1 |
p2 |
p5 |
Now the question: could I do a " distinct" of the last table (and how)? In other words, could I reach (and how) this result?
Person |
---|
p1 |
p2 |
p3 |
p4 |
p5 |
Thanks a lot for your time!
you could look into the Exists function: The exists issue
(that article mentions the drawback with the Exists function - but also gives a usage example)
Otherwise, you could:
[Source_Data]:
LOAD *
FROM DB1;
CONCATENATE
LOAD *
FROM DB2;
[Result]:
LOAD DISTINCT
*
RESIDENT Source_Data;
Any reason you cant do the join in the database? Like:
SQL SELECT
D1.Person
FROM DataBase1 D1
LEFT JOIN Database2 D2
On D1.Person = D2.Person;
(assuming by database you mean a database table)
you could look into the Exists function: The exists issue
(that article mentions the drawback with the Exists function - but also gives a usage example)
Otherwise, you could:
[Source_Data]:
LOAD *
FROM DB1;
CONCATENATE
LOAD *
FROM DB2;
[Result]:
LOAD DISTINCT
*
RESIDENT Source_Data;
Try this, :
Table1_2:
LOAD distinct
*
;
SQL SELECT
Person
FROM DataBase1;
Table1_2:
LOAD distinct
*
;
SQL SELECT
Person
FROM DataBase1
WHERE not exists(Person);
I'm sorry, but I cannot do this: I've not been clear about this (my fault).
Thanks, these are great topics.