Using Variables In Selections: Selector Variables

A selector variable presents a pick list of categories for you to select from. They can be identified in the System explorer because they have a single green tick icon to the left of the variable name.

Selecting categories is easy. The default method is to search for and select the required categories using the Variable Picklist and clicking on the Include checkbox to highlight the ones you want. However:

Added in Q1 2024

It is possible for a selector variable to contain many hundreds, even thousands of categories and, in this case, there is the option to switch to the Text Values view and interact to select the required categories in the same way as you do when working with text type variables.

Let's consider both options.

Variable Picklist

To create a selection using the picklist, first create a new selection either by:

a. Clicking on the Selection icon in the Toolbox

b. Dragging the Selection tool from the Toolbox onto the FastStats workspace

c. Dragging the selector variable to use in the selection directly from the System explorer onto the FastStats workspace

Remember - it is best practice to set the resolve table on your selection before you start selecting criteria. See Selections: How do I change the counting table? for more on this.

If you used method a) or b) above to create a new selection, you will have a blank selection window similar to the one below.  


  1. Drag and drop the selector variable to use - e.g. Occupation - onto the selection window.

  1. Tick the categories to include in the selection

  1. Build the selection to see the count displayed in the bottom-right corner

Filter and search options

You can use the controls at the top of the picklist panel to filter and search in different ways:

The following shows the list filtered to show only the occupations whose descriptions contain the string ed.

Note:

  • You can select contiguous items by clicking and dragging.

  • You can also select a range of items by SHIFT clicking on the first and last items in the list of cells.

  • To select non-contiguous items in the list you can CTRL click each item to select on.

With the items you wish to choose highlighted, click any one of the selected Include boxes to mark all the selected items.

The reset button can be used to clear the selected items on a particular variable.  

The select all button can be used to select every category on a variable.  

The import button can be used to select a set of codes contained in a file.

In practice, it is sometimes easier to exclude the categories that you do not want rather than select all the items to include. To do this, highlight the items to exclude and choose Exclude from the Include/Exclude list-box. Note that excluded items are highlighted in a different colour than included items.

  1. With the values selected, click the Build button to count the selected records. The count is displayed in the bottom right hand corner of the selection window.

Text Values

To access and search for categories using text values, switch view using the icons at the bottom of the picklist panel:

The options at the bottom of the freeform panel allow you to determine how to select the required categories, including whether to search using the category codes or descriptions.

Selecting using this free-form mechanism brings a significant additional benefit - ensuring that, if new categories meeting the defined criteria are subsequently added to the data, they will also be picked up when the selection is re-run. This is not the case when you select using the variable picklist.

 

To learn more about working with text, see Using Variables In Selections: Text Variables