Page 1 of 1

Switch/Case

Posted: Tue May 25, 2010 10:29 am
by agpt
How do we implement Switch/Case statement in transformer?

Posted: Tue May 25, 2010 10:31 am
by priyadarshikunal
nested if-then-else

Posted: Tue May 25, 2010 10:32 am
by agpt
Thanks priya...
but it means thr is no direct implementation of switch/case available in transformer?

Posted: Tue May 25, 2010 10:51 am
by priyadarshikunal
I don't think you have direct implimentation for that, but you can use stage variables to keep the derivation simple if using If-then-else.

You can also send data to different links based on constraint in case with calculation/values defined in 'Then' and then funnel then afterwards.

Posted: Tue May 25, 2010 11:02 am
by agpt
Thanks

Posted: Tue May 25, 2010 5:26 pm
by truenorth
AFAIK, switch/case has no equivalent in DS, other than the way priya suggested.

Posted: Tue May 25, 2010 5:27 pm
by ray.wurlod
There is no direct implementation. If you feel you really must have this, embed it in a routine and invoke that from the Transformer stage.

Seems like overkill to me. Most situations can be accomplished using sets of stage variables, as suggested.

Posted: Tue May 25, 2010 5:29 pm
by truenorth
AFAIK, switch/case has no equivalent in DS, other than the way priya suggested.

Posted: Tue May 25, 2010 5:34 pm
by ray.wurlod
Not sure what you're attempting to accomplish, but there IS a Switch stage that you may wish to investigate.

Posted: Tue May 25, 2010 11:41 pm
by agpt
Thanks to all of you.

Ray,

Though I couldn't read your previous messae completely as some content was hidden but thanks for the great help you have been giving me on my posts.

Posted: Wed May 26, 2010 3:59 am
by ray.wurlod
I doubt that you missed much of it, but I've removed the Premium status anyway.

Posted: Wed May 26, 2010 6:39 am
by chulett
Don't think he meant that one. :wink: