This article describes how to go from a table with all cells being displayed...
...to one where any cell under a specified threshold has been removed or changed. In this example, the % is blanked based on the Count statistic being below 50:
- A table with rows and/or columns.
- A sample size statistic to use for the threshold.
1. Select your table.
2. Copy the name from Properties > GENERAL > Name.
3. Go to Calculation > Custom Code.
4. Paste the below under Properties > R CODE:
table = table.Q5
tab1 = table[,,"%"]
tab2 = table[,,"Count"]
tab1[tab2 <50] = NA
- The above code defines the table using the reference name from step 2.
- It then defines tab1 as a table with only the percentages and tab2 as a table with only the sample sizes.
- Finally, tab1 is returned whereby any cells where Count is below 50 are made blank.
5. Select this output and go to Properties > APPEARANCE > Number format to adjust decimal places and add a percentage sign.