<< Click to Display Table of Contents >> Control Table Field Sorting via Script |
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.
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.
❖Sort By Multiple Columns
When table 1.sortExclude=0 or table 1.sortExclude=EXCLUDE_NULL, the ordering between fields has no effect.
❖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:
❖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.