Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help with Script

Qlik Comrades please help. I have 4 .mdb source documents that I am using in my script. For my first sheet I am combining 2 sources to create one table and the remaining 2 sources to create a second table on my second sheet by using Left Join, no problem. For my third sheet I need to pull all four sources ( currently 2 tables) into one table.  What is the correct approach?  Everything I have tried so far has rendered incorrect results. Thanks in advance for your help!

9 Replies
Anil_Babu_Samineni

Sheet means Tab?

First tab

mdb1:

Load * From mdb1;

Left Join(mdb1)

Load * From mdb2;

Second Tab

Left Join(mdb1)

Load * From mdb3;

Third Tab

Left Keep (mdb1) // or Left Join (mdb1)

Load * From mdb4;

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
tomasz_tru
Specialist
Specialist

You usually don't have to join tables in Qlik if you have field names under control.

Can you give us sample data?

Not applicable
Author

Thank you for your response. However, I incorrectly stated my intent.

In the first TAB I need to join the first 2 sources to create one table and the next 2 sources to create a second table. This is what I did:

TAB #1

Table1:

Load

.mdb1

Left Join (Table1)

Table2:

Load

.mdb2

Table3:

Load

.mdb3

Left Join (Table3)

Table4:

Load

.mdb4

TAB#2


NewTable:

This is where I need to combine all 4 Tables (actually 2 tables at this point due to the previous joins)


Not applicable
Author

I have same field names in all for sources that I need to keep that way.

Oleg_Troyansky

Hi Angela,

it sounds to me like your different tables contain the same type of information (for example, they all contain Sales). In this case, you want to concatenate your tables rather than JOIN them:

Tab1:

LOAD * FROM ...

;

CONCATENATE (Tab1)

LOAD * FROM ...

;

Cheers,

Oleg Troyansky

Upgrade your Qlik skills with my book QlikView Your Business: An Expert Guide to Business Discovery with QlikView and Qlik Sense

Not applicable
Author

They do contain the same fields but they are from 4 different sources. If I concatenate it creates an additional row with null field values that skews my record count. Left join works correctly.

Oleg_Troyansky

Hmm, sounds very strange, you might want to double check your results.

If you have the same fields and you use LEFT JOIN, then QlikView will only load those rows where all fields already existed in the first table. Since all fields are the same, they are all used as JOIN key fields - including quantities, prices, etc... So, unless all fields are exactly the same, LEFT JOIN won't include them in the result.

Concatenation shouldn't create another row with NULL values, unless it's coming from one of the 4 tables...

best,

Oleg Troyansky

robert_mika

Could you post an example from each db?

Anil_Babu_Samineni

I don't really understand your intend here

But, For your second table you could use something like

Final:

NoConcatenate

Load * From Source1;

Load * From Source2;

Load * From Source3;

Load * From Source4;

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)