This article describes how to go from a default table output:
To a table that shows only selected rows and columns:
Requirements
A Displayr document with a data set.
Please note this requires the Data Stories module or a Displayr license.
Method
- Create a new table by dragging a variable onto the page or select an existing table.
- With the table selected, go to Table > Select.
- From the object inspector, go to Data > TABLE 1 and use the Select rows by dropdown to indicate how you would like to indicate what you would like to include/exclude from the table. Details of each selection are noted below.
- Repeat Step 3 for Select columns by.
Select rows/columns by dropdowns include the following options and their respective actions:
- The default selection option is Typing labels to exclude whereby every row and column apart from NET and SUM will be selected by default. You can select and deselect the items you wish to include.
- Typing labels to include - here you will type the rows/columns that you would like to include in the Rows to include/Columns to include fields exactly as they appear in the table, each separated by a semi-colon. Displayr defaults to automatically include all rows/columns when this is selected.
- Range - Use this option to specify a numeric range of indices to include. When selected, a text box Range appears for specifying the row/column numbers to include. Ranges are specified with a hyphen and multiple ranges can be separated by a comma; eg, "2-5,8,12-15".
- First rows/columns - If this method is chosen, a numeric field called Number of rows/columns to select appears, which specifies the number of rows/columns from the first to include; eg, specify 3 to show only the first three rows/columns of the table. Note, you can also access this option directly from the toolbar via Calculation > First.
- Last rows/columns - Similar to First rows/columns, except for selecting rows/columns from the bottom of the table. Note, you can also access this option directly from the toolbar via Calculation > Last.
- Control or output from Page(s) - If this method is chosen, a drop-down called Control to select row(s)/column(s) appears, which can be used to supply a Calculation (via Calculation > Custom Code) or Control box (via Anything > Page Design > Control) containing the row/column labels to include.
The following options are available when date/time variables are present in the rows/columns of the table:
-
First date-time periods - This method can we used when the row/columns labels of the table contain dates to select. Three additional controls appear in this case:
- Date-time period specifies the date-time unit/period to consider, e.g. "Year", "Month", "Quarter", etc.
- First date-time periods to select specifies the number of periods from the first date in the table to include
- Calendar - If this is checked then the date-time periods selected will be relative to the calendar, e.g., the first quarter is always January - March. If unchecked, then date-time periods are counted relative to the first date in the table.
- Last date-time periods - Similar to "First date-time periods", except for selecting dates in relation to the last date in the table.
- Date range - If this option is selected, two controls appear Start date and End date, and only rows with dates falling between the chosen start and end dates will appear in the output table.
OPTIONAL: Update Appearance > APPEARANCE > Decimals and Number format as required.
See How to Switch Between Tables via a Control Box when selecting more than one table.
Note that the output table is an R table and will not perform the significance testing included with other tables.
Next
How to Select Specific Rows and Columns to Appear in a Date/Time Table
How to Switch Between Tables via a Control Box