field manipulation, lookup's lists and maths!

18 views
Skip to first unread message

Ross Table

unread,
May 26, 2023, 9:32:59 AM5/26/23
to TiddlyWiki
I am afraid once more I find myself out of my depth and hope you guy's and gals can help...

I have a Tiddler, on that tiddler I have a number of fields. The names of those fields are of the format another.tiddler.name where a tiddler exists called Another Tiddler Name. I am able to reformat another.tiddler.name into Another Tiddler Name through a macro that looks like this;

\define replaceFullStopAndCapitalize(text)
@@text-transform: capitalize;<$text text={{{ [[$text$]search-replace:gi[.],[ ]] }}} />@@
\end

I am able to list the fields using a filter like this "[all[current]fields[]sort[title]] -text -created -modified -tags -title -tmap.id" with a variable which I can then pass to that macro.

What I need to do, is get the cost field from those other tiddlers and sum them up... I think it should be possible using the "Formular for TiddlyWiki" Plugin found here https://github.com/EvanBalster/TiddlyWikiFormula

The closest I have been able to get is this

<$list filter="[all[current]fields[]sort[title]] -text -created -modified -tags -title -tmap.id" variable="listItem">
<$transclude tiddler="<$macrocall $name="replaceFullStopAndCapitalize" text=<<listItem>>/>" field="cost"/>
</$list>

Which renders as

<$transclude tiddler="Another Tiddler Name" field="cost"/>

and If I copy/paste that into a normal tiddler, it shows the right value.

PMario

unread,
May 26, 2023, 12:21:54 PM5/26/23
to TiddlyWiki
Hi,
You should consider to enter the forum at talk.tiddlywiki.org  ... There will be a much greater audience for your questions.
-m

Reply all
Reply to author
Forward
0 new messages