Hi Gurus,
I am a bit confused how to do this.. Please share your thoughts...
say i am getting 10 rows from source in which i have a column called row number.
Eg:-
rowno. model customerno. state
01 00 12334 IL
02 02 9876 CA
03 00 98767 LA
Now my requirement is - if in the column "model" when ever i see "02" i have to replace all the rows with "02" instead "00" like
rowno. model customerno. state
01 02 12334 IL
02 02 9876 CA
03 02 98767 LA
or if there is no "02" i have to just bring the "00" value.
How do i do that . Any thought would be appreciated.
Thanks in advance.
row value to be populated in all the fields
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 151
- Joined: Fri Feb 13, 2009 4:19 pm
Hi
I assue the following:
RowNumber -varchar
Model - varchar
Custnum - integer
state varchar2(2)
to convert all null model to '02' you can use a modify stage:
MODEL_NEW=HANDLE_NULL(MODEL, '02')
or if you think that the input is very less and you have a transformer, you can convert all the 00 to 02 and null's to 02. use a 'If Then Else' statement.
If IsNull(MODEL) Then "02" Else If MODEL = "00" Then "02" Else MODEL
I guess this should work.
I assue the following:
RowNumber -varchar
Model - varchar
Custnum - integer
state varchar2(2)
to convert all null model to '02' you can use a modify stage:
MODEL_NEW=HANDLE_NULL(MODEL, '02')
or if you think that the input is very less and you have a transformer, you can convert all the 00 to 02 and null's to 02. use a 'If Then Else' statement.
If IsNull(MODEL) Then "02" Else If MODEL = "00" Then "02" Else MODEL
I guess this should work.
Thanks
Karthick
Karthick