Operator Type:
Operator Scope of Action:
Operator Purpose:
Operator Data Type Returned:
Operator First Added:
Operator in Current Baseline:
Operator Altered Since Baseline:
Operator Uses Regular Expressions:
Operator Uses Scoped Arguments:
Operator Has Conditional Arguments:
Operator Has Newer Dot-Operator Variant:
Function [other Function type actions]
Group [operators of similar scope]
Data manipulation [other Data manipulation operators]
Number [about Number data type]
v4.6.0
Baseline
As at baseline
[More on regular expressions in Tinderbox]
[More on scoped arguments in Action Code]
[More on conditional operator arguments]
Yes
count_if(scope, condition)
Counts the number of notes in the list derived from scope that satisfy the evaluated query expression condition.
NOTE: where scope is a known List or Set type attribute reference, it is recommended and generally easier, and recommended, to use list.count_if().
scope describes the notes to be examined (defining scope).
condition is action code forming a valid conditional query test, i.e. it equates to true when matched. Some query-style operators terms may allow use of regular expressions.
This equivalent to use of sum_if(), as the next two code examples have the same result:
sum_if(group, condition,1)
but this is perhaps more easily understood as:
count_if(group, condition)
See also—notes linking to here: