How to use Power (Pwr) function

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

UCDI
Premium Member
Premium Member
Posts: 383
Joined: Mon Mar 21, 2016 2:00 pm

Post by UCDI »

You are not getting it.
In some low level operations, if you divide integers, the decimal part is dropped.

1/12 = 0.0000 in integer math.
anything to zero power is 1.

add the decimal explicitly and see if you get the right answer. Put 1.0 where you have 1, etc.
reachmexyz
Premium Member
Premium Member
Posts: 296
Joined: Sun Nov 16, 2008 7:41 pm

Post by reachmexyz »

I have tried below in transformer and got the expected results.
pwr( (1+(-2.0/100)),((1.0/12)-1))

convert the incoming columns to floats and this should resolve the issue.
Post Reply