Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
gizzel123
Creator
Creator

How to apply "where ID in (col of table 2)

Hi,

I have a table-1 with say, ID-1, name ,place  and table-2 with ID-2.

How do i apply the query,

select * from Table-1 where ID-1 in (ID-2)

please help , its very urgent.

1 Solution

Accepted Solutions
alexandros17
Partner - Champion III
Partner - Champion III

TAB_TMP:

LOAD ID-2 as myID Resident Table-2;

TAB:

noconcatenate

LOAD * Resident Table-1 where exists(myID, ID-1);

let me know

View solution in original post

9 Replies
alexandros17
Partner - Champion III
Partner - Champion III

Should be:

select * from Table-1 as t1 inner join select * from Table-2 as t2 on t1.ID-1 = t2.ID-2

let me know

kuba_michalik
Partner - Specialist
Partner - Specialist

Er... but those tables are in the database or in QlikView already?

If they are in QlikView, then:

Load *

Resident [table-1]

Where Exists([ID-2],[ID-1])

;

should do it.

If the tables have the same key field, you could use Keep as well.

PrashantSangle

Hi,

Simple Left join also work for you

load ID-2 as ID-1 from table2;

left join

load ID-1, name ,place   from table1;

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Anonymous
Not applicable

Hi,

I assume tables are in Qlikview.

Try:

Load *

Resident Data

Where [ID-1]) = [ID-2];

OR

Load *

Resident Data

Where Exists([ID-1],([ID-2]);

Hope it helps.

Regards

Neetha

gizzel123
Creator
Creator
Author

hi Alessandro, I need to apply the logic in qlikview script.

alexandros17
Partner - Champion III
Partner - Champion III

TAB_TMP:

LOAD ID-2 as myID Resident Table-2;

TAB:

noconcatenate

LOAD * Resident Table-1 where exists(myID, ID-1);

let me know

gizzel123
Creator
Creator
Author

This gives error for col"ID-2".-" field  not found"

Anonymous
Not applicable

Hi,

Try:

Load *

Resident Data

Where [ID-1] = [ID-2];

OR

Load *

Resident Data

Where Exists([ID-1],[ID-2]);

Hope it helps.

Regards

Neetha

gizzel123
Creator
Creator
Author

Thanks Guys  for helping me out.:)