When you show related data alongside each other, you can make it easier for your viewers to review the data by only showing the same categories and in the same order. This is especially helpful when comparing brands within a study. To match data across tables and charts, you can use the Select Matching Rows and /or Select Matching Columns rules. This enables you to do any of the following:
- Keep categories that match between tables.
- Sort one table by another.
- Only show rows or columns selected in a combo box control.
- Select rows or columns to show based on a separate Calculation.
This article walks you through the various functionalities of the rule. In this example, there are two tables: 1) Number of orders by brand and 2) Orders placed by meal by brand. You can go from the two tables below showing similar but different brands/categories:
To tables that show the same brands/categories in the sorted order. The final result allows a user to pick what brands to see in the tables, and those are sorted from highest to lowest based on the first table of Number of times ordered by brand:
Requirements
- A table that you can apply Rules to, such as a built-in drag and drop, basic R table, or Paste or Enter table.
- And an object that contains the row or column labels you want to show:
- A Combo or List box with the exact row labels as options
- Or a custom Calculation listing the rows to show (i.e.
c("Arnold's","Burger Chef")) - Or a table that rows should be matched to
Method
- Select the table you want to modify based on another item.
- In the object inspector, select Data > Rules > + > Row/Columns > Select Matching Rows (or Columns if desired). Note that Select matching Columns will affect Statistical Testing results.
- Hook the table up to your Combo box, List box, Calculation, or other Table using the Select rows using field.
- Choose how you want the rows ordered. Set Order rows based on to either:
- selected input - if you want rows to match the order of selections
- original order - if you want to keep the order already in your table
In this example, I Select rows using > Combo.box and Order rows based on >original order of the table since I sorted the original table to show the brands from highest to lowest.
Then I applied the rule to my second table showing meals for each brand so that Select rows using > table.Q5a and Order rows based on > selected input so that those brands aligned with those ordered most.
Next
Creating and Modifying Visualizations