This version is out of date, covering development as far as v4.2.5. It is maintained here only for inbound reference links from elsewhere. Jump to the current version of aTbRef. |
A Tinderbox Reference File : Actions & Rules : sum_if() operator |
sum_if() operator |
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 |
Licensed under Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
[See aTbRef CC licence Attribution/Waiver info info]