How To Use Java Script In Pentaho

Posted on by By admin, in Pentaho | 0

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.

How To Use Java Script  In Pentaho

STEP2:
Add a input step. This could be a CSV file input, a database table, or any other source.

How To Use Java Script  In Pentaho

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.

How To Use Java Script  In Pentaho

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:

How To Use Java Script  In Pentaho

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.

How To Use Java Script  In Pentaho

STEP4:

Now add output file and define output format ex: CSV or text file
And connect all of them.

How To Use Java Script  In Pentaho

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

logo

Best Open Source Business Intelligence Software Helical Insight is Here

logo

A Business Intelligence Framework

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments