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?
instruct: 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,
listProduct
accepts 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.
-
listProduct
can be used with conditional statements such asshowif
andcondition
as 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 and sum calculations across different lists. - Though not explicitly tied to tables, table references are imagined to be the most common usage.
Comments
0 comments
Please sign in to leave a comment.