After completing this lesson, you will be able to enable an entity to support aggregation and add a chart to the list report
Transformation Aggregation
For the charts to work, the entity set must support aggregation. SAP Fiori elements supports the transformation aggregation methods such as standard aggregation and custom aggregation.
Transformation Aggregation that Uses Standard Aggregation Methods
To enable the analytical capabilities the entity must be annotated with @Aggregation.ApplySupported. The collection of the @Analytics.AggregatedProperty annotation must list all the aggregatable measures or aggregation methods that are used. For more information, see Transformation Aggregation. For more information on the CAP documentation, see Transformations.
Add a Chart to the List Report of the Manage Travels App
Usage Scenario
In this exercise, the objective is to add aggregate capabilities to the service so that you can add analytical capabilities to the list report page and make it an analytical list page.
The user will be able to see the total number of distinct travels grouped by Customer country. The user can also filter the table by selecting visualization in the chart.
Task Flow
First, you will enhance Travel service with the CDS @Aggregation.ApplySupported annotation, in which you can define GroupableProperties and AggregatableProperties. Once the service is enhanced, you can use the Add Chart functionality in the Page Editor. Finally, you can add the i18n labels to the chart using the Page Editor.
To enable all features in the analytical list page in the Node.js runtime, we've switched on the new OData parser (odata_new_parser: true), which is still experimental.
Some features such as grouping in the analytical table is not available if you use the ALP with the standard OData parser. For more information, see SAP Fiori Analytical List Page for SFlight.
Watch the Simulation and Perform the Steps
This exercise contains a simulation that takes you through all the steps described below. You can follow the simulation and perform the steps using your own trial account.