This post is based on a thread posted in pentaho community forums.
Link :
http://forums.pentaho.com/showthread.php?192121-Incrementing-variable-values
Link :
http://forums.pentaho.com/showthread.php?192121-Incrementing-variable-values
Problem Statement :
Add row numbers to child values of a filed. ( the first field in the image is the input )
Java script :
var res = field.concat(seq); // con-cat the "field" column with "seq" column.
var indexOfParentValue=res.indexOf("ParentValue"); //identify the "String position" and returns 0 or -1
if(indexOfParentValue ==0){
var finalField=field;
}
else{
var finalField= res;
}
NOTE that compatibility mode is un-checked in MJavaScript Step.
Download : Download example here
I hope this helps - how to write java script methods in Kettle ETL.
- Sadakar Pochampalli
var res = field.concat(seq); // con-cat the "field" column with "seq" column.
var indexOfParentValue=res.indexOf("ParentValue"); //identify the "String position" and returns 0 or -1
if(indexOfParentValue ==0){
var finalField=field;
}
else{
var finalField= res;
}
NOTE that compatibility mode is un-checked in MJavaScript Step.
Download : Download example here
I hope this helps - how to write java script methods in Kettle ETL.
- Sadakar Pochampalli
Hitachi Vantara Pentaho - Bi Suite Tutorials: Pentaho Data Integration Use Case : Add Value Fields Changing Sequence And Java Script Concat And Indexof Methods Usage >>>>> Download Now
ReplyDelete>>>>> Download Full
Hitachi Vantara Pentaho - Bi Suite Tutorials: Pentaho Data Integration Use Case : Add Value Fields Changing Sequence And Java Script Concat And Indexof Methods Usage >>>>> Download LINK
>>>>> Download Now
Hitachi Vantara Pentaho - Bi Suite Tutorials: Pentaho Data Integration Use Case : Add Value Fields Changing Sequence And Java Script Concat And Indexof Methods Usage >>>>> Download Full
>>>>> Download LINK