There are various ways to hide rows and/or columns based on the sample size depending on the type of table you are using. Typically, you'd use a Table Rule, such as Hide Rows and Columns with Small Sample Sizes, but if you are using R to create your table or need more custom logic, you can do this using R code as described in this article. This article covers how to apply a Table Rule to hide rows or columns based on the sample size. It shows you how to go from a table or visualization showing all the rows and columns...
..to a one where entire rows and/or columns have a sample size below a specified threshold are hidden:
Requirements
- A table or visualization with at least one of the following statistics: Column Sample Size, Column n, Sample Size, or Base n.
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.
- Click Plus (+) > Rows/Columns > Hide Columns with Small Sample Sizes, Hide Rows and Columns with Small Sample Sizes, or Hide Rows with Small Sample Sizes.
- Specify the Minimum Sample Size.
- OPTIONAL: If you selected Hide Rows and Columns with Small Sample Sizes, both Hide Columns and Hide Rows are ticked by default, but you can untick one of these if necessary.
- OPTIONAL: You can additionally set the statistic to use for hiding rows and columns independently.
- Choose the appropriate statistic for hiding each selected dimension.
- Press OK.
Next
How to Filter Rows and Columns in Visualizations and Specialty Tables Without Code