Hi Tobias and, again, thank you very much for your input.
Indeed, using fields would be cleaner but in my actual case I'm using
form tiddler plugin <http://tiddlywiki.abego-software.de/#FormTiddlerPlugin>
(along with data tiddler plugin)
<http://tiddlywiki.abego-software.de/#DataTiddlerPlugin> as a means of an
interface
to input values and I wouldn't know how to make that store data in generic
fields.
Also, in my actual wiki, years are taken into consideration, ie there are
separate data fields for days, months and years for each expense tiddler,
so the fet you provided does brilliantly what its asked to do: create a
table row for
each expense with the relevant fields. In my case they are sorted by date.
The thought was to create a table with a different perspective:
show me only twelve rows per year. Each represents a month.
Show me total month expenses, income, and their difference.
And show me the expenses and income sums in the course
of a year. Something like
expenses expense line income income line monthly result JAN 2014 379 379
374 374 -5 FEB 2014 231 610 374 748 143 MAR 2014 264 874 374
1.122 110 APRIL 2014 207 1.081 913 2.035 706 MAY 2014 491 1.572
368 2.403 -123 JUNE 2014 430 2.002 374 2.777 -56 JULY 2014 861
2.863 374 3.151 -487 AUG 2014 221 3.084 317 3.468 96 SEP 2014 945
4.029 929 4.397 -16 TOTAL
which in turn would be used to create a meaningful graph like this
which represents both monthly and total budget progression
In essence, the same fet you provided, but focusing on monthly sums.
Found this inline script
<script>
var out=[];
var sum=0;
var tids=store.getTaggedTiddlers('
timesheet');
for (var i=0; i<tids.length; i++){
var hr=tids[i].data("hours")*1;
if (isNaN(hr)) {sum = sum;}
else {sum=sum+hr;}
}
out.push(sum+' hours completed.');
return out.join('\n');
</script>
from this
<https://groups.google.com/forum/#!searchin/TiddlyWiki/script$20hours$20completed/tiddlywiki/xEuTGiw6xe8/yTRigFZrz_0J>
thread which will return the result for each tiddler tagged expense BUT I
don't know how to fliter in the appropriate tiddlers. In my case all
tiddlers are tagged with expense (and nothing else). If we write something
like
var tids=store.getTaggedTiddlers('
expense') && tiddler.data("month") == "Dec";
the script wont work.
A solution would be to make script check for specific words in the tiddler
text but I haven't found a way to do that.
I can define the appropriate tiddlers using a fet (fetch all the tiddlers
needed by writing
<<forEachTiddler
where
'tiddler.tags.contains("
expense") && tiddler.data("month") == "Dec"'
but I can't figure out how to get it to provide monthly totals.....
Finally, if a table like the one above could be created, the tiddler which
contains the graph data would, ideally, be automatically updated (upon
opening? clicking a button?)
4.029 €
4.397 €
368 €
Hope this makes some sense; my current wiki is in Greek, so an mtc will
probably make even less sense
but I will try to get an mtc in english...
again, Tobias, thank you very much for your help.
sklpns
PS. I am no expert but I do realize that TW is not supposed to replace
spreadsheet functionality.
But as far as, in this case, basic budget tracking is concerned, I feel it
definitely can and it would be awesome
to do it with my TW, alongside my other notes and combining it with them,
instead of a separate spreadsheet application.
--
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.