Use of ranking in report Builder

Source: Internet
Author: User

The column types in report Builder include formula column, summary column, and percentage column. Generally, many formula columns and summary columns are used. The following describes the usage of ranking.

In the previous application, 20 formula columns are required for the value, and each formula column uses the same SQL statement of the from and where clauses. The only difference is that the obtained fields are different. This requires 20 database read operations, which is slow. At the beginning, we considered using another query, but there was no clear connection relationship, which could not be achieved.

Finally, I decided to study the ranking. I will not go into details about the specific process and introduce the implementation methods.

1. First, create a formula column with 19 ranking items named CF_1, cp_2, cp_3 ......, Cp_20.

2. In the PL/SQL statement of the formula column, all values are retrieved once:

 

Select col1, col2, col3 ...... Col20

Into v_col1,: cp_2,: cp_3 ...... : Cp_20

From Table1

Where t_date = sysdate and t_dept =: P_1;

Return v_col1;

 

In the ranking list, no PL/SQL statements are written.

3. When editing the report page, the ranking column is used as the data source of the domain.

Advantage: Only one database read operation is required, which is faster. Because the main logic is put in the formula column CF_1, it is easy to maintain.

Note the column order. It is best to place the CF_1 formula column before the percentage column. In fact, the ranking is used as a variable to facilitate programming and maintenance.

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.