all,
i'm using two stagevariables as mentioned below.
Stagvar1:
If ((IsNotNull(Column1)) or (IsNotNull(Column2)) Then '0' Else '-100'
Stagvar2:
If (IsNull(Column3)) Then '-Z' Else (If (IsValid('Date', StringToDate(Column3,"%yyyy%mm%dd"))) Then '0' Else '-200')
stagvar3:
If stagvar1<>0 Then stagvar1 Else If stagvar2<>0 Then stagvar2 Else'1'
when i validate more than one Columns in the Stagvar1: its Not producing expected result.If i validate only single column then its ok.I dont understand whats happening.I think its not supporting 'OR' statement itself.Everytime i am getting return value as '1',when i pass Null value into Column1 or Column2. what would be the problem. Suggest.
StageVariables:Null handling
Moderators: chulett, rschirm, roy
StageVariables:Null handling
Aquilis
Re: StageVariables:Null handling
Didnt quite understand what you meant by 'validate more than one Columns'.Aquilis wrote:all,
i'm using two stagevariables as mentioned below.
Stagvar1:
If ((IsNotNull(Column1)) or (IsNotNull(Column2)) Then '0' Else '-100'
Stagvar2:
If (IsNull(Column3)) Then '-Z' Else (If (IsValid('Date', StringToDate(Column3,"%yyyy%mm%dd"))) Then '0' Else '-200')
stagvar3:
If stagvar1<>0 Then stagvar1 Else If stagvar2<>0 Then stagvar2 Else'1'
when i validate more than one Columns in the Stagvar1: its Not producing expected result.If i validate only single column then its ok.I dont understand whats happening.I think its not supporting 'OR' statement itself.Everytime i am getting return value as '1',when i pass Null value into Column1 or Column2. what would be the problem. Suggest.
You have specified an Or condition in your first stage variable which will produce the following results :
Column1 = NULL,Column2 = <non null value>, return value = 1
Column1 = <non null value>,Column2 = NULL , return value = 1
Column1 = NULL,Column2 = NULL , return value = 0
Column1 = <non null value>,Column2 = <non null value> , return value = 1
I am not sure about your business requirement but maybe changing that 'Or' to 'And' should address your concern which will return a 1 only if both columns have a non null value.