PB gird data window: group, group subtotal, total, and gird data window

Source: Internet
Author: User

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.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.