How to use Functions in Reports in Pentaho

Last updated on Sep 27 2021
Jayesh Chettiyar

Table of Contents

How to use Functions in Reports in Pentaho

Pentaho – Functions

Each page of a report contains a Page-header area and a Page-footer area. The remaining page is available for the actual report content.
The page footer tab is used to present some attributes and functions. For example, we can print the max value of the age field of an employee in the Page-footer. The reporting engine allows these features by using functions.
Let us use the same employee table which we have used in the previous chapters. After adding all the fields into the report workspace, let us now add a function into the Page-footer tab to find out the maximum age of an employee.
Follow the steps given below to add a predefined function to your report.
Step 1 – Click the Function Button (fx)
Take a look at the following screenshot. Here the Data tab in the structure pane includes a symbol fx (marked as “1”). It is the add function button. Click this button to add different functions into the report.

pentaho 23
pentaho

Step 2 – Select a Particular Function
Then, you will find a dialog box with different functions segregated into different groups. To print the maximum age of an employee at the page footer, we should choose the Maximum function in the Summary group which is marked as “1” in the following screenshot. Select it and click OK.

pentaho 24
pentaho

Once you click the Ok button, the function will be added to the Functions label in the Structure Pane which is placed at the right side of the screen.
Step 3 – Define a Field Name
Once you select the added function (i.e. Maximum), you will find another pane below the structure pane containing the properties of that function.
Take a look at the following screen. The maximized box contains two pointers (Pointer 1 and Pointer 2).
Pointer 1 − Select the function in the data tab of the structure pane.
Pointer 2 − Edit the Field name in the properties section by selecting the age field from the dropdown list. It is because we have to print the maximum age of an employee.

pentaho 25
pentaho

Step 4 – Add a Function to Report Workspace
Now, the function is ready with the customized properties. Now you can use that function in your report as a page footer attribute.
Take a look at the following screenshot. Again, it contains two pointers (Pointer 1 and Pointer 2).
Pointer 1 − Select and drag the Maximum function from the Structure pane to the page footer band in the workspace, as shown in the following screenshot. Now the design of your report is ready.
Pointer 2 − Select the Preview button on the left side of the screen.

pentaho 26
pentaho

Step 5 – Check Preview
Take a look at the following screen. It shows the preview of the report. The maximum age of an employee is marked and shown in a maximized box.

pentaho 27
pentaho

Pentaho – Additional Functions

The following table provides an additional list of functions that you can use in your reports.

Common Functions
S.No. Function Name Purpose
1 Open Formula Enables you to create your own custom Open Formula function using the built-in Formula Editor.
2 Page Count the number of page used in report before rendering.
3 Total Page Count List the total number of pages in the rendered report.
4 Page of Pages Prints the current page number along with the total number of pages in the render report.
Report Functions
S.No. Function Name Purpose
1 Is Export Type Tests whether the given export type has been selected for this report.
2 Row Banding Alternates the background color of each item band in a group.
3 Hide Repeating Hides equal values in a group. Only the first changed value is printed.
4 Hide Page Header and Footer Hides the page header and footer bands when the output type is not pageable.
5 Show Page Footer Only shows the page footer on the last page rendered in the report.
Summary Functions
S.No. Function Name Purpose
1 Sum Calculates the sum of the selected numeric column.
2 Count Counts the total number of items contained in a group. If no group is specified, all items in the entire report are counted.
3 Count by Page Counts the total number of items contained in a group on one rendered page. If no group is specified, all items on the entire page are counted.
4 Group Count Counts the total number of items in the selected groups. If no group is specified, all items in all groups are counted.
5 Minimum Identifies the lowest or smallest value in a group.
6 Maximum Identifies the highest or largest value in a group.
7 Sum Quotient Performs simple division on the sum totals from two columns and returns a numeric value.
8 Sum Quotient Percent Performs simple division on the sum totals from two columns and returns a percentage value.
9 Calculation Stores the result of a calculation. This function is used in groups.
10 Count of pages Counts items on a page according to the specified criteria. This value is reset to zero when a new page is reached.
11 Sum of Pages Adds all of the specified items on one page and produces a total. This value is reset to zero when a new page is reached.
Running Functions
S.No. Function Name Purpose
1 Sum Calculates a running total sum of the specified column.
2 Count Count the items in a group or in a report.
3 Group Count Counts the number of groups in a report.
4 Count Distinct Counts the distinct occurrences of a certain value in a column.
5 Average Calculates the average value in a given column.
6 Minimum Identifies the lowest or smallest value in a column.
7 Maximum Identifies the highest or largest value in a column.
8 Percent of Total Calculates the percentage value of a numeric column. The total sum is divided by the number of items counted.
Advanced Functions
S.No. Function Name Purpose
1 Message Format Formats text according to the Java Message Format specification.
2 Resource Message Format Formats text from a resource bundle according to the Java Message Format specification.
3 Lookup Maps a string from one column to another string.
4 Indirect Lookup Returns a value from a mapped field.
5 Resource Bundle Lookup Performs a resource-bundle lookup using the value from the defined field as a key in the resource bundle.
6 Open Formula Enables you to create your own custom Open Formula function using the built-in Formula Editor.

