A lot of beginners have the misapprehension that data tiddlers are the main structure for handling data. But data tiddlers are actually an after thought. If you look at the list of available filter operators for data tiddlers, there’s almost nothing – just 3 or four.
In Tiddlywiki, the main data structure is the tiddler, and there are dozens of filter operators to manage tiddlers.
So if you make 3 tiddlers:
item1
item2
labor
and give them each an expense field:
expense: 50
expense: 2500
expense: 700
Then you can sum them up just like this:
{{{ [has[expense]get[expense]sum[]] }}}
Any solution with data tiddlers will be somewhat more complicated. If your data tiddler is called ‘data’, then you can get the sum of all values like this:
<$vars sum-it="[add<accumulator>]">
{{{ [[data]indexes[]] :map[[data]getindex<currentTiddler>] +[reduce<sum-it>] }}}
</$vars>
So, not too bad, now that we have the map filter expression. But for the long term, I would still consider using tiddlers.