Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
psk180590
Contributor III

How to join data from different tables and compare?

Hello All,

I have some questionnaire data structured as follows:

Table 1
DateEMPID   CIDFIDUID
Table2
Fnumber    FID    UID
Table3
TextTID
Table4
FnumberFID2FIDTID
Table5
MainID

I would like to merge or combine this data into a single table and save in the following manner

FinalTable

Date    EMPID    FNumber    Text

But, there are a few conditions which needs to be considered:

Table2.Fnumber=Table4.FNumber

And Table4.TID=Table3.TID

And Table2.FID=Table4.FID

And Table1.EMPID=Table5.MainID

And Table1.UID=Table2.UID

Can you please suggest what would be the better approach to obtain the result.

TIA!!

1 Solution

Accepted Solutions
vinieme12
Esteemed Contributor II

Re: How to join data from different tables and compare?

psk180590

try as below

LOAD
Date,
EMPID,
  CID,
UID
FROM Table1;
JOIN
LOAD
UID
Fnumber,
FID
FROM Table2;
JOIN
LOAD
FID,
TID
FROM Table4;
JOIN
LOAD
TID,
Text
From Table3

View solution in original post

6 Replies
psk180590
Contributor III

Re: How to join data from different tables and compare?

Hello Experts,

stalwar1vinieme12swuehl

Could you please point me the right direction to use in this case. I'm confused between Concatenate and Join.

vinieme12
Esteemed Contributor II

Re: How to join data from different tables and compare?

psk180590

try as below

LOAD
Date,
EMPID,
  CID,
UID
FROM Table1;
JOIN
LOAD
UID
Fnumber,
FID
FROM Table2;
JOIN
LOAD
FID,
TID
FROM Table4;
JOIN
LOAD
TID,
Text
From Table3

View solution in original post

psk180590
Contributor III

Re: How to join data from different tables and compare?

Hello vinieme12

Thanks for the reply and sorry for the delay in getting back.

This looks good, can you also please let me know how do i write my conditions mentioned by following your suggested way?

vinieme12
Esteemed Contributor II

Re: How to join data from different tables and compare?

this is how your data tables will join; which is based on the conditions specified, i've highlighted the key fields for reference. you don't need to write the conditions separately

vinieme12
Esteemed Contributor II

Re: How to join data from different tables and compare?

we are joining table 1 and table on UID

And Table1.UID=Table2.UID


Table2 to table 4 on FID

And Table2.FID=Table4.FID


and Table 4 to table 3 on TID

And Table4.TID=Table3.TID


these are for Joins not conditions of load

psk180590
Contributor III

Re: How to join data from different tables and compare?

Thanks Vineeth,

Your solution works perfectly for me.