So, this brings us to the end of blog. This Tecklearn ‘How to use Functions in Reports in Pentaho’ blog helps you with commonly asked questions if you are looking out for a job in Pentaho BI. If you wish to learn Pentaho BI and build a career in Business Intelligence domain, then check out our interactive, Pentaho BI Training, that comes with 24*7 support to guide you throughout your learning period. Please find the link for course details:

Pentaho BI Certification Training

Pentaho BI Training

About the Course

Pentaho BI Training from Tecklearn teaches you how to develop Business Intelligence (BI) dashboard using Pentaho BI tool from scratch. Pentaho is an open-source comprehensive BI suite and provides integration with Hadoop distribution for handling large dataset and doing reporting on top of it. This course explores the fundamentals of Pentaho Data integration, creating an OLAP Cube, integrating Pentaho BI suite with Hadoop, and much more through the best practices. Our Online Pentaho Training Course also provides real-time projects to enhance your skills and successfully clear the Pentaho Business Analytics Certification exam.

Why Should you take Pentaho BI Training?

• The average annual pay for a Pentaho Developer is $124828 a year. -ZipRecuiter.com.
• Around 2500 websites globally are using Pentaho BI and it has a market share of around 3% globally.
• Pentaho is a suite of Business Intelligence products, which provide data integration, OLAP services, reporting, dashboarding, data mining and ETL capabilities. Pentaho is a one stop solution for all business analytics needs.

What you will Learn in this Course?

Data Modelling
• Why need Data Modelling
• Data Modelling Scope and Benefits
• Data Model Analogy
• Case Study
Introduction to Pentaho BI Suite
• Overview of Pentaho Business Intelligence and Analytics tools
• Pentaho Data Integration (PDI)
• Pentaho Report Designer (PRD)
• Pentaho Metadata Editor (PME)
• Pentaho Schema Workbench (PSW)
• Dashboard Capabilities
Installation
• Installation of Java
• Installation steps for Pentaho ETL Tool
• Spoon Installation
• Spoon Overview
• Connection to Database
Retrieving Data from Flat or Raw Files using Pentaho
• Working with Flat Files or Delimited Files
• Different Use Cases
• Read Data from different Delimited Files using Pentaho
Clustering in Pentaho
• Basics of clustering in Pentaho Data Integration
• Creating a database connection
• Working with CSV Files
Pentaho Report Designer
• Designing Basic Report containing Graphical Chart
• Conditional Formatting and Studying the PRPT File Format
• Building a Basic Report in PDF Report
• Data Source Connection and Query Designer
• Working with Group (Group Header, Group Footer)
• API Based Reporting
Pentaho Data Integration – Transformation
• What is Data Transformation
• Step, Hop, Variable
• Various Input and Output Steps
• Transformation Steps, Big Data Steps and Scripting
Different Types of Transformation
• Transformation Steps in Detail
• Add sequence and use calculator
• Generating Output
• Data Validation
Slowly Changing Dimensions (SCD)
• Slowly Changing Dimensions,
• SCD Type I
• SCD Type II
• Deploying SCD
Pentaho Dashboard
• Pentaho Dashboard
• Passing parameters in Report and Dashboard
• Drill-down of Report
• Deploying Cubes for report creation
• Working with Excel sheets
• Pentaho Data integration for report creation
Understanding Cube
• What is a Cube
• Report and Dashboard creation with Cube
• Creation and benefits of Cube
Pentaho Analyzer
• Pentaho analytics for discovering
• Blending various data types and sizes
• Advanced analytics for visualizing data across multiple dimensions
Pentaho Data Integration (PDI) Development
• PDI steps used to create an ETL job
• PDI / Kettle steps to create an ETL transformation
Pentaho Administration
• Creating and Managing Users and Roles
• Security
• Performance Tuning
• Dashboard Creation with Advance Features

0 responses on "How to use Functions in Reports in Pentaho"

Leave a Message

Your email address will not be published. Required fields are marked *