Is there any way to use in a Transformer Expression to handle multiple replace statements?
Just like CASE statement in programming or even in databases:
CASE param:
When 'A' Then 1
When 'Y' Then 2
When 'X' Then 3
When 'M' Then 4
....
CASE statement available?
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 38
- Joined: Wed Sep 19, 2007 10:11 am
- Location: Canada
-
- Participant
- Posts: 38
- Joined: Wed Sep 19, 2007 10:11 am
- Location: Canada
Re: CASE statement available?
For the exact problem, you could use -landaghaar wrote:Is there any way to use in a Transformer Expression to handle multiple replace statements?
Just like CASE statement in programming or even in databases:
CASE param:
When 'A' Then 1
When 'Y' Then 2
When 'X' Then 3
When 'M' Then 4
....
Code: Select all
ereplace(ereplace(ereplace(ereplace(Arg1,'A',1),'Y',2),'X',3),'M',4)
gateleys
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
If it's character-by-character the most efficient function is Convert().
Convert("AYXM","1234",InLink.TheChar)
You might then need to convert to integer of some kind.
Convert("AYXM","1234",InLink.TheChar)
You might then need to convert to integer of some kind.
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.