Page 1 of 1

how to do conditional lookup.............

Posted: Fri Jun 29, 2007 4:59 am
by ajay.prakash03
what is conditional lookup,
Scenario would be some thing like below.

I have a input file, where I can get either product or something else as input, now if input is product I have to do a product lookup , if its something else, then I have to do a different lookup, which I am not able to do in datastage, what I am able to do is for all. I am not able to do only a selective lookup.
U can suggest in Server also.

Re: how to do conditional lookup.............

Posted: Fri Jun 29, 2007 5:10 am
by sachin1
hello if i have understood your requirement well then, i think you should know what all lookup's you need like product...or something else. then...

in server jobs you can have

your input file ---- transformer(constraints) ---> output(1,2...3).

in transformer stage you can put constraints and get values needed in output, then these output and other references could be used for lookup.

if this is not your requirement, please elaborate more on it so that we can give you a solution.

Posted: Fri Jun 29, 2007 7:50 am
by Maveric
You mean to say if it is product then lookup with product, if it is product ID then lookup with product ID. Now are they in the same column in the main link and the product and product ID are coming in different column in the reference link? If this is the case then you cannot do it in the same lookup. You will have to filter them into two links and use two lookups. And then probably join them back into a single stream.

Posted: Fri Jun 29, 2007 8:18 am
by bcarlson
You could use a filter to differentiate between your data stream - one with product, one with something different. The product data stream does a lookup against the product table, the other data stream does whatever lookup it needs.

Code: Select all

                  product lookup -> ...
input -> filter <
                  other lookup -> ...
Brad.