Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
rappavan
New Contributor II

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

Re: How to use a table as a parameter

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);

7 Replies

Re: How to use a table as a parameter

May be like this

LOAD *

Resident [Table_x]

Where Exists(EC_number);

Re: How to use a table as a parameter

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);

rappavan
New Contributor II

Re: How to use a table as a parameter

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)

Re: How to use a table as a parameter

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

rappavan
New Contributor II

Re: How to use a table as a parameter

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.

rappavan
New Contributor II

Re: How to use a table as a parameter

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})

Re: How to use a table as a parameter

Community Browser