Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
prahlad_infy
Partner - Creator II
Partner - Creator II

Help in loading specified set of data

Hello Sirs ,

Please help me . I want  load only those rows of data in Table 2 , which has present in the table 1 of column Top_Grp .

I do not want to using explicit joins .

Help please .

Capture1.PNG

1 Solution

Accepted Solutions
stigchel
Partner - Master
Partner - Master

You can use where exists:

Table1:

LOAD Top_Grp,

     [Base Region],

     Pitch

FROM

(ooxml, embedded labels, table is Table);

Table2:

LOAD Top_Grp,

     Items,

     Date,

     Price,

     Region,

     Defect_History,

     Gender_In_Invoice,

     F8,

     F9

FROM

(ooxml, embedded labels, table is Table2) Where Exists (Top_Grp);

Drop Table Table1;

View solution in original post

6 Replies
stigchel
Partner - Master
Partner - Master

You can use where exists:

Table1:

LOAD Top_Grp,

     [Base Region],

     Pitch

FROM

(ooxml, embedded labels, table is Table);

Table2:

LOAD Top_Grp,

     Items,

     Date,

     Price,

     Region,

     Defect_History,

     Gender_In_Invoice,

     F8,

     F9

FROM

(ooxml, embedded labels, table is Table2) Where Exists (Top_Grp);

Drop Table Table1;

prahlad_infy
Partner - Creator II
Partner - Creator II
Author

Sir , please explain Where Exists (Top_Grp)

duncanblaine
Creator
Creator

Hi Prahlad

Using the SampleData you sent, you could do the following  or see attached QVW.
I've used KEEP which is not an explicit join, but just keeps everything from one table that has common fields with another.

Hope this is helpful to you.

Table1:

LOAD Top_Grp, [Base Region], Pitch

FROM [Sample Data.xlsx] (ooxml, embedded labels, table is Table);

Table2:

LOAD Top_Grp1 as Top_Grp, Items, Date, Price, Region, Defect_History, Gender_In_Invoice

FROM [Sample Data.xlsx] (ooxml, embedded labels, table is Table);

Table3:

LEFT KEEP (Table1) LOAD * Resident Table2;

DROP TABLES Table2, Table1;

stigchel
Partner - Master
Partner - Master

That means that it will only load the values of Top_Grp that exist in Table1, in this case Sony and Dell Inc

prahlad_infy
Partner - Creator II
Partner - Creator II
Author

Thank you Sir . But my confusion is that field Top_Grp , exist in Both table and it can not be estimated which Top_Grp (from table 1 or 2 ) to refer

duncanblaine
Creator
Creator

You don't need to refer to which table Top_Grp belongs to. Qlik automatically links columns which are named the same.

The 'Where Exists' and 'Keep' statements will look at all the data that has already been loaded and only include data that joins via the specified or common field values.