The listProduct function iterates over a list and evaluates a statement for each list iteration. listProduct returns the product of the evaluated statements.
set list: DRINKS
randomize: y
1. Wine
2. Beer
3. Coffee
4. Water
5. How many served drinks or bottles of each kind of beverage did you consume last week?
instructions: Your best guess is fine.
type: radio table
optsfrom: series[1..10]
rowsfrom: DRINKS
PRODUCT. The product of all answers of T5
type: coded number
cvalue: listProduct(DRINKS; $Q5R[id])
Tip! Not sure which list function is best suited for your needs? Review all list functions here.
Details
-
In its most basic form,
listProductaccepts two inputs: a list name and a field reference constructed with the '[id]' placeholder. - Options can be filtered in or out of the list with inclusion/exclusion syntax.
-
listProductcan be used with conditional statements such asshow ifandconditionas well as withcvalue. - When multiple lists or conditions are used, the list name is prefixed to the
[id]reference and separated by a colon, (e.g.,[LISTNAME:id]). Prefixing clarifies list references and is necessary for the software to iterate across different lists. - Though not explicitly tied to tables, table references are imagined to be the most common usage.
Tip! List functions can reference any list type. For derived lists referencing a table, use a leading 'T'.
Comments
0 comments
Please sign in to leave a comment.