Page 1 of 1

DEFAULT VALUE IN COLUMN FIELD

Posted: Thu Nov 09, 2006 2:23 pm
by pradkumar
I am trying to do the follow

if isnull(in.col2) then (in.col1) else enter default value of col2

I defined the default value of col2 as default which is NA

but when i ran the job it is not entering the default value

Re: DEFAULT VALUE IN COLUMN FIELD

Posted: Thu Nov 09, 2006 2:25 pm
by dsscholar
Please post the exact transformation that you are doing, it cant be

if isnull(in.col2) then (in.col1) else enter default value of col2

I would suggest the following code,
if isnull(in.col2) then (in.col1) else 'NA'

However this doesn't look logically correct to me.

It should be something like
if isnull(in.col2) then 'NA' else in.col2
This will replace nulls with NA for col2

Please let me know if I have not understood you correctly

Posted: Thu Nov 09, 2006 2:37 pm
by pradkumar
My requirement is osmething different.
There are certain columns which when null should have the value of the colno-1..If the col(x) is null then i am entering NA then if col(x+1) is also null, it should be NA.

Hope I am clear now

Posted: Thu Nov 09, 2006 2:45 pm
by dsscholar
pradkumar wrote:My requirement is osmething different.
There are certain columns which when null should have the value of the colno-1..If the col(x) is null then i am entering NA then if col(x+1) is also null, it should be NA.

Hope I am clear now
For the above mentioned requirement, the transformation should be

If Not(IsNull(in.col2)) then (in.col2) Else (If IsNull(in.col1) then 'NA' else in.col1)

Hope this helps !

Posted: Thu Nov 09, 2006 3:10 pm
by pradkumar
Thanks

Posted: Thu Nov 09, 2006 3:15 pm
by dsscholar
pradkumar wrote:Thanks
Did it work ?? :?: