Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Qlik Sense Data Load Syntax Help - 'Where in' Clause + Select Subquery + Logical operator

Hi,

I am looking to load the data in Qlik Sense using a where clause from multiple temp tables that are loaded in the same code. Below is sample Psuedo code that looking to implement. Please suggest the right syntax and other better ways to load the data. Thanks a lot in advance for the help!!

Sample Code

Table1:

LOAD *

FROM [lib://masterdata.qvd];

Vendor:

LOAD "Vendor Name"

FROM [lib://vendordata.xls];

CostCenter:

LOAD "Cost Center ID"

FROM [lib://costcenterdata.xls];

/// Need help with the syntax for the below code ////

Table 2:

Load * Resident Table 1

where exists (select [Vendor Name] from Resident Vendor) OR exists (select [Cost Center ID] from Resident CostCenter );

Drop Table Table1,Vendor, CostCenter;

Thanks,

Rajesh

1 Reply
dwforest
Specialist II
Specialist II

This is a bit old, in case someone needs the answer:

//get vendors
Vendor:
LOAD "Vendor Name"
FROM [lib://vendordata.xls];

//get cost centers
CostCenter:
LOAD "Cost Center ID"
FROM [lib://costcenterdata.xls];

//load data with valid vendors and cost centers already loaded
Table1:
LOAD *
FROM [lib://masterdata.qvd];
where exists ([Vendor Name]) 
OR exists ([Cost Center ID]);

This assumes the fields Vendor Name and Cost Center ID are in masterdata and have the same field name.