Report example -- use BIRT for irregular month statistics and report example birt

Source: Internet
Author: User

Report example -- use BIRT for irregular month statistics and report example birt

Source: http://developer.actuate.com/community/forum/index.php? /Topic/36323-months-and-quarters-group-issue/

Irregular month statistics: If the start time is, select to as a group and select to as a group. If the start time is, 2014-02-27 will be used as a group, and to will be used as a group.

Code of the Set calculator:


A1: queries the database based on the start and end times. startDate and endDate are external parameters.

A2: calculates the month interval based on the start time and end time. For example, 2014-01-31 and 2014-07-31 are separated by six months.

B2: calculates the start date of an irregular month based on the start time and date interval, and inserts the start time into 1st bits. "|" Indicates merging, "~" Indicates the current member in the set, that is, numbers 1 to 6. The After function can correctly calculate the irregular month. The result is as follows:


A3: group A1 by B2, calculate the sales of irregular months, and use B2 as the last column. The interval G function returns the interval number of the data .~. ~ In sum (Amount ~ Indicates the current group after the group. # Indicates the current A1 Group number. The calculation result is as follows:

A4: extract the 2nd and 3rd columns of A3 and return them to the report tool. The assembler provides a JDBC interface. The report tool recognizes the assembler as a common database.

 

Here we use BIRT to design a simple list table:


The method of the report call set calculator is the same as that of the call stored procedure. For example, if you save this script as BirtUnregulMonth. dfx, you can use callBirtUnregulMonth (?,?) in the BIRT Stored Procedure designer (?,?) . The following table is displayed after preview:


Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

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.