Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
markgraham123
Contributor II

Doubt regarding Join

Hi all,

I'm a QLikView learner.

I was just eager to know whether

Table:

Table1

Load * from Table1;

Join

Load * from Table2;

Join

Load * from Table3;


is same as-----------------------------------------------

Table1:

Load * from Table1;

Table2:

Load * from Table2;

Table3:

Load * from Table3;


Table4:

Load* Resident Table1;

Join

Load* Resident Table2;

Join

Load* Resident Table3;


Drop Tables Table1, Tabl2, Table3;



Tags (1)
9 Replies
MVP
MVP

Re: Doubt regarding Join

As long as Table1, Table2, Table3 don't have the same fields, so they would autoconcatenate in the second case...

And your resulting table is differently named in the two cases.

markgraham123
Contributor II

Re: Doubt regarding Join

I do have a key with same name in 3 tables which joins 3 of the tables.

MVP
MVP

Re: Doubt regarding Join

No, I was talking about autoconcatenation, QV will automatically concatenate tables when they show the same number and names of fields. This will not happen if the tables only share a subset of fields (like a single key field).

markgraham123
Contributor II

Re: Doubt regarding Join

Hi,

I'm not able to understand the response.

MVP
MVP

Re: Doubt regarding Join

Table1:

LOAD Field1,

          Field2

FROM Table1;

Table2:

LOAD Field1,

          Field2

FROM Table2;

After script execution, there will be only Table1 in your data model, because of auto-concatenating the two tables (same number of fields and fields have same name, all fields are keys).

If you want to prevent this, use NOCONCATENATE LOAD prefix:

Table1:

LOAD Field1,

          Field2

FROM Table1;

Table2:

NOCONCATENATE

LOAD Field1,

          Field2

FROM Table2;

But now the two tables are linked by two fields --> synthetic key is created.

Re: Doubt regarding Join

So I think swuehl‌ means that if the name of the fields between the three tables are exactly the same, they will auto-concatenate. These two can be safely considered equivalent:

Table:

Table1

Load * from Table1;

Join

Load * from Table2;

Join

Load * from Table3;


is same as-----------------------------------------------

Table1:

Load * from Table1;

Table2:

NoConcatenate

Load * from Table2;

Table3:

NoConcatenate

Load * from Table3;


Table4:

Load* Resident Table1;

Join

Load* Resident Table2;

Join

Load* Resident Table3;


Drop Tables Table1, Tabl2, Table3;


HTH


Best,

Sunny

markgraham123
Contributor II

Re: Doubt regarding Join

THanq swuehl

markgraham123
Contributor II

Re: Doubt regarding Join

THanq Sunny.

Re: Doubt regarding Join

No problem Mark

Glad we were able to help.

Best,

Sunny

Community Browser