Overview
Description
Grouped reports may have various subtotals, totals, and lists. In this case, you may wonder how to sort them layer by layer according to each grouping.
As shown in the following figure, you can sort the Salesperson Subtotal first, then the Product Type Subtotal, and finally the Product List.
Solution
The sorting of different values is totaled based on the left parent cell, so you can use the Sort After Expansion function on the corresponding left parent cell to make it.
Example
Data Preparation
Create a general report, create a database query ds1, and enter the SQL statement SELECT * FROM Sales_Volume WHERE Region='North China'.
Report Design
Table Content
Drag the data columns from ds1 into the table, and enter the formula SUM(D2) in cell D3, and SUM(D3) in cell D4, as shown in the following figure.
Left Parent Cell Setting
Set the left parent cell of cells B3 and D3 to B2, and cells A4 and D4 to A2.
Taking the left parent cell of B3 as an example, the steps are shown in the following figure.
Sort After Expansion Setting
The following table describes specific settings.
Cell | Sort After Expansion | Sorting Formula |
A2 | Ascend | D4 |
B2 | Ascend | D3 |
C2 | Ascend | D2 |
Effect Display
On PC
Save the template and click Pagination Preview. The preview effect is shown in the following figure.
On Mobile Terminals
The template can be previewed on both the mobile and HTML5 apps. The effect is shown in the following figure.
Template Download
You can download the template.Sort by group summary.cpt