Page 1 of 1

Lookup using Stage Variable

Posted: Thu Jun 28, 2007 9:36 pm
by cosec
I want to do a lookup based on a stage variable and not based on any of the columns in the input link. Is it possible ?

Posted: Thu Jun 28, 2007 10:04 pm
by chulett
No. Use the ellipsis in the Key Expression editor for a list of valid contributors.

You could pass the stage variable down a link and use it in the lookup of a downstream transformer, however. But that would just put you back to doing the look up from the input link. :wink:

Posted: Thu Jun 28, 2007 10:20 pm
by ray.wurlod
Yes, of course it's possible. You need one Transformer stage to generate the stage variable value. That goes on the output link as an extra column along with all the columns from in input link. In a separate, downstream Transformer stage you perform the lookup, using the extra column as the reference key.

It is not possible to do it in the one Transformer, because all input links are processed before stage variables are evaluated.

Re: Lookup using Stage Variable

Posted: Fri Jun 29, 2007 2:27 am
by sachin1
i agree with ray.

Posted: Fri Jun 29, 2007 6:13 am
by chulett
:roll:

Ray said exactly what I said, just in the reverse order. And the answer to the question as asked is still 'no'.

Posted: Fri Jun 29, 2007 6:32 am
by ray.wurlod
Yair, but before I'd seen your post. C'est la vie.

Posted: Fri Jun 29, 2007 6:34 am
by chulett
Tsk, tsk... that's what happens when you post into a thread without reading the replies first. :lol:

Posted: Fri Jun 29, 2007 6:43 am
by ray.wurlod
Suspect I already had it open when you replied.

This is an example of why optimistic locking strategies are not perfect.

Posted: Fri Jun 29, 2007 8:51 am
by aakashahuja
Or... if you already know what the value of your stage variable is going to be!! And if that value is always going to be a constant for each run of the job... then, you can simply hard code that value to the left pane against the columns to be looked up on the right, for the lookup link inside the transformer..

Cheers
Aakash

Posted: Fri Jun 29, 2007 8:52 am
by aakashahuja
Or... if you already know what the value of your stage variable is going to be!! And if that value is always going to be a constant for each run of the job... then, you can simply hard code that value to the left pane against the columns to be looked up on the right, for the lookup link inside the transformer..

Cheers
Aakash