Jeremy, I think my TWtcalc plugin can help on this (see http://twtable.tiddlyspace.com/#TWtcalc--Example--IF_and_COUNT for an example). It has a simple parser that recognizes predefined function names (aliases possible) and does calculations according to their definitions. It is currently equipped with about 15 predefined functions, including sum, avg, etc., and is quite easy to extend. Currently it works on TiddlyWiki tables using the OpenOffice.calc/Excel like syntax, but I think to accomplish what's mentioned in the ticket, the followings would do:
1. take the core functions (parser and evaluator) that work on plain text, maybe modify the syntax analyzer to work with the fields things; 2. take the predefined function set, reduce/modify to work with fields; 3. design the syntax and modify the codes that handles fields to make use of the functions taken in step 1 (most likely only one is needed, the TWtcalc.evaluate(txt, start [,...]) function) Step 1 and 2 are easy for me, just need to know how to take values from fields. If some one can do step 3 then it should be done. Have fun! Vincent On Wednesday, December 4, 2013 10:02:46 PM UTC+8, Jeremy Ruston wrote: > > Hi Jeff > > None of that is implemented today, but is planned. Your examples are very > useful, so I've transferred them to a ticket: > > https://github.com/Jermolene/TiddlyWiki5/issues/254 > > Many thanks > > Jeremy. > > > On Tue, Dec 3, 2013 at 9:34 PM, <[email protected] <javascript:>> wrote: > >> In TW5, is it possible to sum the values of a field from multiple >> tiddlers? >> >> Something like: >> title: Project Finances >> >> [tag[expense]sum[cost]] --> 150 >> >> --- >> >> title: Expense A >> tag:expense >> cost:100 >> >> --- >> >> title: Expense B >> tag:expense >> cost:50 >> >> >> In general, is there (will there be) operators for (numerical) fields >> such as sum, average, greater than, less than, equal to, etc? >> >> Just throwing out more ideas that come to mind: >> >> title: Project Finances >> Budget:200 >> expenseA:100 >> expenseB:50 >> expenseC:200 >> >> >> {{expenseA + expenseB}} --> 150 >> >> or >> >> [title[Project Finances]sum[expenseA, expenseB]] --> 150 >> >> or >> >> [title[Project Finances]sum[fieldsearch[expense*]]] --> 350 >> >> or >> >> [title[Project Finances]avg[expenseA, expenseB]] --> 75 >> >> or >> >> [title[Project Finances]calc[Budget - sum[expenseA, expenseB]]] --> 50 >> >> -Jeff >> >> >> -- >> 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] <javascript:>. >> To post to this group, send email to [email protected]<javascript:> >> . >> Visit this group at http://groups.google.com/group/tiddlywiki. >> For more options, visit https://groups.google.com/groups/opt_out. >> > > > > -- > Jeremy Ruston > mailto:[email protected] <javascript:> > -- 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 post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/tiddlywiki. For more options, visit https://groups.google.com/groups/opt_out.

