collect_if(group,condition,attribute)

Tinderbox Icon


Operator Type:   Set creation
Operator Scope of Action:   Conditional Group

A function collect_if() builds sets. (See collect() for a related new operator.

collect_if(where,condition,attribute)

builds a set by collecting all the notes corresponding to where, testing each note to see if it meets condition, and adding the value of the designated attribute to the set.

where may be any of {child,descendent,sibling,ancestor,all}. In addition, where may be argument that designates a particular (single) note other than this.

condition is a valid conditional test - i.e. it equates to true when matched.

what can be any expression, but is typically an attribute.

For example,

collect_if(child,$Status=="Important",$Name) 

will construct a set of the names of all of this note's important children.

Note that collect_if's function is related to agents; many tasks you might perform with collect_if could be done as well, or better, with an agent.


Up: Conditional Group-based operators
Previous: avg_if(group,condition,value)  Next: sum_if(group,condition,value) 

[Last updated: 14 Dec 2009, using v5.0]

Google search aTbRef for:  

Licensed under Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
[See aTbRef CC licence Attribution/Waiver info info]

Creative Commons License

Made with Tinderbox