In my own solution I actually used
```
''total:'' <$text text={{{ [fields[]regexp[aaa]]
:map[all[tiddlers]get<currentTiddler>] +[sum[]] }}}/>
```
and I got 1077!!! The source of error was two tiddlers have field `aaa2`
and my filter accounted for one! because the way `:map` works!!
On Friday, December 17, 2021 at 9:27:37 AM UTC+3:30 Mohammad wrote:
>
>> [fields[]regexp[aaa]] :map[all[tiddlers]get<currentTiddler>sum[]] +[sum[]]
>>
>>
>> or to match your output:
>>
>> ''total:'' <$text text={{{ [fields[]regexp[aaa]]
>> :map[all[tiddlers]get<currentTiddler>sum[]] +[sum[]] }}}/>
>>
>>
>>>
> Brian,
>
> This is a bit tricky! I did myself before I saw your solution and I got
> wrong total sum! The reason was
> :map returns one result per input (e.g. the input it receives from
> [fields[]regexp[aaa]], its upstream filter run)
> Your trick here is you have used sum twice! and I think here it makes
> sense, as you are calculating sum of sum or total sum!
> Nice solution! Worth to be documented!
>
> Best wishes
> Mohammad
>
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/df2c478c-645f-4e40-8d81-d3e5e6b6c2e3n%40googlegroups.com.