• No results found

Comparison Functions

In document IBM SPSS Modeler 15 User s Guide (Page 145-147)

Comparison functions are used to comparefield values to each other or to a specified string. For example, you can check strings for equality using=. An example of string equality verification is: Class = "class 1".

For purposes of numeric comparison,greatermeans closer to positive infinity, andlesser means closer to negative infinity. That is, all negative numbers are less than any positive number.

Function Result Description

count_equal(ITEM1, LIST) Integer

Returns the number of values from a list offields that are equal toITEM1or null ifITEM1is null. For more information, see the topicSummarizing Multiple Fieldsin Chapter 7 on p. 115.

Function Result Description

count_greater_than(ITEM1, LIST) Integer

Returns the number of values from a list offields that are greater thanITEM1or null ifITEM1is null.

count_less_than(ITEM1,

LIST) Integer

Returns the number of values from a list offields that are less thanITEM1or null ifITEM1is null.

count_not_equal(ITEM1,

LIST) Integer

Returns the number of values from a list offields that are not equal toITEM1or null ifITEM1is null.

count_nulls(LIST) Integer Returns the number of null values from a list offields.

count_non_nulls(LIST) Integer Returns the number of non-null values from a list offields.

date_before(DATE1,

DATE2) Boolean

Used to check the ordering of date values. Returns a true value ifDATE1is beforeDATE2.

first_index(ITEM, LIST) Integer

Returns the index of thefirstfield containing ITEM from a LIST offields or 0 if the value is not found. Supported for string, integer, and real types only. For more information, see the topicWorking with Multiple-Response Datain Chapter 7 on p. 117.

first_non_null(LIST) Any Returns thefirst non-null value in the supplied list offields. All storage types supported.

first_non_null_index(LIST) Integer

Returns the index of thefirstfield in the specified LIST containing a non-null value or 0 if all values are null. All storage types are supported.

ITEM1 = ITEM2 Boolean Returns true for records whereITEM1is equal toITEM2.

ITEM1 /= ITEM2 Boolean Returns true if the two strings are not identical or 0 if they are identical.

ITEM1 < ITEM2 Boolean Returns true for records whereITEM1is less thanITEM2.

ITEM1 <= ITEM2 Boolean Returns true for records whereITEM1is less than or equal toITEM2.

ITEM1 > ITEM2 Boolean Returns true for records whereITEM1is greater than

ITEM2.

ITEM1 >= ITEM2 Boolean Returns true for records whereITEM1is greater than or equal toITEM2.

last_index(ITEM, LIST) Integer

Returns the index of the lastfield containing ITEM from a LIST offields or 0 if the value is not found. Supported for string, integer, and real types only. For more information, see the topicWorking with Multiple-Response Datain Chapter 7 on p. 117.

last_non_null(LIST) Any Returns the last non-null value in the supplied list ofAll storage types supported. fields.

last_non_null_index(LIST) Integer

Returns the index of the lastfield in the specified LIST containing a non-null value or 0 if all values are null. All storage types are supported.

max(ITEM1, ITEM2) Any Returns the greater of the two items—ITEM1orITEM2.

max_index(LIST) Integer

Returns the index of thefield containing the maximum value from a list of numericfields or 0 if all values are null. For example, if the thirdfield listed contains the maximum, the index value 3 is returned. If multiplefields contain the maximum value, the one listedfirst (leftmost) is returned. For more information, see the topicWorking with Multiple-Response Datain Chapter 7 on p. 117.

137 CLEM Language Reference Function Result Description

max_n(LIST) Number

Returns the maximum value from a list of numericfields or null if all of thefield values are null. For more information, see the topicSummarizing Multiple Fieldsin Chapter 7 on p. 115.

member(ITEM, LIST) Boolean

Returns true ifITEMis a member of the specifiedLIST. Otherwise, a false value is returned. A list offield names can also be specified. For more information, see the topicSummarizing Multiple Fieldsin Chapter 7 on p. 115.

min(ITEM1, ITEM2) Any Returns the lesser of the two items—ITEM1orITEM2.

min_index(LIST) Integer

Returns the index of thefield containing the minimum value from a list of numericfields or 0 if all values are null. For example, if the thirdfield listed contains the minimum, the index value 3 is returned. If multiplefields contain the minimum value, the one listedfirst (leftmost) is returned. For more information, see the topicWorking with Multiple-Response Datain Chapter 7 on p. 117.

min_n(LIST) Number Returns the minimum value from a list of numericfields or null if all of thefield values are null.

time_before(TIME1,

TIME2) Boolean

Used to check the ordering of time values. Returns a true value ifTIME1is beforeTIME2.

value_at(INT, LIST)

Returns the value of each listedfield at offset INT or NULL if the offset is outside the range of valid values (that is, less than 1 or greater than the number of listedfields). All storage types supported.

In document IBM SPSS Modeler 15 User s Guide (Page 145-147)