PB gird data window: group, group subtotal, total, and gird data window
Today, we have a requirement. The gird table data is as follows:
Department |
Type |
Data |
A |
Type 1 |
1 |
A |
Type 2 |
2 |
B |
Type 1 |
3 |
B |
Type 2 |
4 |
|
Total |
10 |
The actual result is as follows:
Department |
Type |
Data |
A |
Type 1 |
1 |
A |
Type 2 |
2 |
|
Subtotal |
3 |
B |
Type 1 |
3 |
B |
Type 2 |
4 |
|
Subtotal |
7 |
|
Total |
10 |
The preceding requirements are generally handled in three ways:
1. The database directly generates group data. This method is used to process data from the data source. The advantage is that you do not need to group the data in the DW window. Otherwise, the aggregate and subtotal data are repeatedly retrieved in the database, which is not conducive to performance optimization.
2. Use DW's group DW to create the group display interface. Do not describe it if it is not used.
3. Use the gird data window for grouping. This is the main method described today;
1) insert the Group field: Row-> Create-Group. If the Group field is set to "department", a Group is generated with the Group name: 1.
2 ). select Detail and perform the sum (Sum and count fields: "data"). Click Insert-> Control-> sum, in this case, sum (data for group 1) is generated in the Trailer Group "department" Data container, and the subtotal generation function for the Department data is completed.
3). Aggregate Function. Like other gird data windows, this function inserts a computing column in the Summary container with the following content: sum (data) to generate a total calculation column.