[]
        
(Showing Draft Content)

Sort Data

Sorting is the most commonly used operation for data analysis. Users can sort the data by one or more columns, alphabetically or numerically, in ascending or descending order. Sorting helps users to organize, better understand, and quickly visualize the data in a table.

For example, you might want to arrange the following list of highest 20 claim payouts in ascending order of policy number.

Highest 20 Payout Sample Report

Or, you might want to arrange the data in groups (i.e. policy type - new and renewal) in ascending order of policy number.

Highest 20 Payout Grouped Sample Report

Note: Sorting applied on a group has higher precedence than the sorting applied on a table.

To Apply Sort in a Table Data Region

Follow the below steps to sort the data in a table and group.

Apply Sort to a Table

  1. Select the table and go to the Properties panel on the right.

  2. Under the Data section, find the Sort Expressions property. This property contains the name of the field or an expression based on which you want to sort the data.

  3. Click the Add Item button and choose the desired field from the Data Binding dropdown. The dropdown lists all the available fields in the bound dataset. You can also add expressions.

    For example, select the PolicyNumber field from the Data Binding dropdown.

    Specifying the sort expression for the table

    Alternatively, select the Details group from the Group pane, and go to the Sort Expressions property under the Data section.

    Specifying the sort expression for the table

    Use the Show Items button to display the list of sort items for the selected table.

  4. Choose whether to sort the data in ascending or descending order through the Sort button. The default order is ascending.

  5. Preview the report.

    This is how the table looks like when you sort the data in increasing order of policy number.

    Table with sorting applied

Apply Sort to a Group

The following steps assume that you have already added a group to the Table data region.

  1. From the Groups pane, select the details group.
    Applying sort to the details group helps in organizing the data within the groups.

  2. Under the Data section, find the Sort Expressions property. This property contains the name of the field or an expression based on which you want to sort the data.

  3. Click the Add Item button and choose the desired field from the Data Binding dropdown. The dropdown lists all the available fields in the bound dataset. You can also add expressions.

    For example, select the PolicyNumber field from the Data Binding dropdown.

    Specifying the sort expression for the table

  4. Choose whether to sort the data in ascending or descending order through the Sort button. The default order is ascending.

  5. Preview the report.

    The group is now sorted alphabetically in decreasing order of policy type.

    Group with sorting applied

To Apply Interactive Sort in a Table Data Region

Interactive sort enables you to sort the data for table and group when you preview a report. It adds interactive sort buttons on the chosen column header and allows you to toggle between the increasing and decreasing sorting order.

Apply Interactive Sort to a Table

  1. Select the column header cell according to which you want to sort the data. For example, select the header cell of PolicyType column.

  2. Go to the Properties panel on the right and find the Sort Expression property. This property contains the name of the field or an expression based on which you want to sort the data.

  3. Choose the desired field from the Data Binding dropdown. The dropdown lists all the available fields in the bound dataset. You can also add expressions.

    For example, select the PolicyNumber field from the Data Binding dropdown.

    Specifying the sort expression for the table

  4. Specify the scope to which you want to apply the sort in the Sort Expression Scope property. The only possible value for this property is the currently selected table name.

  5. Choose whether to set the Sort Target property to the dataset or table.

  6. Preview the report.

    This is how a table will appear when you apply an interactive sort to it.

    Table with sorting applied

Apply Interactive Sort to a Group

The following steps assume that you have already added a group to the Table data region.

  1. Select the group header cell where you want to add the interactive sort buttons.

  2. Go to the Properties panel and find the Sort Expression property under the User Sort section. This property contains the name of the field or an expression based on which you want to sort the data.

  3. Choose the desired field from the Data Binding dropdown. The dropdown lists all the available fields in the bound dataset. You can also add expressions.

    For example, select the PolicyNumber field from the Data Binding dropdown.

    Specifying the sort expression for the table

  4. Specify the scope to which you want to apply the sort in the Sort Expression Scope property. The possible values are the currently selected table name and its associated group(s). Set the Sort Expression Scope property to the desired group name.

  5. Choose whether to set the Sort Target property to dataset, table, or group.

  6. Preview the report.

    This is how a table will appear when you apply an interactive sort to a group. Only the data within the specific group is sorted, rest of the data in the table remains unchanged.

    Table with sorting applied