You sometimes need to specify a reference to a note relative to something else, like the current note. Group designators are a set of generic relative references to, or placeholders for, a group [sic] of notes whose actual identity is context sensitive. Group designators are written with lower case starting letters and inter-capitalised if multiword; e.g. sibling. Usage is case sensitive.
Unlike item designators, group designators may not be use for specifying attribute path references.
Thus, for a word count of the current note's children you use:
$MyCount=sum(descendants,WordCount)
In older versions this would have required using an export code:
$MyCount=^sum(descendants,WordCount)^
Some action operators and export codes work on groups of notes. These can use group designators in place of literal lists (or attribute-stored lists).
If a group is empty, e.g. the current note has no children, the group operator returns the equivalent value/boolean for the current note instead.
It is perfectly valid for a group designator to return a single item, if only one item meets the criteria of the designator. A container with only one child note with return list containing only item reference for its 'children'. Conversely, (single) item-scope designators must return a single item reference.
- [literal group assignment lists]
- $ID value
- adorments
- all
- ancestors
- children
- descendants
- find(condition)
- siblings
See also—notes linking to here:
- Export Code Arguments
- Conditional Group-based operators
- Group-based operators
- find(scope)
- List-based operators
- Left side expressions
- Defining 'group' list objects—one or more items—in action code
- Item Note Designators
- avg_if(scope, condition, expressionStr)
- collect(scope, expressionStr)
- sum_if(scope, condition, expressionStr)
- every(scope, condition)
- avg(scope, expressionStr)
- Designators in actions
- collect_if(scope, condition, expressionStr)
- Designators
- any(scope, condition)