Page 1 of 1

Check for an Integer and null

Posted: Fri Feb 15, 2008 1:17 am
by vilasini
Hi Friends,

I have one field which is Varchar datatype in source and I need to check if it is not null and if it not an integer I have to set it to null else populate the same and write error msg.But my output column is an Integer and I have used If IsNotNull(input.field) and Num(input.field) in stage variable(sv) and
in output column :If sv then input.field else 0.

and I also tried in other way round,eventhough I am getting the warning like this.

APT_CombinedOperatorController(4),3: Null string argument.

I am not using basic trnasfomer.

Can anyone help me how to check for an Integer of varchar datatype and numeric.

Thanks in Advance
Anju

Posted: Fri Feb 15, 2008 2:23 am
by ArndW
What exact derivations have you used, please copy & paste them since the data in your post isn't complete.

Posted: Fri Feb 15, 2008 3:23 am
by stefanfrost1
Remember that a stage varible cant contain NULLs so a tip is to first convert any null to something else and use that stage varible in you derivation later.

Usually that warning indicates that you are evalulating a column which has null and that operation does not allow NULLs

Posted: Fri Feb 15, 2008 3:46 am
by vilasini
Thanks for your response.

I have tried in ouput column derivation :
If NOT(ISNULL(input.field)) Then Num(input.field Else NullToZero(input.field).

I got the same warning and again I tried with
If NOT(ISNULL(input.field)) Then StringTodecimal(input.field,"round_inf") Else NullToZero(input.field)

So I got conversion from string to deciaml warning.

Can anyone suggest me on this.

Anju

Posted: Fri Feb 15, 2008 6:49 am
by vilasini
Thanks,its working fine as I have used other functions.

Posted: Fri Feb 15, 2008 7:22 am
by chulett
What 'other functions'? Please come back, mark the thread as Resolved and let us know how it was resolved - this helps people right away and future searchers benefit as well. :wink:

Posted: Tue Aug 05, 2008 5:25 am
by vilasini
I have used NOT(IsNull(AsInteger(inputfiled)))