sum_if() operator

Tinderbox Icon

A v4.0.0 operator sum_if() adds lists. (See sum() for a related new operator)

sum_if(where,condition,what)

visits each note described by where, testing if it meets the condition and adds the value of the designated attribute to the total.

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,

sum(child,$Type="New Feature",$WordCount)

constructs the current word count of all of the children of the note that are of the Type 'New Feature'. Note the value of the condition tested is quoted as the string contains a space.


Up: Actions & Rules
Previous: sum() operator  Next: do() operator for macros 

[Last updated: 3 Dec 2008]

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