Hello all,

Is there a simple way to sum up a particular field of tiddlers that match a 
filter and then display the result?

For instance, I have a tiddlywiki that I am trying to make into an 
invoicing tool. The following tiddlercode is in the monthly invoice tiddler:

<table>
<tr>
<th>Date</th>
<th>Task Name</th>
<th>Hours</th>
</tr>
{{{[field:year[2014]field:month[06]sort[day]]||expandInvoice}}}
</table> 

to build the invoice table (June 2014 in this instance) and the 
'expandInvoice' tiddler is:

<tr>
<td>''{{!!year}}-{{!!month}}-{{!!day}}''</td>
<td>''{{!!name}}''</td>
<td align="right">''{{!!hours}}''</td>
</tr>

to build each row in the matched tiddlers.

What I would love to do would be to simply add up all the 'hours' fields of 
each matched tiddler and display it in the invoice. I suspect it might take 
a little embedded javascript script but my javascript-foo is weak, I'm 
afraid. I also suspect that some conversion of text to number format would 
have to take place since the tiddler fields don't seem to be a particular 
type.

Could anyone point me to an example or share a code snippet that I could 
borrow for my purposes?

Thanks,
/Mike

-- 
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/d/optout.

Reply via email to