Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
remo0017
Contributor II
Contributor II

Join issue on multiple tables

Dear Friends,

I have a situation like I have to use a where condition on Table1 & Table2 which doesn't have anything in common, but are related with each other through the 3rd table called Table3.

LOAD A1,A2,A3;
SQL
SELECT A1, A2,A3
from Table1;

LOAD B1,B2;
SQL
SELECT B1, B2 from Table2;

aaa:
LOAD c1,c2,c3,c4;

SQL select c1,c2,c3,c4 from Table3;

outer join (aaa)

LOAD c,d;
SQL select c,d from Table4;


Table3 is joined with Table1, Table2 by c1,c2, but Table1 & Table2 doesn't have anything to join in common.

How do i apply where condition like this Table1.A3 < Table2.B2 and still get all the data from Table3 & Table4

3 Replies
Gysbert_Wassenaar

In Qlikview tables are associated or joined using the field names the tables have in common. Since all the tables have different field names nothing will be joined correctly. You'd get a cartesian product joining the last table to table aaa. What you need to do is rename the fields that should be used for the join so they get the same name in the tables that you want to join.


talk is cheap, supply exceeds demand
remo0017
Contributor II
Contributor II
Author


Table3 is joined with Table1, Table2 by c1,c2, but Table1 & Table2 doesn't have anything to join in common.

Table3 has common fields that exists in table1 and table 2

How do i apply where condition like this Table1.A3 < Table2.B2 and still get all the data from Table3 & Table4

Gysbert_Wassenaar

There are no fields named c1 or c2 in either table 1 or table 2. Rename some fields to fix that issue.


talk is cheap, supply exceeds demand