Expression Passed as Job Parameter is not working
Posted: Wed May 27, 2009 3:59 pm
I have prepared an Expression via Unix script (dynamic in nature based on the number of records in a table that drives the expression) that needs to be used in the Transformer Stage of a job. This expression does not return the result that i am looking for, instead, just outputs the expression itself.
In the Transformer Stage i have the following Stage Variables.
lnk_ALLFIELDS.DOLLAR_VAL --> svDollarValue (Where DOLLAR_VAL is the Input Column in link lnk_ALLFIELDS)
WGHT_EXPRESSION --> svWeight (Where WGHT_EXPRESSION is the Job Parameter).
The Run Time value of WGHT_EXPRESSION is: If (svDollarValue > 1000000 And svDollarValue < 1000000000) Then 100 Else If (svDollarValue > 100000 And svDollarValue < 999999) Then 30 Else If (svDollarValue > 50000 And svDollarValue < 99999) Then 20 Else If (svDollarValue > 30000 And svDollarValue < 49999) Then 10 Else If (svDollarValue > 10000 And svDollarValue < 29999) Then 5 Else If (svDollarValue > 1000 And svDollarValue < 9999) Then 0 Else 0
I was thinking that svDollarValue in the expression would be replaced by the value of Stage Variable svDollarValue. But, i do not see this happening.
When i capture output of svWeight to a Output Column and view the result, it just consists of the Expression that was passed (If (svDollarValue > 1000000 And svDollarValue < 1000000000) Then 100 Else If (svDollarValue > 100000 And svDollarValue < 999999) Then 30 Else If (svDollarValue > 50000 And svDollarValue < 99999) Then 20 Else If (svDollarValue > 30000 And svDollarValue < 49999) Then 10 Else If (svDollarValue > 10000 And svDollarValue < 29999) Then 5 Else If (svDollarValue > 1000 And svDollarValue < 9999) Then 0 Else 0)
Ex:
If lnk_ALLFIELDS.DOLLAR_VAL --> svDollarValue = 2073522
Since svDollarValue falls in the range (svDollarValue > 1000000 And svDollarValue < 1000000000) Then 100, i was expecting the output to be 100.
But, the conditional expression does not execute (in other words, it does not use svDollarValue Stage Variable).
Is there a way to make this work?
Thanks
In the Transformer Stage i have the following Stage Variables.
lnk_ALLFIELDS.DOLLAR_VAL --> svDollarValue (Where DOLLAR_VAL is the Input Column in link lnk_ALLFIELDS)
WGHT_EXPRESSION --> svWeight (Where WGHT_EXPRESSION is the Job Parameter).
The Run Time value of WGHT_EXPRESSION is: If (svDollarValue > 1000000 And svDollarValue < 1000000000) Then 100 Else If (svDollarValue > 100000 And svDollarValue < 999999) Then 30 Else If (svDollarValue > 50000 And svDollarValue < 99999) Then 20 Else If (svDollarValue > 30000 And svDollarValue < 49999) Then 10 Else If (svDollarValue > 10000 And svDollarValue < 29999) Then 5 Else If (svDollarValue > 1000 And svDollarValue < 9999) Then 0 Else 0
I was thinking that svDollarValue in the expression would be replaced by the value of Stage Variable svDollarValue. But, i do not see this happening.
When i capture output of svWeight to a Output Column and view the result, it just consists of the Expression that was passed (If (svDollarValue > 1000000 And svDollarValue < 1000000000) Then 100 Else If (svDollarValue > 100000 And svDollarValue < 999999) Then 30 Else If (svDollarValue > 50000 And svDollarValue < 99999) Then 20 Else If (svDollarValue > 30000 And svDollarValue < 49999) Then 10 Else If (svDollarValue > 10000 And svDollarValue < 29999) Then 5 Else If (svDollarValue > 1000 And svDollarValue < 9999) Then 0 Else 0)
Ex:
If lnk_ALLFIELDS.DOLLAR_VAL --> svDollarValue = 2073522
Since svDollarValue falls in the range (svDollarValue > 1000000 And svDollarValue < 1000000000) Then 100, i was expecting the output to be 100.
But, the conditional expression does not execute (in other words, it does not use svDollarValue Stage Variable).
Is there a way to make this work?
Thanks