User's Manual

117
Building CLEM Expressions
Working with Multiple-Response Data
A n umber of comparison functions can be used to analyze multiple-response da ta, including:
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 exa mple, suppose a multiple-response q uestion asked for the rst, second, and third
most important reasons for deciding on a particular purchase (for example, price, personal
recommendation, review, local supplier, other). In this case, y ou might determine the imp ortance
of price by derivi ng the index of the eld in which it was rs t included :
first_index("price", [Reason1 Reason2 Reason3])
Similarl y, suppose you have asked customers to rank three cars in order of likelihood to purchase
and c oded the responses in thre e separate elds, 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 eld for the car they like mo st (ranked #1, or
the lowest rank) using the min_index function:
min_index(['car1' 'car2' 'car3'])
For more information, see the topic Comparison Functions in C hapter 8 on p. 135.
Referencing Multiple-Response Sets
The special @MULTI_RESPONSE_SET function can be used to refe r ence all of the elds in a
multiple-response set. For example , if the three car elds in the previous example are included in
a m ultiple-r esponse set named car_rankings, the following would return the same result:
max_index(@MULTI_RESPONSE_SET("car_rankings"))
The Expression Builder
You can type CLEM expressions manually or use the Expression Builder, which displays a
complete list of CLEM functions and operators as well as data elds from th e current stream,
allowing you to quick ly build expressions without memorizing the exact names of elds or