Transformer derivation logic

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
scorpion
Participant
Posts: 144
Joined: Thu May 12, 2005 4:19 am

Transformer derivation logic

Post 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.
Thanx&Regards
scorpion
panchusrao2656
Charter Member
Charter Member
Posts: 64
Joined: Sat Sep 17, 2005 10:42 am

Post 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
Minhajuddin
Participant
Posts: 467
Joined: Tue Mar 20, 2007 6:36 am
Location: Chennai
Contact:

Re: Transformer derivation logic

Post 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).............
Minhajuddin

<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
scorpion
Participant
Posts: 144
Joined: Thu May 12, 2005 4:19 am

Post 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.
Thanx&Regards
scorpion
Post Reply