Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Script for ensuring Inner join between Tables

Hi All,

I have following tables:

USER

Comments Posted in 4 WKS

Comments Posted in 26 WKS

Comments Posted in 52 WKS

AU_ID is the key

What would be the script to ensure that tables have inner join between them?

Thanks,

TA

9 Replies
whiteline
Master II
Master II

Load your USER table (and name it typing USER: before LOAD statement).

Then  before each next LOAD statement type: inner join(USER)

Not applicable
Author

Hi Whiteline,

I have done this but it has created a problems

Filelds from the other tables are also included in the USER table now. Means - No separate tables for

Comments Posted in 4 WKS

Comments Posted in 26 WKS

Comments Posted in 52 WKS

exists any more.   

Do you know why it not showing seprate tables any more?

Anonymous
Not applicable
Author

Replace join with keep:

INNER KEEP (User) LOAD

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

' Join'  will join the tables the way you see into one table. This is just like what you get with an sql query with joins: one tabular set of results.

But what are the problems with having the tables joined to one in Qlikview? Do you really need separate tables? If so can you explain why?


talk is cheap, supply exceeds demand
Not applicable
Author

Gwassenaar,

Well, As long as I am getting the correct results I dont have any problem, But I was just curious why it is showing al lthe fields in one table. Thats it.

Doesn't QV automatically creates inner join based on the same fields names?

Thanks,

Michael,

What is the difference between Join and Keep?

Thanks,

Anonymous
Not applicable
Author

It is what it says 🙂

JOIN joins the tables together

KEEP keeps them separate (still applying inner or left or right...)

Not applicable
Author

Thats right, but when I want to inner join and keep them seperate then what should is write?

Does "Inner keep (USER)" means that it will create an innerjoin and keeps the tables seperate or

can join and keep can come together?

whiteline
Master II
Master II

tahirghalib,

You are right it means the same but keeps the tables separate. I thought you wanted to join them completely 🙂 Use keep instead.

Look at help, the word 'inner', there are examples.

Anonymous
Not applicable
Author

You can't - and don't need to - use both join and keep together.  What you describe is done by keep (see help).  Give it a try, and see the result.