On Sunday, May 17, 2020 at 3:59:16 PM UTC-7, TonyM wrote:
>
> I expect Eric or Jeremy could answer this in a moment but the fact we 
> three, Mat, Mark S and TonyM struggle with it for get newby's
>
 

> On Monday, 18 May 2020 07:38:33 UTC+10, Mat wrote:
>
>> Mark S. wrote:
>>>
>>> Possibly by using some form of Wikify instead of Set.
>>>
>>
This addresses the goal of the generalized OP:
\define all()
<$list filter="[tag[foo]]">
<$list filter="[tag{!!title}]">
   <$text text="[["/><$text text=<<currentTiddler>>/><$text text="]]"/><br>
</$list>
</$list>
\end

<$wikify name="a" text=<<all>>>
{{{ [enlist<a>nth[3]] }}}
</$wikify>

* <<all>> explicitly outputs all tiddler titles with enclosing doubled 
square brackets, even if an individual title doesn't *need* it (i.e., no 
spaces)
* The macro is then wikified to capture the output

Maybe my OP is overgeneralizing though. This describes my actual problem if 
> it changes anything:
> The tiddlers in the inner listwidget have a number field, e.g "number:7"
> I want to calculate the average of the all the numbers, i.e add up all the 
> number fields and also count how many tiddlers there are that are tagged 
> with any of the parent tags.


and, here's a solution to the more specific use-case (gather "number" field 
values and calculate average)
\define all()
<$list filter="[tag[Foo]]">
<$list filter="[tag{!!title}]">
   {{!!number}}
</$list>
</$list>
\end

<$wikify name="a" text=<<all>>>
<$vars total={{{ [enlist<a>sum[]] }}} count={{{ [enlist<a>count[]] }}}>
total=<$text text=<<total>> />
count=<$text text=<<count>> />
average=<$text text={{{ [<total>divide<count>] }}} />
</$vars>
</$wikify>

let me know how it goes...

enjoy,
-e
 

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/7e4366a0-3913-4390-b829-7c212d04da79%40googlegroups.com.

Reply via email to