Filter a List Using a Computation Variable
If you are using a Computation variable to create a repeated list, you can filter the REPEAT instruction in a Computation variable by using the FILTER COMPUTATION_VAR instruction. (See Filter a List of Answers.)
A filter can be as complicated as it needs to be, but it must result in either true or false. For example, the expression YEARS FROM( Child's Birth Date, TODAY ) produces a number (the age of a person), not a true or false value—it is not a filter. But the expression YEARS FROM( Child's Birth Date, TODAY ) <= 17 can only result in true or false. It can correctly filter all children under the age of 18 from a list.
To filter a REPEAT instruction in a Computation variable
- FILTER COMPUTATION_VAR Instruction models Script
- Computation Variable Components
- New Component Computation Editor
- Script OK Components
""
REPEAT Tour Information
ASCEND Tour City
FILTER New York Appearances
RESULT + Tour City + ", " + Tour State + ", " + Tour Venue + "
"
END REPEAT
The New York Appearances filter contains the script, Tour State CONTAINS "new york"
When you use a script to merge a list of answers that have been gathered using a REPEAT, you must first set the computation to a starting value. This value must be a 0 if the result will be a number, or it must be "" if the result will be text.