in range selects from a list of attributes or groups whose values are within a specified range. The syntax is:

{ names } in range [lower, upper]

where:

names is a comma separated list of attribute or group attribute names,

lower and upper are numbers or constants defining the range.

A typical use of this function would be to create calculated value attribute that you could use as a variable expression in a comment. For example, you could define a calculated value attribute HighAllergens as

{birch, timothy, mugwort, cat, dog} in range [30, 50]

and the case would then appear as:

age				6
sex				F
birch       	50.0
timothy        63.5
mugwort		    12.1
cat				64.6
dog				25.3
HighAllergens	cat (64.6), timothy (63.5) and birch (50.0)

A comment could now be created that used the expression HighAllergens to list the allergens in the range [30,50].

Using Group Names

In the definition of a calculated value attribute, it may be more convenient to use group names rather than long lists of attribute names. For example, the definition of HighAllergens above could be more simply expressed as:

{pollen, animal} in range [30, 50]

Where pollen is a group attribute referring to birch, timothy and mugwort, and animal is a group attribute referring to cat and dog. This is completely equivalent to defining the list using attribute names. If you want the group names to be shown in the comment, rather than the attribute names, then use the function as groups from when defining
the variable expression in the comment. That is, insert the variable expression:

HighAllergens as groups from {pollen, food, animal, mite, mould}

into the comment.

Note the following:

  • The attribute names or group names whose values are highest are listed first,
  • If more than one attribute value is within the range, the attribute names and values are separated by commas,
    with the word “and” separating the last two.

See also:

ranges

as groups from