DerivationStatement

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

DerivationStatement

Post by scorpion »

Hi,

I have 2 source fields:

AAA,
BBB

my target field name is:

XXX

The logic to populate XXX target column like below:

if AAA = 255 ( BBB<0 THEN populate XXX= LOSS,but IF BBB >0 then populate XXX=PROFIT)

Else other than AAA=255 VALUES leave it blank.


Can any one help me to apply this in IF-THEN-ELSE statements.
Thanx&Regards
scorpion
meena
Participant
Posts: 430
Joined: Tue Sep 13, 2005 12:17 pm

Re: DerivationStatement

Post by meena »

If (AAA = 255 & BBB<0) Then 'LOSS' Else If (AAA = 255 & BBB >0) then 'PROFIT' Else ' '
AAA,
BBB

my target field name is:

XXX

The logic to populate XXX target column like below:

if AAA = 255 ( BBB<0 THEN populate XXX= LOSS,but IF BBB >0 then populate XXX=PROFIT)

Else other than AAA=255 VALUES leave it blank.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Code: Select all

If AAA = 255 Then If BBB > 0 Then "PROFIT" Else If BBB < 0 Then "LOSS" Else "" Else ""
may be slightly more efficient
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
scorpion
Participant
Posts: 144
Joined: Thu May 12, 2005 4:19 am

Post by scorpion »

Thanks Ray...
Thanx&Regards
scorpion
Post Reply