Multi-Level Sequence Number

  • Last update:November 13, 2023
  • Overview

    Preview Effect

    During report design, you may need to generate multi-level sequence numbers based on multiple columns of data. The preview effect is as shown in the following figure.

    多级序号 图1.png

    Implementation Method

    First obtain the deduplicated sequence number of each data record in the first column.

    Then obtain the sequence number of each data record in the second column after data records whose corresponding value in the first column are the same are deduplicated in the second column.

    Concatenate the mapping sequence numbers obtained in the first and second data columns.

    Example

    Data Preparation

    Create a dataset named ds1. The database query statement is SELECT * FROM department.

    多级序号 图2.png

    Report Design

    (1) Design the table style as shown in the following figure. Set Data Setting to List for cell B2, and Left Parent Cell to B2 for cell A2.

    多级序号 图3.png

    (2) Enter the formula in cell A2:

    INARRAY(B2,UNIQUEARRAY(B2[!0]))+"."+INARRAY(C2,UNIQUEARRAY(C2[!0]{B2=$B2}))

    多级序号 图4.png

    Effect Preview

    (1) PC

    Save the report and click Pagination Preview. Then the multi-level sequence number effect is shown in the following figure.

    多级序号 图1.png

    (2) Mobile Terminal

    多级序号 图5.png

    Template Download

    For details, you can click to download Multi-Level Sequence Number.cpt.

    Notes

    If sequence numbers need to generated for data in a third column (D2), set Left Parent Cell to C2 for cell A2. The formula is INARRAY(B2,UNIQUEARRAY(B2[!0]))+"."+INARRAY(C2,UNIQUEARRAY(C2 [!0]{B2=$B2}))+"."+INARRAY(D2,UNIQUEARRAY(D2[!0]{B2=$B2&&C2=$C2})).

    If sequence numbers need to generated for data in a fourth column (D2), set Left Parent Cell to D2 for cell A2. The formula is INARRAY(B2,UNIQUEARRAY(B2[!0]))+"."+INARRAY(C2,UNIQUEARRAY(C2 [!0]{B2=$B2}))+"."+INARRAY(D2,UNIQUEARRAY(D2[!0]{B2=$B2&&C2=$C2}))+"."+INARRAY(E2,UNIQUEARRAY( E2[!0]{B2=$B2&&C2=$C2&&D2=$D2})).

    The rest can be deducted from the above rules.

    Attachment List


    Theme: Report Features
    Already the First
    Already the Last
    • 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