Sometimes you may want to show the sample size of each category in the column headers of your table, and in turn, the axis or legend of a visualization. There is a built-in table rule that will add the Column Sample Size or Column Population to the headers of your table, which will also show the sample size alongside the categories in any visualization you create. This article describes how to go from a crosstab without sample size shown...
...to a table and visualization with the Column Sample Size displayed in the column labels:
and a visualization with the Column Sample Size shown in the legend:
Requirements
A table with rows and columns.
This does not apply for tables that do not have the Statistics - Below available. You may choose to show the weighted sample sizes (Column Population) rather than the Column n.
Method
1. Select your table.
2. Go to Data > RULES on the object inspector.
3. To apply the rule, select the Plus (+) > Modify Headers > Add Column Sample Size to Column Labels.
4. Enter the desired prefix text in Text to show in header that will appear in front of each sample size figure. By default this is n =.
5. OPTIONAL: Tick Show weighted sample size (Population) if you have a weight applied to your table and wish to display the weighted sample size instead.
6. Press OK.
7. Either from the table's object inspector or the toolbar, select Visualization > Bar > Bar (or whatever visualization you like) to create a visualization from the table. You will see the sample size is shown in the legend of the visualization.
8. If your NET is also now showing in the visualization and you want to remove it, you can either right click on the NET in the table and Hide it, or use the object inspector > Data > Column Manipulations > Number of columns from left to show to an appropriate value.
Next
Caveats and Limitations for Rules
How To Create a QScript To Insert a Custom Rule
How to Add Column Comparison Letter to Column Labels