Runtime configurability
The number of possible visualizations for a single pivot table data model is huge. Instead of providing a separate file for each variant, you can define RTL expressions to create the different variants at runtime.
The demo report DynamicPivotTable.4rp uses RTL expressions to create dimensions and measures at runtime. See Sample pivot table reports.
Consider a table with the dimensions “Country”, “Salesperson” and “Year” and the measure “Turnover”.
- Total Turnover by Country
- Total Turnover by Country and Salesperson
- Total Turnover by Country, Salesperson and Year
- Total Turnover by Country and Year
- Total Turnover by Country, Year and Salesperson
- Total Turnover by Salesperson
- Total Turnover by Salesperson and Year
- Total Turnover by Salesperson, Year and Country
- Total Turnover by Salesperson and Country
- Total Turnover by Salesperson, Country and Year
- Total Turnover by Year
- Total Turnover by Year and Country
- Total Turnover by Year, Country and Salesperson
- Total Turnover by Year and Salesperson
- Total Turnover by Year, Salesperson and Country
If we add two more measures “Margin” and “Cost”, the number of variations is multiplied by two as we can now view “Total Margin by …” and “Total Cost by ..” for all existing variations.
If we compute not only the total but also the average and the maximum, the number is again multiplied by two, as we can now view “Average Turnover by ..” and “Maximum Turnover by ..”
If we sort the output by some measure and display only the top n items, the number of options is again multiplied by the number of measures and n, since we can produce view such as “Top 3 Selling Countries” or “Top 5 Salespersons regarding margin”.
The number of variants could be multiplied by the 20+ drawing options (specified by the drawAs property).
Instead of having to provide a separate 4rp
file for each variant, the
implementation of pivot tables allows the creation of pivot table models containing a larger amount
of dimensions and measures which will likely never be displayed as a whole. From the static setup,
one can then select dimensions and measures for display via selection properties. By defining RTL
expression for these properties, one can create the different variants described at runtime.