This article describes how take one question and filter it by the categories in another question. There are two ways one can do this using the automation based one what type of variable set you'd like in the end. With this you can create a variable set where:
- The original question structure is retained, and each variable's base is changed based on another question. One example may occur when variable(s) represents a brand and you wish to filter each by respondents who use that brand. When the filter condition is satisfied, the new variable(s) will take the same value as the old variable. When the filter condition is not satisfied, the new variable will be assigned a missing value. This removes the respondents who do not satisfy the filter from the base.
- A grid-type of question is created where multiple variables are created with the combinations of each category from each question filtered by the corresponding filter category.
This article walks through how to go from a Binary - Grid question in which all columns are based on a total sample...
....to a table in which each column (e.g., retailer) is rebased using another question (e.g., visited the retailer in the last 12 months).
Requirements
Please note these steps require a Displayr license.
- A variable or variable set to filter. This can be any variable or variable set in your document.
- A Nominal variable with mutually exclusive categories or a Binary - Multi variable set with to use as a filter.
Method
- From Data Sources, select the variable set you wish to filter.
- Go to Anything () in the toolbar, and select Filter > Filter One Variable Set by Another.
- In the first dialog box, select the variable set you want to filter (e.g., Q14x) then press OK.
- In the second dialog box, select the variable or variable set to use as a filter (e.g., Q8X) then press OK.
- If the variable selected in step 4 is both a single variable and tagged as Usable as a filter in the object inspector, you will be prompted to either:
- Select Yes to apply this filter to your entire variable set from step 3.
- Or No to create new variables for each of the categories in the filter variable.
- If the variable selected in step 4 is not a single filter variable or you select No at step 5, on the next screen, select one of the following:
- Select Yes to split out the variable set to filter from step 3 by each category in the filter variable set from step 4. This will break the first variable set down by each category in the filter variable set.
- Or select No to match labels between the first and and second variable sets to create one filtered variable for each match.
- If you selected No in step 5, Displayr will attempt to match the labels in both variable sets automatically. If it can't find a match for every label, it will prompt you to manually match them.
- Displayr will generate a new version of our question with the correct basing using the appropriate question label (e.g., Q14x filtered by Q8x).