Page 1 of 1

IN condtion in Filter stage

Posted: Mon Aug 15, 2011 8:06 am
by pdntsap
I have a job parameter that is used to as an array/list to store a random number of variables. As an example it can be a three digit code for a list of all countries. I need to use the job parameter in a filter stage to filter the records. I am looking for a function similar to the 'IN' condition that can be used in SQL. It looks like using 'IN' as a predicate in the filter stage is now possible. Any suggestions on implementing the above logic would be of great help.

Thanks.

Posted: Mon Aug 15, 2011 8:13 am
by vinothkumar
This has been answered here already. You can use Index function inside transformer.

Posted: Mon Aug 15, 2011 8:21 am
by pdntsap
If I am right, the Index function can be used if all possible values of the list are known before run time. Is my assumption right? If so, what if the list it being populated dynamically and I then need to implement the filter stage based on the generated list?

Thanks.

Posted: Mon Aug 15, 2011 11:41 am
by jcthornton
When it is populated should make no difference. Assign the list to the parameter that you want to use, and make sure it is in the right format. There is nothing that would change the evaluation based on when the list is generated (static vs dynamic).

Posted: Mon Aug 15, 2011 1:14 pm
by pdntsap
Thanks guys.

Using an index function in the transformer seems to work. I was reading the forums and looking at ways to use a lookup stage before the filter stage among other things but looks like it will not be needed.