Thanks for the prompt reply!

As you correctly surmise I am comfortable with some "simple"
programming... but I can't get your script to come back with any
result (and I have tried several variations - and I did have the
plugin already installed).

Perhaps I should give a bit more detail:
The tiddlers all have different titles but the same tag.
There are actually 5 different fields in each tiddler containing a
value (time in minutes).
So basically, all I need for my original attempt to work is to know
how many tiddlers have that specific tag.


On Jul 21, 12:50 pm, Eric Shulman <[email protected]> wrote:
> > I have a number of tiddlers containing a data field e.g. Cost and I
> > have been trying to use ForEachTiddlerMacro to produce a final total
> > of all the Costs.
>
> ...
>
> From the description of what you have attempted, it sounds like you
> are at least somewhat comfortable with some simple programming
> techniques...
>
> If that is the case, then I suggest that you use
>    http://www.TiddlyTools.com/#InlineJavascriptPlugin
>
> then, you can write something like this:
> <script>
>    var tids=store.getTiddlers('title');
>    var count=0; var total=0;
>    for (var i=0; i<tids.length; i++) {
>       var d=store.getValue(tids[i].title,'cost');
>       if (d) { count++; total+=parseInt(d); }
>    }
>    if (count) return total;
> </script>
>
> Note: use of 'store.getValue()' assumes you are using a 'custom
> tiddler field' to hold the data.  If you are using a 3rd-party plugin,
> such as DataPlugin, then you will, of course, need to use the
> appropriate plugin-defined function to retrieve the data value from
> the tiddler.  Nonetheless, the rest of the above code should be the
> same.
>
> enjoy,
> -e
> Eric Shulman
> TiddlyTools / ELS Design Studios
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/TiddlyWiki?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to