Learning objective: In this exercise you will generate a multi-page report using a loop. Inside the report, you will customize the header for each page using a flow variable.
Workflow description:
The same customer transaction data set from the demo is used in this exercise.
The Excel Reader node reads the customer transaction data.
The date column is processed by the Date&Time Processing metanode. This metanode retains the transactions on or later than 1-1-2019, and appends two columns: Year and Quarter.
The quarterly total sale is generated by the Pivot node, with Year and Quarter as rows and the classes of StoreType as columns. The aggregation method is the sum of Price.
Any missing values are replaced with zeros with the Missing Value node.
A new column QuarterAndYear is created by joining Year and Quarter by the Expression node.
The pivot columns are renamed as Online Store and Onsite Store by the Column Renamer node.
The Quarterly Sale Trend component plots the quarterly sale data in a stacked area chart, and produces a report. Open the component for more details. The Report Template Creator node is connected to the bottom input port of this component, propagating the orientation and the size of the report.
The generated report is saved to a PDF file by the Report PDF Writer node.