Sorting data in a table can be done in various ways. If you don't want the sort order to update when your data updates, you can sort via the column's right-click menu > Sort menu. As with all changes done on a table via the right-click menu, this will change the sort order to match on all tables using the same variable set input. If you want the variable set sorted differently across tables based on the data shown in the individual table and the sort order updates when your data updates, you should use the Sort Rows or Sort Columns rule.
This article describes how to use the right-click > Sort menu on a table and variable set with a default sort order:
And sort it by a specific column or row label:
Requirements
- A Displayr document containing a table built by dragging and dropping variables onto a page or into the Report tree.
Method
- Select the table that you want to sort.
- Right-click on the column or row header that you want to sort by.
- Select Sort and then select one of the following options:
- Ascending (e.g., 1,2,3)
- Descending (e.g., 3,2,1)
- Categories Shown in Columns > By Labels > Ascending (e.g,. A, B, C)
- Categories Shown in Columns > By Labels > Descending (e.g., C, B, A)
- Categories Shown in Columns > By Pattern - Sorting by patterns is used to highlight significant patterns in the data. This is sometimes called "diagonalization".
- Categories Shown in Rows > By This Column's Values > Ascending > Select Statistic (e.g. 1,2,3)
- Categories Shown in Rows > By This Column's Values > Descending > Select Statistic (e.g. 3,2,1)
- Categories Shown in Rows > By Labels > Ascending (e.g., A, B, C)
- Categories Shown in Rows > By Labels > Descending (e.g,. C, B, A)
Note: If sorting by values, normally, you'll want to select the top statistic (e.g., %), because it is what will be displayed on the table by default. However, you can also sort by another statistic that is not currently shown on the table.
Next
How to Automatically Sort Rows and Columns
How to Automatically Sort Tables to Show Patterns in the Data