A. Your rule
$Text=sum_if(children,$WordCount>0,$WordCount)
is more complicated than it needs to be. What you want to do is, simple, add up the word count for all of the children. You don’t need a conditional to do that!
$Text=sum(children,$WordCount)
B. Suppose you want the word count of all the children of some other container – perhaps /Chapter One. Then your rule would be
$Text=sum(children(/Chapter One),$WordCount)
C. If you’re using the built-in prototype Dashboard note, it draws its $Name as a label and draws its $Subtitle as a big green display. So, your dashboard might look nicer with
$Subtitle=sum(children(/Chapter One),$WordCount)
D. I like to separate data collection actions from display actions, primarily in order to be able to see intermediate results. That way, if I don’t immediately see what I expect, I can look at those intermediate results to discover whether I’m doing the calculation wrong, or whether I’ve got the display wrong. Easy enough:
$MyNumber=sum(children(/Chapter One),$WordCount); $Subtitle=$MyNumber;
E. Finally, word counts tend to be big numbers, and if we’re going to gild the lilly, it might be nice to format them. In English, it’s more legible to write “19,671” for the word count than to leave it as “19671”. As I recall, in France people prefer “19 671”. Fortunately, Tinderbox knows all this, and it’s easy to format!
$MyNumber=sum(children(/Chapter One),$WordCount); $Subtitle=$MyNumber.format(“l”);