The listMin
function iterates through a list and finds the field with the smallest value.
2. How many children to you have?
type: radio
optsfrom: series[1..10]
3. Enter each child’s age in years.
instructions: If you are expecting a child or if they are under 1 year old, enter 0 for age.
type: integer table
range: 0-17
showrowtag: n
rowsfrom: series[1..10] {if [id]<=$Q2} {text: Child [id]}
setterm: Q3_TERM
condition: (listMin(series[1..10]; $Q3R[id])) > 10
text: Q3 | Age of youngest child is older than 10 years old
Tip! Not sure which list function is best suited for your needs? Review all list functions here.
Details
-
In its most basic form,
listMin
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.
-
listMin
can be used with conditional statements such asshowif
andcondition
, as shown above, 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 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'.
Additional examples
Finding the minimum value from multiple lists
In this example, listMin
uses two lists to calculate the cvalue
at QMIN. Both lists are derived from Q3's inline lists. Each list name is prefixed to the [id]
reference where the list will be iterated through (the rows and columns [id]
placeholders) and separated by a colon.
3. How many devices did you purchase last year, this year, and plan to purchase next year?
type: pulldown table
optsfrom: series[0..10]
cols:
1. Last year
2. This year
3. Next year
rows:
1. Lenovo
2. Apple
3. Dell
4. Toshiba
MIN. The smallest value in T3
type: coded number
cvalue: listMin(T3.rows, T3.columns; $Q3R[T3.rows:id]C[T3.columns:id])
Comments
0 comments
Please sign in to leave a comment.