Level-by-Level Accumulation

  • Last update:  2023-11-07
  • Overview

    Note: In 11.0.4 and later versions, users are advised to use the ACCSUM function to achieve cross-level accumulation.

    Application Scenario

    Layer-by-layer accumulation is to add the data of the previous level to that of each level in each group of the grouped report to obtain the cumulative result (separated by year) at this level.

    For example, as shown in the following figure, level-by-level accumulation is performed on the data grouped by year (2010 and 2011).

     逐层累计 图1.png

    Implementation Method

    Relative hierarchical coordinates are introduced in the calculation formula.

    Example

    Data Preparation

    Create a general report and create a data query named ds1. The SQL statement is as follows:

    SELECT STRFTIME('%Y', Order Date) AS Year, STRFTIME('%m', Order Date) AS Month, Amount Due

    FROM Order

    WHERE STRFTIME('%Y',Order Date) IN ('2010','2011')

     逐层累计 图2.png

    Report Design

    Design the table as shown in the following figure. Drag the fields in ds1 to cells A2, B2, and C2. Perform layer-by-layer accumulation for cell D2.

     逐层累计 图3.png

    Enter the condition summary formula C2 + D2[B2:-1] for cell D2. The following table describes the formula.

    FormulaDescription

    D2[B2:-1]

    Represents the value of cell D2 corresponding to the previous cell (last month) expanded from cell B2.

    C2 + D2[B2:-1]

    Represents the cumulative amount of the previous month plus the amount of the current month in cell C2 within a year.

    Effect Preview

    Save the template and click Pagination Preview. Then the preview effect is shown in the following figure.

     逐层累计 图1.png

    The template can be previewed on the app/HTML5 terminal, as shown in the following figure.

     逐层累计 图4.jpg

    Template Download

    For details, you can click to download Level-by-Level Accumulation.cpt.

    Attachment List


    Theme: Report Features
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy