Hi @edhere, hope this works as expected.
String expression in the StringConcatenator
@Value(AreaCode)-@Substring(@Value(Phone),@StringLength(@Value(AreaCode)))
Hi @edhere, hope this works as expected.
String expression in the StringConcatenator
@Value(AreaCode)-@Substring(@Value(Phone),@StringLength(@Value(AreaCode)))
Thanks @takashi , it works nicely!
It seems I need to add a two digit (06) area code as well.
Should I add another tester at the beginning that creates a separate flow for string length 2 and direct that to another FeatureMerger that joins @Left(@Value(Phone),2) ?
Thanks,
Ed
Hi @edhere, hope this works as expected.
String expression in the StringConcatenator
@Value(AreaCode)-@Substring(@Value(Phone),@StringLength(@Value(AreaCode)))
Yes. Separate the AreaCode records into three streams for 4, 3, and 2 digits, and then add a FeatureMerger as you mentioned.
If you feel it's too cluttered, the InlineQuerier could be an alternative.
SQL
select B.AreaCode, B.AreaCode||'-'||substr(A.Phone,5) as PhoneOutput
from A inner join B on B.AreaCode = substr(A.Phone,1,4)
union all
select B.AreaCode, B.AreaCode||'-'||substr(A.Phone,4)
from A inner join B on B.AreaCode = substr(A.Phone,1,3)
union all
select B.AreaCode, B.AreaCode||'-'||substr(A.Phone,3)
from A inner join B on B.AreaCode = substr(A.Phone,1,2)