Hi
what is meant by stage variable in Transformer and when we need to use that variable
Stage Variable
Moderators: chulett, rschirm, roy
It's a local variable, something that can come in very handy - at least in Server jobs. Not positive about their role or pros/cons in PX jobs, if any. This post should help.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
the stage variables are some temporary variables defined in the transformer to play internally within it. it is very helpful in terms of complex calculations involving many intemediate calcualtions. if there is a field "FIELD1" for which the calculation is x * y + z. Inturn x,y,z has got some more calculations , you can define x,y and z as the stage variables and define the formula for each of this. And in the transformer, you can use the stage variables to calcualte FIELD1 directly.
And it has got re-usability too. if more than one field has got similar type of calcuations with little bit additions, you can use these stage varibles without re-typing the calculation in the transformer. Also that you can play internally within the stage variable. one calclated variable can be used for another. in that order of the calculatoin is very important.
As far as I know there are no "cons" for stage variables.
Thanks,
And it has got re-usability too. if more than one field has got similar type of calcuations with little bit additions, you can use these stage varibles without re-typing the calculation in the transformer. Also that you can play internally within the stage variable. one calclated variable can be used for another. in that order of the calculatoin is very important.
As far as I know there are no "cons" for stage variables.
Thanks,
-
- Participant
- Posts: 16
- Joined: Tue Apr 22, 2003 3:37 am
- Location: USA
- Contact:
Just to add my 2 cents: The stage variable also can be used in the constraints. If you have a complex constraint, you can derive it in the stage variable and use it in the constraints.mouthou wrote:the stage variables are some temporary variables defined in the transformer to play internally within it. it is very helpful in terms of complex calculations involving many intemediate calcualtions. if there is a field "FIELD1" for which the calculation is x * y + z. Inturn x,y,z has got some more calculations , you can define x,y and z as the stage variables and define the formula for each of this. And in the transformer, you can use the stage variables to calcualte FIELD1 directly.
And it has got re-usability too. if more than one field has got similar type of calcuations with little bit additions, you can use these stage varibles without re-typing the calculation in the transformer. Also that you can play internally within the stage variable. one calclated variable can be used for another. in that order of the calculatoin is very important.
As far as I know there are no "cons" for stage variables.
Thanks,
The execution order in the transformer is: stage variable -> Constraints -> derivations.