Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
devrajR
Contributor III
Contributor III

Column Values in SQL Sub Query

Hello, 

I am reading data from two sources:

1. A database table with million of rows.

2. An excel with hundreds of records.

I need to extract only those values from the database table that are present in one of the column in the excel file. 

Like in SQL, where we write select statement in where clause (a sub-query), is it possible to do something similar in QlikSense?

Or is there a way to use a join, where I first load the excel file and then left join to SQL query?

Thank You in advance.

Devraj

Labels (1)
3 Replies
Or
MVP
MVP

At the Qlik level, you could load the Excel first, then left-join to the load from DB. You could also use Where Exists(FieldName) in your DB load. In both cases, you will be reading the entire table from your DB, but only keeping the relevant records.

If you need to narrow down the actual data loaded within the SQL query, you can concatenate the values from your Excel load into a single field, place those in a variable, and pass that into the SQL query. See e.g. https://community.qlik.com/t5/QlikView-App-Dev/How-to-use-Variable-in-Where-Clause/td-p/520132

 

devrajR
Contributor III
Contributor III
Author

Thank You for your reply.

The thing I was doing was:
1. Importing excel and store in a Qlik Table

2. Import data from SQL and store in it Qlik Table

3. Joining Process->

NewData:
Load *
Resident ExcelData;
left join (NewData)
Load *
Resident SQLData;

But, I was getting error in the join. So I added "NoConcatenate" statement between Step 2 and 3, which worked fine. 

marcus_sommer

The join could be already placed between step 1 and step 2 - means without further requirements you could skip step 3 and saving time and resources.