I have a SQL like
"a not in ('1','2','3')"
because some reason, i "MUST" use datastage job only to do this SQL statement.
can anyone know how to use filter stage(maybe transformer stage...) to implement "Not in" in PX job?
How to implement "Not In" function in Filter Stage
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 334
- Joined: Fri Dec 01, 2006 5:17 am
- Location: Texas
Hi,
In the filter stage you can use '<>' along with 'and' operator.
For example:
Suppose in my fisrt link i want only those employee who Employee number are not in 2 and 6..then this logic can implemented i filter as :
Hope this will help you out!
In the filter stage you can use '<>' along with 'and' operator.
For example:
Suppose in my fisrt link i want only those employee who Employee number are not in 2 and 6..then this logic can implemented i filter as :
Code: Select all
EMP_NO <> 2 AND EMP_NO <> 6
Output link=(link where you want to pass this records)
http://findingjobsindatastage.blogspot.com/
Theory is when you know all and nothing works. Practice is when all works and nobody knows why. In this case we have put together theory and practice: nothing works. and nobody knows why! (Albert Einstein)
Theory is when you know all and nothing works. Practice is when all works and nobody knows why. In this case we have put together theory and practice: nothing works. and nobody knows why! (Albert Einstein)
Thanks AmeyJoshi
But If my sql statement had many many case like:
Not in ('1','a',....etc...to much @_@)
can you teach me how should i do ?
But If my sql statement had many many case like:
Not in ('1','a',....etc...to much @_@)
can you teach me how should i do ?
AmeyJoshi14 wrote:Hi,
In the filter stage you can use '<>' along with 'and' operator.
For example:
Suppose in my fisrt link i want only those employee who Employee number are not in 2 and 6..then this logic can implemented i filter as :
Hope this will help you out!Code: Select all
EMP_NO <> 2 AND EMP_NO <> 6 Output link=(link where you want to pass this records)
-
- Participant
- Posts: 334
- Joined: Fri Dec 01, 2006 5:17 am
- Location: Texas
Oops my bad!gabrielac wrote:One possibility would be to create a source file with all the possible values, then use a lookup stage, and filter stage to filter those that were not found.
HTH, Gaby
But the post by gabrielac is really amazing.. :D
I am gona ask this question in the interviews.. and that's the answer
Just kidding!:lol:
http://findingjobsindatastage.blogspot.com/
Theory is when you know all and nothing works. Practice is when all works and nobody knows why. In this case we have put together theory and practice: nothing works. and nobody knows why! (Albert Einstein)
Theory is when you know all and nothing works. Practice is when all works and nobody knows why. In this case we have put together theory and practice: nothing works. and nobody knows why! (Albert Einstein)