Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to use a table as a parameter

Guys and Girls, I've done my queries to generate a table with some Commercial Establishments (CE) and now I'd like to search for information in another data base using these commercial establishments as parameters of where clause.

For example, in my query I get the CE_number 's (100, 101, 102, 103) and I would like to search for

load

* Resident [Table_x] where EC_number in (100, 101, 102, 103)

but I don't really know the CE_number 's, just have them in another table column generated previously.

So, I would like to do something like this:

load

* Resident [Table_x] where EC_number in (load EC_number from [Table_y])

Table_y can be a Qlik table, a QVD or a impala database.

Is it possible? Didn't find any information about it,

1 Solution

Accepted Solutions
sunny_talwar

This actually may not work... since EC_number will have all possible values because we are doing a Resident from Table_x... may be rename the column to something else in Table y like this

TableY:

LOAD ...,

     EC_number,

     EC_number as EC_Check

From ...;

and then this

LOAD *

Resident [Table_x]

Where Exists(EC_Check, EC_number);

View solution in original post

7 Replies
sunny_talwar

May be like this

LOAD *

Resident [Table_x]

Where Exists(EC_number);

sunny_talwar

This actually may not work... since EC_number will have all possible values because we are doing a Resident from Table_x... may be rename the column to something else in Table y like this

TableY:

LOAD ...,

     EC_number,

     EC_number as EC_Check

From ...;

and then this

LOAD *

Resident [Table_x]

Where Exists(EC_Check, EC_number);

Anonymous
Not applicable
Author

Would it be possible in a sql query in any way?

Like

load *; sql select ec_name from impala.database where ec_number in (...) or

load *; sql select ec_name from impala.database where exists (ec_number)

sunny_talwar

I am not entirely sure I understand the scenario... can you share more details?

Anonymous
Not applicable
Author

I wanted to take some EC's by their revenues and calculated some limits for them. If they were above or below the limits I created, I would take them into a table, right?

Now that I have finally resolved how to calculate the limits rightly, I need to take some extra informations about them in the database, but I can't just add those informations into my limits calculations.

The problem is: the database has billions of EC's and I want to make a fast query just to gather information about my 17k EC's that are off limits, right? So I wanted to use them as my where clause limitation.

As I need to run this every month, I want to know if there is a automatic way to do it instead of having to print all the 17k numbers and putting them into inlines or something like that.

Anonymous
Not applicable
Author

Would I be able to use of table as where exists parameter in another table's load?

Like:

table_x has my ec numbers: (101, 102, 103....)

Load * resident [Table_y] where exists (ec_number {from table x})

sunny_talwar