Control Table Field Sorting via Script

<< Click to Display Table of Contents >>

Current:  Create Dashboard > Table > Visual Analysis 

Control Table Field Sorting via Script

Previous pageReturn to chapter overviewNext page

Users can control the ordering relationship between the fields of a table through a script. After selecting the component, select Settings - Script in the right panel, and enter the script in the On Load tab, as shown in the following figure. There are three sorting relations between fields, Sort By Multiple Columns, Sort By One Column, and Exclusive Measure Sort.

sort1

Use table 1.sortExclude=x to control the ordering relationship between fields.

Table 1. sortExclude=0 or table 1.sortExclude=EXCLUDE_NULL, Sort By Multiple Columns;

Table 1. sortExclude=1 or Table 1.sortExclude= EXCLUDE_ALL, Sort By One Column.

When Table 1.sortExclude=2 or Table 1.sortExclude=EXCLUDE_MEASURE, only the sorting between the metrics fields is mutually exclusive, which has nothing to do with the sorting of the dimension fields.

If the data in a table is as shown in the following figure, the field bound in the first column is a dimension field, and the fields bound in other columns are metric fields.

sort2

Sort By Multiple Columns

When table 1.sortExclude=0 or table 1.sortExclude=EXCLUDE_NULL, the ordering between fields has no effect.

sort3

Sort By One Column

When Table 1.sortExclude=1 or Table 1.sortExclude= EXCLUDE_ALL, all fields are mutually exclusive.

The ordering between dimensions and metrics fields is mutually exclusive, that is, only one field can be sorted, as shown in the following figure:

sort4

Exclusive Measure Sort

When table 1.sortExclude=2 or table 1.sortExclude=EXCLUDE_MEASURE, only the sorting between the metrics fields is mutually exclusive, which has nothing to do with the sorting of the dimension fields.

The metric fields are mutually exclusive, that is, only one metric field can be sorted. As shown in the following figure, if the user field is not activated after being sorted in ascending order, the ascending ordering of the valid user segment becomes disordered, and the descending order of the user segment is reported. Sorting also becomes disordered.

sort5