Problem Statement :
Get first sting in below text value in a field
"Children out of school, primary, female"
Solution :
Children out of school
Tool set : PDI 5.3 CE, Excel Data File(or Table input)
1) Get data from input file or input table ( Input-> Table input step).
Note that the filed name is : indicator_name from which we want to get first string from a comma separated text.
2) Take Modified Java Script Value step (Scripting -> MJSV) and write below expression
var indicator_sub_name = indicator_name.split(",")[0]
* Hop Table input to MJSV
* After writing expression click on "Get fields" button in MJSV
* The variable will be a new stream filed to the next step
3) Add select values step and preview the transformation.( ignore the unwanted fields in ignore tab).
Quick Image:
Hope this tip helps some one ...!!!
:-)
Get first sting in below text value in a field
"Children out of school, primary, female"
Solution :
Children out of school
Tool set : PDI 5.3 CE, Excel Data File(or Table input)
1) Get data from input file or input table ( Input-> Table input step).
Note that the filed name is : indicator_name from which we want to get first string from a comma separated text.
2) Take Modified Java Script Value step (Scripting -> MJSV) and write below expression
var indicator_sub_name = indicator_name.split(",")[0]
* Hop Table input to MJSV
* After writing expression click on "Get fields" button in MJSV
* The variable will be a new stream filed to the next step
3) Add select values step and preview the transformation.( ignore the unwanted fields in ignore tab).
Quick Image:
Hope this tip helps some one ...!!!
:-)
No comments:
Post a Comment