How to divide the value of one filter by another filter value, and on one line

Dear friends

We can divide one filter by another decimal

[!is[system]get[text]split[]!is[blank]count[]divide[2.5]]

It doesn’t seem to be possible to divide one filter by another, or my syntax is wrong

[!is[system]get[text]split[]!is[blank]count[]divide[!is[system]sort[title]count[]]]

However, when using the widget, it can display normally. Could it be that the single-line filtering does not support complex nested relationships?

<$set name="number-of-tiddlers" value={{{ [!is[system]sort[title]count[]] }}}>
 <$text text=<<number-of-tiddlers>>/> Average word count per article: <$text text={{{ [!is[system]get[text]split[]!is[blank]count[]sum[]divide<number-of-tiddlers>fixed[3]] }}}/> words
</$set>

Any reply would be greatly appreciated

No, you can’t use a filter run as the parameter of an operator; you’d have to store the result as a variable and use that. Since this doesn’t work in Advanced Search, try using power[-1] and product instead:

[!is[system]get[text]split[]!is[blank]count[]] [!is[system]count[]power[-1]] +[product[]]

Note that there’s no reason to sort the second filter run (non-system tiddlers), since you only need the count.

1 Like

Thank you very much, everything works fine with the filter