Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
On May 18th at 10AM EDT we will answer your QlikView questions live. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Joins


Hi Guys,

I have two Tables:

1:QPGT

//[QPGT]:   // Code group texts
   [MANDT] as [Client_MANDT],    

  
[KATALOGART] as CatalogType,

  
[CODEGRUPPE] as [Code group_FEGRP],

  
[CODE] as CODE,

  
[SPRACHE] as [Language_SPRACHE],

  
[KURZTEXT] as [Short text_KURZTEXT],

  
[GELOESCHT] as [Deleted record_GELOESCHT],

  
[INAKTIV] as [Record inactive_INAKTIV],

  
[LTEXTV] as [Long Text_LTEXTV]

2:VIQMFE

// Generated Table for View VIQMFE

Load

  
[MANDT] as [Client_MANDT],

  
[QMNUM] as [Notification_QMNUM],

  
[FEGRP] as [Code group_FEGRP],

  
[FECOD] as CODE,

  
[FEKAT] as CatalogType,

  
FETXT AS Text_FETXT,

  
[OTKAT] as [Catalog type_OTKATq],

  
[OTGRP] as [Code group_OTGRPq],

  
[OTEIL] as [ObjectPartCode_OTEILq]

Which Join must I use and Why ? If I need a comprehensive set of this data in one table.

6 Replies
Not applicable
Author

Hi,

you need to explain what data you need from both the tables & also decide which key field/fields make ur data unique.

1) i see multiple fields with same names in the two tables. do you really want to join on all these fields ?

2) if you want all the records from 1st table & only the matching ones from 2nd table--use left join

   if you want all the records from 2nd table & only the matching ones from 1st table--use right join

   if you want exactly the matching records from the two tables --use inner join

it depends

jagan
MVP
MVP

Hi,

What is the Transaction table in this?  Use Left Join to the Transaction table, if you need only the matching records then use inner join.

Regards,

Jagan.

Not applicable
Author

In essence the table you declare first will be the primary based on a join. So by using the following:

1. Inner Join - matches all IDs in both tables

2. Left Join - retrieves all data from the primary table (left side) even if the secondary table (right side) doesn't have the matching IDs

3. Right Join - retrieves all data from the secondary table (right side) even if the primary table (left side) doesn't have the matching IDs

Not applicable
Author

Hi,

Thanks for ur reply.

You mean to say:

If I want only matching records(IDs are same in both tables) and  their relevant data,I must use Inner Join?

Regards,
Rochelle

Not applicable
Author

No problem.

Yes, that's correct. Joins are very similar to SQL Server, DB2, etc. However, QlikView creates a single table based on joins whereas SQL Server for example does a table mapping and creates relationships.

Not applicable
Author

Ok ..

Thanks Guys..