Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
subbareddykm
Creator II
Creator II

Need help how to do ?

Hi All,

I Have one requirement like below.

Example: I ahve two tables Table _1 and Table_2.

Table_1:

Field1,

Field2,

Field3,

Field4

From................


Table_2:

Field1,

Field2

,Field3,

Field5,

Field6

From..................


Requirement is : I want to load only Where  Field2=Field2 and Field3=Field3 from Table_1


Can any one tell me how to do this ,any help would be appreciated,




Thanks in advance






.

14 Replies
subbareddykm
Creator II
Creator II
Author

Can i use like this , if I have more then three tables

Table_1:

LOAD Field1,

          Field2,

          Field3,

          Field4

FROM....

Left join

Table2:

LOAD Field1,

          Field2,

          Field3,

          Field4,

          Field5,

          Field6

FROM....


Left Join(Table_1)


Table_3:

Field3 ,

Field7

From.......

maxgro
MVP
MVP

The question wasn't (IMHO) very clear; for a 2 tables result I thought at my or Sunny's answer (it depends if the check was on a single row for both the fields --> my answer or in many rows --> Sunny's answer).

For a 1 table result maybe a left or inner join.

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Of course you can.

The only thing you have to take care of is this: each successive JOIN may duplicate the records that are already present in your original table. For example, if your table_1 contains:

Field1, Field2, Field3

ABC, 2/5/2015, $1000

left joining the following to table_1

Field1, Field4

ABC, CostCenter8012

ABC, CostCenter8200

will produce this new version of Table_1:

Field1, Field2, Field3, Field4

ABC, 2/5/2015, $1000, CostCenter8012

ABC, 2/5/2015, $1000, CostCenter8200


which may not be what you expect.


The order in which you perform multiple successive JOINs is extremely important. But since you keep to the dummy field names (I haven't got any idea what they will be used for), we cannot advise on the real impact of your examples.


Best,


Peter

subbareddykm
Creator II
Creator II
Author

If i dont want duplicate records, What should i do ?

Peter_Cammaert
Partner - Champion III
Partner - Champion III

You should think it over. You can always ask yourself: does the table I want to join to an existing table contain multiple records per distinct join field value?