Hi,
Can anyone give example of how to use make_null() (replacing @null in server)and substring(replacing trim in server) in modify stage. I tried using them with following examples but its not working:
specification= new column=make_null()
specification= new column=substring[0,7](old column)
thanks in advance.
make_null and substring in modify stage.
Moderators: chulett, rschirm, roy
make_null and substring in modify stage.
Every person you meet knows something you don't, Learn from them.
-- H. Jackson Brown
-- H. Jackson Brown
-
- Charter Member
- Posts: 822
- Joined: Sat Sep 17, 2005 5:25 pm
- Location: USA
Code: Select all
IN_COL = make_null(OUT_COL)
This will replace the @null value in your source column. But i prefer using handle_null in conjuction with make_null to perform this, so as to convert it to '0' or any specific value.
IN_COL=handle_null(make_null(OUT_COL),0)
Code: Select all
IN_COL = substring[1,7](OUT_COL)
which extracts the first seven characters of the field OUT_COL
I haven't failed, I've found 10,000 ways that don't work.
Thomas Alva Edison(1847-1931)
Thomas Alva Edison(1847-1931)
-
- Charter Member
- Posts: 822
- Joined: Sat Sep 17, 2005 5:25 pm
- Location: USA
Code: Select all
IN_COL = make_null(OUT_COL)
This will replace the @null value in your source column. But i prefer using handle_null in conjuction with make_null to perform this, so as to convert it to '0' or any specific value.
IN_COL=handle_null(make_null(OUT_COL),0)
Code: Select all
IN_COL = substring[1,7](OUT_COL)
which extracts the first seven characters of the field OUT_COL
I haven't failed, I've found 10,000 ways that don't work.
Thomas Alva Edison(1847-1931)
Thomas Alva Edison(1847-1931)
Hey,
Thanks for reply. But the first one ( make_null) doesnt have an input column. @null in server is assigned in transformer when there is no input column present. Which contradictions what u r just said in modify stage make_null(input colum_name). Handle null is used to null the traget value if we have a null source value coming.
And coming to the 2nd question abt substring, the actual value pointer for substring starts with '0' not from '1'.
let me know if i missed something.
Thanks
Thanks for reply. But the first one ( make_null) doesnt have an input column. @null in server is assigned in transformer when there is no input column present. Which contradictions what u r just said in modify stage make_null(input colum_name). Handle null is used to null the traget value if we have a null source value coming.
And coming to the 2nd question abt substring, the actual value pointer for substring starts with '0' not from '1'.
let me know if i missed something.
Thanks
Every person you meet knows something you don't, Learn from them.
-- H. Jackson Brown
-- H. Jackson Brown