Page 1 of 1

Transformer derivation logic

Posted: Mon Jun 25, 2007 11:41 am
by scorpion
Hi All,

I have to populate to one of my target table column as per the below logic:


-populate "xxx"

-if value is not there for "xxx" then Populate "yyy"

-if value is not there for both "xxx" and "yyy" then populate "zzz"

-if value is not there for both "xxx" and "yyy" and "zzz" then leave blank.

So Itried with the below logic ,but it is not working as per the logic:


the derivation used in my transformer is :

If IsNotNull(xxx) Then Link.xxx
else If IsNotNull(YYY) Then Link.YYY
else If IsNotNull(ZZZ) Then ZZZ
Else ""


It is only populating the 'XXX' Value,but not populating as per the logic.

Could any one help me on my issue ,is there any thing missed in paranthesis or logic problem?


thanks in advance.

Posted: Mon Jun 25, 2007 11:55 am
by panchusrao2656
Please Trim all the spaces before checking the NULLABILITY, there might be some spaces. Otherwise use NullToEmpty(Colxxx.Val) <> '' Then ... Else ... soon

Before using the Trim make sure that you are not trimming NULL, records will be dropped during Trim incase they have NULLs in them

Re: Transformer derivation logic

Posted: Mon Jun 25, 2007 12:00 pm
by Minhajuddin
scorpion wrote:If IsNotNull(xxx) Then Link.xxx
else If IsNotNull(YYY) Then Link.YYY
else If IsNotNull(ZZZ) Then ZZZ
Else ""

If this is the exact code you are using then it is wrong.

It should have been

Code: Select all

If IsNotNull(Link.xxx) Then Link.xxx
else If IsNotNull(Link.YYY) Then Link.YYY
else If IsNotNull(Link.ZZZ) Then Link.ZZZ
Else "" 
And if that was not the exact code you are using, then, try

IsNull(Link.xxx)=0 instead of IsNotNull(Link.xxx).............

Posted: Tue Jun 26, 2007 4:25 am
by scorpion
Thanks to all,

I got the solution,i removed NullToEmpty and Trim function in the earlier transformer stage and i applied

If IsNotNull(Link.xxx) Then Link.xxx
else If IsNotNull(Link.YYY) Then Link.YYY
else If IsNotNull(Link.ZZZ) Then Link.ZZZ
Else ""

it is working fine.

thanks for the help all.