Pentaho is a business intelligence and data integration platform, and you can use JavaScript in various components and steps, such as in transformations or filters, to manipulate data. To filter rows in Pentaho using JavaScript, you can follow these general steps:
Here are the steps:
STEP1: Start by creating a new transformation in Pentaho Data Integration (PDI) Spoon. A transformation is where you will define the data filtering process.
STEP2: Add a input step. This could be a CSV file input, a database table, or any other source.
Here I am taking Csv file input for example.
STEP3:
Add a “Modified Java Script value” step to your transformation from left design tab. This step will be used to write the JavaScript code to filter rows.
Now open the JavaScript step to configure it. In the “Script” tab, you can write JavaScript code that filters rows based on your criteria. The JavaScript step has access to the data and can modify or filter rows as needed.
For Ex:
Assuming a group of players took part in a quiz game, and that their scores are in an input CSV file, and now with Java Script will figure out who is qualified and who is eliminated.
Now Press ok in bottom to save and exit script or you can test your script.
STEP4:
Now add output file and define output format ex: CSV or text file
And connect all of them.
Execute the transformation to filter the rows based on the JavaScript code you wrote in the JavaScript step.
CONCLUSION:
By this Method you can filter out Output by using Java Script in Pentaho.
Thank You
Sharath Chandra Polkam
Helical IT Solutions
Best Open Source Business Intelligence Software Helical Insight is Here