Sorting data in a table can be done in various ways depending on how the table is created. For our built-in drag and drop tables, you can sort via the column's right click menu > Sort menu or via the table rule Sort Rows (Automatically Updates When Data Changes). 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 variable set. If you want the variable set sorted differently across tables based on the data shown in the individual table, you should use the Sort Rows rule.
This article describes how to use the right click > Sort menu to take a table with a default sort order:
And sort it by a specific column or row:
Requirements
- A Displayr document containing a table built by dragging and dropping variables from a Data Set that you want to sort.
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)
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 Table Rows
How to Sort Labels in an Ascending or Descending Order
How to Sort Columns for Entered or Pasted Tables
How to Sort Rows for Entered or Pasted Tables
How to Automatically Sort Tables to Show Patterns in the Data