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
Expression Passed as Job Parameter is not working
Moderators: chulett, rschirm, roy
Sorry, but that's not going to work. It won't do the multiple 'levels' or iterations of substitution / resolution you're looking for. It does turn your job parameter into the string you passed in but it's just a string at that point, it doesn't then know it then needs to resolve the stage variables. It's the same issue people find when they put a job parameter's #name# inside another job parameter's value. ![Sad :(](./images/smilies/icon_sad.gif)
![Sad :(](./images/smilies/icon_sad.gif)
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom