Skip to main content

Cell Dynamic Attributes-Sorting Practice

1. Overview

This article will详细介绍模板单元格中的"排序"功能及其配置使用方法。我们将通过一个具体的排序案例来展示如何有效实践。

本教程所使用的案例数据集如下:财务汇总表.xlsx

排序的视频讲解,详见动态属性-排序

1.1. Application Scenarios

When you need to arrange and display data in ascending or descending order, you need to use the sorting functionality, which is the cell S attribute (Sort).

Note: It's recommended to perform sorting in the data preparation stage of Chinese-style Reports. See [Data Preparation](../1-Chinese-style Reports Pro Usage Process.md#2.%20Data Preparation).

1.2. Function Introduction

Sorting is used to set the arrangement order of data columns, supporting ascending (S=Asc), descending (S=Desc), and no sorting (S=None) three methods, with no sorting as default.

Priority Note: Dynamic attribute sorting priority is higher than data preparation stage sorting, that is, when sorting is set in both data preparation and dynamic attributes, dynamic attribute sorting takes effect and data preparation sorting becomes invalid. If you want data preparation sorting to take effect, you need to set sorting to no sorting in dynamic attributes.

1.3. Case Effects

Financial summary table header sorting: "Primary Account" and "Secondary Account" are arranged vertically according to custom order, and quarters and months are arranged horizontally in ascending order.

2. Implementation Approach

  1. Date fields: Quarters and months are both date type fields in the view, generally recommended to set sorting methods in templates.

  2. Text fields: Text type fields (especially Chinese) generally use custom sorting more, but S attribute doesn't support custom sorting, recommended to sort fields in advance in the view.

3. Operation Steps

  1. Sort text type dimension fields in the view:

    1. Create a Chinese-style report, in the "Data Preparation" page, drag view fields into the sorting area.
    2. Click on the field that needs sorting (e.g., "Primary Account"), select "Custom Sorting" from the dropdown, and drag to sort in the dialog box.

    3. Repeat the previous sub-step to perform custom sorting on "Secondary Account".

  2. Set sorting for date fields in the template.

    1. Drag the required fields into cells, set "Ascending" sorting for "Quarter" and "Month" respectively in the dynamic attributes popup.
    2. After completion, click "Preview" in the upper right corner to view the effect.

    排序2.gif

4. Notes

  • Sorting temporarily only supports dimension fields. Template cells with equal signs (=) (i.e., numeric fields dragged in) contain aggregate calculations themselves and temporarily do not support sorting, they can only follow the parent cell's sorting method for display.
  • For numeric fields, it's recommended to sort numeric aggregate results in advance in the view during the data preparation stage.