This content describes Snap 11. For Snap 10, the equivalent page will be in Snap 10 help

Next Topic

Book Contents

Book Index

Lists and ranges

There are three types of list used within Snap.

Lists are made up of single items (numbers, text enclosed in quotes or variables) or ranges of items.

A range of items consists of:

Type

Description

Numeric Lists

A numeric list comprises one or more numbers, or ranges of numbers.

The numbers may be prefixed with a minus sign and may represent either decimal or integer constants. For example:

1,3~5,7~9

123.45~1000

-9000 TO -8000

> 5

<10,>15

Numeric lists are used to define the permitted code values for variables with quantity responses. You would normally use numeric lists to define values for Valid codes, but you can also use them for No Reply definitions to ensure that values that are not valid are counted as No Reply rather than an error.

Alphanumeric Lists

An alphanumeric list comprises one or more items, or ranges of items.

Each item is made up of one or more characters. If an item includes any spaces, commas, single or double quotes or tildes (~), it must be enclosed in either matching single quotes (' ') or matching double quotes (" "). It is not possible for a single item to include both single and double quotes. Examples of valid lists:

A~Z, a~z, ' " ', " ' ", ' ', 99

Paris OR "New York"

"Harrod's", "Marks and Spencer", Hamleys

"BA" TO "CZ" OR "LL"

<> London

Alphanumeric lists are used to define the permitted code values for variables with literal response type. These could be alphanumeric variables or question variables. You would normally use alphanumeric lists to define values for Valid codes, but you can also use them for No Reply definitions to ensure that values that are not valid are counted as No Reply rather than an error.

When matching literals, note that the items are case-sensitive, and that the relational operator = will match substrings, so:

  • Q1 = "and" will return TRUE if the value of Q1 is "Marks and Spencer".
  • Q1 = "And" will return FALSE if the value of Q1 is "Marks and Spencer".
  • To match an item exactly, you need to use the relational operator.(Q1 == "and" will only return TRUE if the value of Q1 is "and".)

Variable Lists

Variable lists allow you to specify one or more variables, for example, in the analysis for a holecount or grid table or the definition of a hierarchical export layer. They comprise one or more variable names, or ranges of variables, separated by commas.

WinHelp: BombNote that when specifying ranges of variables, the range will be determined by the sequence numbers and not the names of the given variables. This means that changing the order of question variables or adding routing after defining your analysis may change the variables that are included in a range.

See Also

Numeric Expressions

Logical Expressions

Logical to Numerical Conversions

Date and time expressions

Literal expressions

Mask Expressions

Axis Expressions