Page 1 of 1

Posted: Sun Feb 14, 2016 11:01 am
by chulett
:?

That just needs to be one if-then-else, specifically the last one.

Re: Logic required for IF and else in tranformer

Posted: Sun Feb 14, 2016 8:36 pm
by naveenkumar.ssn

Code: Select all

IF isnotNull(FROM_ACCT_NUM)
   then right(FROM_ACCT_NUM,2)
    else if 
          isnotNull(FROM_ACCT_NUM)
          then right(FROM_ACCT_NUM,2):'XXXXX' 
   else if 
          isnotNull(FROM_ACCT_NUM)
          then left((right(FROM_ACCT_NUM,2):'XXXXX'):FROM_ACCT_NUM,12)    ELSE
 FROM_ACCT_NUM

Posted: Sun Feb 14, 2016 9:08 pm
by ray.wurlod
Most of your ELSE expressions won't be evaluated because they include the same IF test as was processed in the THEN clause.

All you need is:

Code: Select all

If IsNotNull(InLink.ACCT_NUM) Then Left(InLink.ACCT_NUM,2) : "XXXXX" : Right(InLink.ACCT_NUM,12) Else InLink.ACCT_NUM

Posted: Sun Feb 14, 2016 11:34 pm
by chulett
In other words... the last one. :wink:

Posted: Mon Feb 15, 2016 4:13 pm
by ray.wurlod
... except that the syntax given by naveenkumar.ssn (even in the last one) will not create the required result.

Posted: Mon Feb 15, 2016 4:57 pm
by chulett
... was going to let them realize and attempt to correct that. Was also going to go back and edit my answer to say 'a variation of the last one' but decided to just let it stand.

Posted: Wed Feb 17, 2016 2:49 am
by skp
Hi Hargun,

Please use below logic to get the desired output.

If IsNotNull(FROM_ACCT_NUM) Then Left(FROM_ACCT_NUM,2):'XXXXX':Right(FROM_ACCT_NUM,12) Else FROM_ACCT_NUM

Posted: Wed Feb 17, 2016 7:31 am
by qt_ky
Ray has already given that answer above... :?

Posted: Wed Feb 17, 2016 10:46 am
by chulett
Seems to be a bit of a serial repeater. :wink: