This article describes how to create a complete data variable that can be used in a sample size widget. A complete data variable is a variable that has missing values for any observations that are not in the sample that you are describing.
If you have a chart that shows filtered data, then it will not be appropriate to use the same variable as the one in your chart, because that variable does not contain enough information about the sample shown in the chart. One approach is to create a new variable that has missing values for people who are not included on your page.
For example, I have a page showing charts or tables only for the Males in my sample. In such a case, I can use the filter variable to define my sample.
A filter variable.
- Select the filter in the Data Sets tree.
- OPTIONAL: Copy it by selecting Duplicate from the toolbar. This is not strictly necessary, but, for organization, it's sometimes helpful to keep multiple distinct copies of filter variables when they need to be used for different purposes.
- With the original filter or copy selected in the Data Sets tree, click Properties > DATA VALUES > Missing values from the object inspector.
- For any categories that are not included in the sample, change the setting in the Missing Values column to Exclude from analyses, and click OK.
The new variable can be used as the Complete Data Variable in the sample size widget.