Hi there,
I was wondering if you could do something like this in a transformer:
if x =1 then
a = "1"
b = "2"
else
c="3"
The key being the multiple assignemnt of a and b.
Hope that's clear.
Thanks
assign multiple derivations in a transformer
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 56
- Joined: Mon Oct 16, 2006 7:32 am
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Beware that you must assign a value irrespective of the test. So you need to decide values for variables a and b when x <> 1, and for c when x = 1. Sometimes you need to leave the value unchanged; in this case assign the stage variable to itself. For example, consider a stage variable svCounter that counts the product codes. It might be initialized to 0. The it might be derived as
Code: Select all
If svProdCodeChanged Then svCounter + 1 Else svCounter
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.