About cookies on this site Our websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising. For more information, please review your options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.
Last updated: Feb 11, 2025
You can analyze multiple-response data using a number of comparison functions.
Available comparison functions include:
value_at
first_index / last_index
first_non_null / last_non_null
first_non_null_index / last_non_null_index
min_index / max_index
For example, suppose a multiple-response question asked for the first, second, and third most important reasons for deciding on a particular purchase (for example, price, personal recommendation, review, local supplier, other). In this case, you might determine the importance of price by deriving the index of the field in which it was first included:
first_index("price", [Reason1 Reason2 Reason3])
Similarly, suppose you asked customers to rank three cars in order of likelihood to purchase and coded the responses in three separate fields, as follows:
customer id | car1 | car2 | car3 |
---|---|---|---|
101 | 1 | 3 | 2 |
102 | 3 | 2 | 1 |
103 | 2 | 3 | 1 |
In this case, you could determine the index of the field for the car they like
most (ranked #1, or the lowest rank) using the
function:min_index
min_index(['car1' 'car2' 'car3'])
See Comparison functions for more information.
Referencing multiple-response sets
The special
function can be used to
reference all of the fields in a multiple-response set. For example, if the three car fields
in the previous example are included in a multiple-response set named car_rankings, the
following would return the same result:@MULTI_RESPONSE_SET
max_index(@MULTI_RESPONSE_SET("car_rankings"))
Was the topic helpful?
0/1000