This article describes how to go from a standard table...
...to a table or visualization with an additional column that computes the difference between specified columns:
Requirements
- A table or visualization with multiple columns.
Note: You must apply the rule directly to the input table if you see a table icon in the Data > Data Source > Data field in the object inspector of a visualization.
You will also see a warning in the Rules section of the object inspector if you have applied a rule directly to a non-compatible visualization, and you will need to apply it to the input table instead. For example:
Method
- Select your table or visualization.
- Go to Data > Rules in the object inspector
.
- Select the Plus (+) > Calculation > Add Difference Between a Pair of Columns.
- OPTIONAL: Select the Statistic to use (if different from the default).
- By default, it is set to choose selections by Label, but this can be changed to Column Position. The latter option allows you to choose specific columns based on the first column (for benchmarking) and the position from the end (for dynamic referencing). This ensures, for example, the last 2 columns are always used, even when a further column is added to the end.
- Select the column under Column 1 to compute the difference from.
- Select the column under Column 2 to compare against.
- OPTIONAL: Untick Label new column automatically and enter new label.
- OPTIONAL: Tick Replace table with difference to only show this new column.
- Choose whether to show blank cells as blank or NaN.
- Press OK.
This rule calculates the difference between these two columns and displays it to the right of the second column. Note, this rule can only apply to a single statistic, and no significance tests are conducted on these cells. It is also not compatible with tables that have column spans.
Note, if you select Switch rows and columns on your table, the rule will no longer work due to the table dimensions changing. In this case, you will have to apply the Add Difference Between a Pair of Rows rule instead.