[tw5] Re: Count[], sum[] etc. in nested lists?

2021-09-13 Thread Charlie Veniot
Well, do love, LOVE, filtering in TiddlyWiki.

That, I think, comes from my love for SQL (in particular Oracle SQL), ever 
since being taught "relational algebra" at university many many many moons 
ago.

One would think I would be as passionate about APL, but I could not stand 
all of the glyphs (I have a hard time figuring out elevator open/close door 
buttons.)

The beauty of filtering in TiddlyWiki, just like writing SQL, is the idea 
of transformations from start to finish: tweak tweak tweak tweak.

Sometimes, the transformations are helped by adding more bulk.

So much fun.

BTW, I'm some glad you started this thread.  I was not aware of that 
{tiddler!!field} beauty in filtering.  Or saw it before and just did not 
clue in.  That is good stuff.  Thanks for showing that and your use case !

On Monday, September 13, 2021 at 10:49:15 PM UTC-3 0 0 wrote:

> Thank you CJ, this solution indeed works as well! I enjoyed following 
> along step by step the construction of the final filter and feel that your 
> idea of "duplicating" each title at the beginning will be another useful 
> technique that I can utilize when needed.
> 0
> tiistai 14. syyskuuta 2021 klo 3.47.40 UTC+3 cj.v...@gmail.com kirjoitti:
>
>> Arg.  Please ignore the macro "theCount".  That was part of an initial 
>> plan that I tossed aside.
>>
>> On Monday, September 13, 2021 at 9:44:38 PM UTC-3 Charlie Veniot wrote:
>>
>>> Oh yeah, forgot to attach sample related tiddlers in case anybody wants 
>>> to dive into that and play.
>>>
>>>
>>>
>>> On Monday, September 13, 2021 at 9:40:32 PM UTC-3 Charlie Veniot wrote:
>>>
 Although I figure most folk will understand Eric's nice solution, I'll 
 throw mine here anyway, for the giggles.

 If anything, you'll see clues that this old sponge of mine operates 
 pretty much way out in left field, or the far side ...

 Assuming that  the negative sign is included with the number in every 
 frequency field ...

 What we have here, folks, is a dynamically created filter, which 
 totally gets my geek mojo going:

 \define bL2() [[
 \define midPart() ]!days:last-contact{
 \define lastPart() !!frequency}]
 \define theCount() +[count[]

 ! The result

 <$vars thisFilter={{{ [has[frequency]sort[]addsuffix[::]] 
 [has[frequency]sort[]addsuffix[,]] +[sort[]] +[join[]] +[split[::]] 
 +[butlast[]] +[addprefix] +[search-replace[,],] 
 +[addsuffix] +[join[ ]] }}}>

 Count of items: <$count filter=<>/>

 <$list filter=<>>

 

 

>
>>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/ffe55d36-3194-4d9b-a7cb-53df09cbf0f9n%40googlegroups.com.


[tw5] Re: Count[], sum[] etc. in nested lists?

2021-09-13 Thread 0 0
Thank you CJ, this solution indeed works as well! I enjoyed following along 
step by step the construction of the final filter and feel that your idea 
of "duplicating" each title at the beginning will be another useful 
technique that I can utilize when needed.
0
tiistai 14. syyskuuta 2021 klo 3.47.40 UTC+3 cj.v...@gmail.com kirjoitti:

> Arg.  Please ignore the macro "theCount".  That was part of an initial 
> plan that I tossed aside.
>
> On Monday, September 13, 2021 at 9:44:38 PM UTC-3 Charlie Veniot wrote:
>
>> Oh yeah, forgot to attach sample related tiddlers in case anybody wants 
>> to dive into that and play.
>>
>>
>>
>> On Monday, September 13, 2021 at 9:40:32 PM UTC-3 Charlie Veniot wrote:
>>
>>> Although I figure most folk will understand Eric's nice solution, I'll 
>>> throw mine here anyway, for the giggles.
>>>
>>> If anything, you'll see clues that this old sponge of mine operates 
>>> pretty much way out in left field, or the far side ...
>>>
>>> Assuming that  the negative sign is included with the number in every 
>>> frequency field ...
>>>
>>> What we have here, folks, is a dynamically created filter, which totally 
>>> gets my geek mojo going:
>>>
>>> \define bL2() [[
>>> \define midPart() ]!days:last-contact{
>>> \define lastPart() !!frequency}]
>>> \define theCount() +[count[]
>>>
>>> ! The result
>>>
>>> <$vars thisFilter={{{ [has[frequency]sort[]addsuffix[::]] 
>>> [has[frequency]sort[]addsuffix[,]] +[sort[]] +[join[]] +[split[::]] 
>>> +[butlast[]] +[addprefix] +[search-replace[,],] 
>>> +[addsuffix] +[join[ ]] }}}>
>>>
>>> Count of items: <$count filter=<>/>
>>>
>>> <$list filter=<>>
>>>
>>> 
>>>
>>> 
>>>

>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/b49ac312-a46a-475a-85be-1181c9867352n%40googlegroups.com.


[tw5] Re: Count[], sum[] etc. in nested lists?

2021-09-13 Thread Charlie Veniot
Arg.  Please ignore the macro "theCount".  That was part of an initial plan 
that I tossed aside.

On Monday, September 13, 2021 at 9:44:38 PM UTC-3 Charlie Veniot wrote:

> Oh yeah, forgot to attach sample related tiddlers in case anybody wants to 
> dive into that and play.
>
>
>
> On Monday, September 13, 2021 at 9:40:32 PM UTC-3 Charlie Veniot wrote:
>
>> Although I figure most folk will understand Eric's nice solution, I'll 
>> throw mine here anyway, for the giggles.
>>
>> If anything, you'll see clues that this old sponge of mine operates 
>> pretty much way out in left field, or the far side ...
>>
>> Assuming that  the negative sign is included with the number in every 
>> frequency field ...
>>
>> What we have here, folks, is a dynamically created filter, which totally 
>> gets my geek mojo going:
>>
>> \define bL2() [[
>> \define midPart() ]!days:last-contact{
>> \define lastPart() !!frequency}]
>> \define theCount() +[count[]
>>
>> ! The result
>>
>> <$vars thisFilter={{{ [has[frequency]sort[]addsuffix[::]] 
>> [has[frequency]sort[]addsuffix[,]] +[sort[]] +[join[]] +[split[::]] 
>> +[butlast[]] +[addprefix] +[search-replace[,],] 
>> +[addsuffix] +[join[ ]] }}}>
>>
>> Count of items: <$count filter=<>/>
>>
>> <$list filter=<>>
>>
>> 
>>
>> 
>>
>>>


-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/622d961d-81ac-4457-a61a-3fcad201b2fan%40googlegroups.com.


[tw5] Re: Count[], sum[] etc. in nested lists?

2021-09-13 Thread Charlie Veniot
Oh yeah, forgot to attach sample related tiddlers in case anybody wants to 
dive into that and play.



On Monday, September 13, 2021 at 9:40:32 PM UTC-3 Charlie Veniot wrote:

> Although I figure most folk will understand Eric's nice solution, I'll 
> throw mine here anyway, for the giggles.
>
> If anything, you'll see clues that this old sponge of mine operates pretty 
> much way out in left field, or the far side ...
>
> Assuming that  the negative sign is included with the number in every 
> frequency field ...
>
> What we have here, folks, is a dynamically created filter, which totally 
> gets my geek mojo going:
>
> \define bL2() [[
> \define midPart() ]!days:last-contact{
> \define lastPart() !!frequency}]
> \define theCount() +[count[]
>
> ! The result
>
> <$vars thisFilter={{{ [has[frequency]sort[]addsuffix[::]] 
> [has[frequency]sort[]addsuffix[,]] +[sort[]] +[join[]] +[split[::]] 
> +[butlast[]] +[addprefix] +[search-replace[,],] 
> +[addsuffix] +[join[ ]] }}}>
>
> Count of items: <$count filter=<>/>
>
> <$list filter=<>>
>
> 
>
> 
>
>>
>>>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/0884367f-91f8-443f-88e2-7e2c6aaaca65n%40googlegroups.com.


FunkyDynamicCreationOfFilter.json
Description: application/json


[tw5] Re: Count[], sum[] etc. in nested lists?

2021-09-13 Thread Charlie Veniot
Although I figure most folk will understand Eric's nice solution, I'll 
throw mine here anyway, for the giggles.

If anything, you'll see clues that this old sponge of mine operates pretty 
much way out in left field, or the far side ...

Assuming that  the negative sign is included with the number in every 
frequency field ...

What we have here, folks, is a dynamically created filter, which totally 
gets my geek mojo going:

\define bL2() [[
\define midPart() ]!days:last-contact{
\define lastPart() !!frequency}]
\define theCount() +[count[]

! The result

<$vars thisFilter={{{ [has[frequency]sort[]addsuffix[::]] 
[has[frequency]sort[]addsuffix[,]] +[sort[]] +[join[]] +[split[::]] 
+[butlast[]] +[addprefix] +[search-replace[,],] 
+[addsuffix] +[join[ ]] }}}>

Count of items: <$count filter=<>/>

<$list filter=<>>





>
>>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/b0de23e5-de3d-4973-a299-5f52cf7dcc27n%40googlegroups.com.


[tw5] Re: Count[], sum[] etc. in nested lists?

2021-09-13 Thread 0 0
Yes! Wikifying and enlisting does the trick. Thank you Mark for the initial 
idea and Eric for the tidy solution with all the features ready baked! This 
technique will be a valuable addition to my toolbelt.

0
tiistai 14. syyskuuta 2021 klo 2.09.14 UTC+3 Eric Shulman kirjoitti:

> errata: I changed a variable name, but missed one line.  Change this:
> <> tasks, <> are completed:
> to this:
> <> tasks, <> are completed:
>
> -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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/aed54d15-f88e-4aac-b7fe-ad03173cc8a9n%40googlegroups.com.


[tw5] Re: Count[], sum[] etc. in nested lists?

2021-09-13 Thread Eric Shulman
errata: I changed a variable name, but missed one line.  Change this:
<> tasks, <> are completed:
to this:
<> tasks, <> are completed:

-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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/7305cc55-bc43-436b-bad9-45c7e7244a00n%40googlegroups.com.


[tw5] Re: Count[], sum[] etc. in nested lists?

2021-09-13 Thread Eric Shulman
On Monday, September 13, 2021 at 2:18:59 PM UTC-7 Mark S. wrote:

> Another way is to put the entire nested listed set into a text field of a 
> wikify widget. Then render and enlist the output. Sometimes there are 
> additional complications if your output tiddlers (tasks) have spaces in 
> them.
>

As Mark suggests, using the $wikify widget may be the most straightforward 
way to handle your needs...

Try this:
```
\define getList()
<$list filter="[has[frequency]]">
   <$list filter="[all[current]!days:last-contact{!!frequency}]">
  //[//[<$link/>]//]//
   

\end

<$wikify name="theList" text=<>>
<$vars total={{{ [has[frequency]count[]] }}}>
<$vars todo={{{ [enlistcount[]] }}}>
<$vars done={{{ 
[subtractdividemultiply[100]addsuffix[%]] }}}>
<$vars time={{{ [enlistget[time-needed]sum[]] }}}>
<> tasks, <> are completed:
<$list filter="[enlist]"><$link/>
Total time needed: <> minutes.





```

Notes:
* The `getList()` macro outputs a list of incomplete tasks (your original 
nested filters)
* The list items are wrapped in `[[` and `]]`, using italics syntax to 
separate the brackets so they will be output as literal text.  This handles 
tiddler titles that contain spaces.
* `$wikify` invokes `getList()` and captures the output as plain text, 
stored in `theList`
* Next, we calculate the some statistics: total=number of tasks,  
todo=number of incomplete tasks, done=percentage complete, time=total time 
need to complete the remaining tasks
* Then, we display the total and percent complete
* Followed by a numbered bullet list of links to incomplete tasks
* and finally, the total time needed to complete those tasks

That about covers it.

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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/34436d0e-d2d3-49b8-bae6-5842e77ab941n%40googlegroups.com.


[tw5] Re: Count[], sum[] etc. in nested lists?

2021-09-13 Thread 'Mark S.' via TiddlyWiki
Oh! I just remembered. You might be able to do it in one go with the new 
*reduce* operator. So, once again, some data would be helpful.

On Monday, September 13, 2021 at 2:18:59 PM UTC-7 Mark S. wrote:

> This is trickier than it looks, because of the binary nature of the output 
> from days.
>
> One way to handle it might be to set up a recursive routine. Recursive 
> routines can add numbers. But it's really messy.
>
> Another way is to put the entire nested listed set into a text field of a 
> wikify widget. Then render and enlist the output. Sometimes there are 
> additional complications if your output tiddlers (tasks) have spaces in 
> them.
>
> This is too much to pursue on my own without test data. 
>
> Good luck!
>
>
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/ab5625c7-ed5b-4c6a-8922-8048225fcd53n%40googlegroups.com.


[tw5] Re: Count[], sum[] etc. in nested lists?

2021-09-13 Thread 'Mark S.' via TiddlyWiki
This is trickier than it looks, because of the binary nature of the output 
from days.

One way to handle it might be to set up a recursive routine. Recursive 
routines can add numbers. But it's really messy.

Another way is to put the entire nested listed set into a text field of a 
wikify widget. Then render and enlist the output. Sometimes there are 
additional complications if your output tiddlers (tasks) have spaces in 
them.

This is too much to pursue on my own without test data. 

Good luck!


-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/30a3ef2f-e979-483a-9ac9-d39174f25b01n%40googlegroups.com.


Re: [tw5] Re: ISO week date format template

2021-09-13 Thread J N
Ok, I see that there is also already a conflict with the ISO notation in 
the DDD token, which in ISO 8601 is used for three digit day of year.
Maybe that could be nice to have as TW date token also.

https://en.wikipedia.org/wiki/ISO_8601#Ordinal_dates
> As represented above, [] indicates a year. [DDD] is the day of that 
year, from 001 through 365 (366 in leap years). For example, "1981-04-05" 
is also "1981-095".

The "dd" format is reminding of the numerical notation in the month date, 
but at the same time may be confusingly similar and suggesting a two digit 
representation. "" feels more related to the existing weekday name 
notations, one could think that longer token indicates lesser units in this 
case. I'm not sure which one to prefer.
How could a day of year-token fit into this? yDDD?

On Monday, 13 September 2021 at 20:46:04 UTC+2 jeremy... wrote:

> Nice to hear it is already taken care of, thank you.
>
> I was almost on my way to make a pull request myself, as an exercise in 
> contributing to an open source project, but I am not sure about the 
> customs, if I should create an issue first.
>
>
> It's probably usually best to open an issue (or comment on an existing 
> one) for discussion before preparing a PR to minimise the chances of it 
> subsequently being rejected for a reason you haven't foreseen. We are 
> always keen to welcome new contributors, and you'll find plenty of help and 
> encouragement when you need it.
>
> Of curiosity, may I ask why you chose "" as the token for week date 
> number, instead of the "D" symbol used in the ISO 8601 formats notation?
>
>
> We don't currently use any single character tokens, originally to minimise 
> the chances of triggering any boilerplate text in the template (ie, a 
> format string could be "The year is ").
>
> Now that I started to write out the rationale for the choice of "", 
> I'm realising that perhaps I think "dd" might be a better choice. What do 
> others think?
>
> Best wishes
>
> Jeremy
>
>
>
> On Sunday, 12 September 2021 at 12:58:44 UTC+2 jeremy... wrote:
>
>> Thanks CJ for the cunning workaround. For v5.2.0 I've now added a new 
>> date format string token "" for directly obtaining the ISO weekday 
>> number (ie 1=Monday, 7=Sunday):
>>
>> https://tiddlywiki.com/prerelease/#DateFormat
>>
>> (It'll take a few minutes from this posting until the change shows up).
>>
>> Best wishes
>>
>> Jeremy.
>>
>>
>>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/398b3337-65a8-46ad-a860-1f60170c4b9bn%40googlegroups.com.


Re: [tw5] Re: ISO week date format template

2021-09-13 Thread Jeremy Ruston
> Nice to hear it is already taken care of, thank you.
> I was almost on my way to make a pull request myself, as an exercise in 
> contributing to an open source project, but I am not sure about the customs, 
> if I should create an issue first.

It's probably usually best to open an issue (or comment on an existing one) for 
discussion before preparing a PR to minimise the chances of it subsequently 
being rejected for a reason you haven't foreseen. We are always keen to welcome 
new contributors, and you'll find plenty of help and encouragement when you 
need it.

> Of curiosity, may I ask why you chose "" as the token for week date 
> number, instead of the "D" symbol used in the ISO 8601 formats notation?

We don't currently use any single character tokens, originally to minimise the 
chances of triggering any boilerplate text in the template (ie, a format string 
could be "The year is ").

Now that I started to write out the rationale for the choice of "", I'm 
realising that perhaps I think "dd" might be a better choice. What do others 
think?

Best wishes

Jeremy

> 
> 
>> On Sunday, 12 September 2021 at 12:58:44 UTC+2 jeremy... wrote:
>> Thanks CJ for the cunning workaround. For v5.2.0 I've now added a new date 
>> format string token "" for directly obtaining the ISO weekday number (ie 
>> 1=Monday, 7=Sunday):
>> 
>> https://tiddlywiki.com/prerelease/#DateFormat
>> 
>> (It'll take a few minutes from this posting until the change shows up).
>> 
>> Best wishes
>> 
>> Jeremy.
>> 
>>> On Sunday, September 12, 2021 at 11:26:51 AM UTC+1 J N wrote:
>>> Thank you for the suggested workaround.
>>> 
>>> Is it possible to define that operation in a tiddler and then refer to the 
>>> value in a template for creating a new journal entry?
>>> 
>>> If so, maybe one could also use JavaScript directly to provide the value 
>>> for the tiddler template.
>>> 
>>> 
 On Saturday, 11 September 2021 at 15:19:35 UTC+2 cj.v wrote:
   Oops, typo in the last "search-replace"  
 
 "[Thu],[7]" should be "[Sun],[7]"
 
 The dangers of mindless cut and paste ...
 
> On Saturday, September 11, 2021 at 12:49:23 AM UTC-3 Charlie Veniot wrote:
> G'day,
> 
> Just to get the conversation started, try this in a new tiddler in some 
> tiddlywiki:
> 
> <$vars dateNow= <>>
> 
> {{{ 
> [search-replace:[Mon],[1]search-replace:[Tue],[2]search-replace:[Wed],[3]search-replace:[Thu],[4]search-replace:[Fri],[5]search-replace:[Sat],[6]search-replace:[Thu],[7]]
>  }}}
> 
> 
> 
> 
> 
> -- 
> 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 tiddlywiki+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/tiddlywiki/4101de67-bd22-489b-bdd7-3b98ab99be3fn%40googlegroups.com.

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/09BB5EEE-4634-4EC0-BD73-7C914156AC60%40gmail.com.


[tw5] Re: ISO week date format template

2021-09-13 Thread J N
Yes, I will probably upgrade to 5.2 then to get that specific feature.

Thank you for the doc ref, there seem to be many possibilities to customize 
functionality.

The last block of example code means that I should create the config 
tiddlers without the $:/ prefix if I want them to appear in the sidebar UI?

On Sunday, 12 September 2021 at 15:48:57 UTC+2 cj.v wrote:

> I'm thinking it might be worth you using the 5.2 pre-release version of 
> TiddlyWiki, seeing as it has the ISO date format.
>
> However, if you do want to continue with the workaround:
>
> I wouldn't bother with javascript.  You have all you need in TiddlyWiki:  
> https://tiddlywiki.com/#Making%20a%20custom%20journal%20button
>
> What do you think? 
>
> On Sunday, September 12, 2021 at 7:26:51 AM UTC-3 J N wrote:
>
>> Thank you for the suggested workaround.
>>
>> Is it possible to define that operation in a tiddler and then refer to 
>> the value in a template for creating a new journal entry?
>>
>> If so, maybe one could also use JavaScript directly to provide the value 
>> for the tiddler template.
>>
>>
>> On Saturday, 11 September 2021 at 15:19:35 UTC+2 cj.v wrote:
>>
>>> *  Oops, typo in the last "search-replace"  *
>>>
>>> "[Thu],[7]" should be "[Sun],[7]"
>>>
>>> The dangers of mindless cut and paste ...
>>>
>>> On Saturday, September 11, 2021 at 12:49:23 AM UTC-3 Charlie Veniot 
>>> wrote:
>>>
 G'day,

 Just to get the conversation started, try this in a new tiddler in some 
 tiddlywiki:

 <$vars dateNow= <>>

 {{{ 
 [search-replace:[Mon],[1]search-replace:[Tue],[2]search-replace:[Wed],[3]search-replace:[Thu],[4]search-replace:[Fri],[5]search-replace:[Sat],[6]search-replace:[Thu],[7]]
  
 }}}

 




-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/387a078e-8e69-4c99-9a62-d17c18417121n%40googlegroups.com.


[tw5] Re: Count[], sum[] etc. in nested lists?

2021-09-13 Thread Charlie Veniot
I'm getting thrown off by "days:last-contact{!!frequency}" or I'm not 
imagining the input tiddlers right, or both.

If you have the time to export tiddlers for this scenario, I can drop them 
into tiddlywiki.com, and figure it all out.

Or somebody else may know exactly what's going on based on the good stuff 
you've given us so far.



On Monday, September 13, 2021 at 3:23:46 PM UTC-3 0 0 wrote:

> Thanks, but still no luck (the syntax didn't matter either).
> Result looks something like this (I add some arbitrary linebreaks here to 
> make the logic clearer):
> Task1 *You have 1*
> Task2* You have 1*
> *You have 0*
> Task 4 *You have 1*
> Task 5 *You have 1*
> *You have 0*
> *You have 0*
> Task 8 *You have 1*
> Task 9 *You have 1*
> Task 10 *You have 1*
> maanantai 13. syyskuuta 2021 klo 20.58.04 UTC+3 cj.v...@gmail.com 
> kirjoitti:
>
>>  Hi, give this a spin:
>>
>> <$list filter="[has[frequency]]">
>> *<$vars theCount={{{ [all[current]!days:last-contact{!!frequency}count[]] 
>> }}} >*
>>
>>   <$list filter="[all[current]!days:last-contact{!!frequency}]">
>> <$link><$view field="title"/>
>>   
>>
>> *You have <$text text=<>/>*
>> **
>> 
>>
>> Not being convinced I have my vars set right, this as an alternative:
>> *<$vars theCount={{{ [all[current]!days:last-contact{!!frequency}] 
>> +[count[]] }}} >*
>> On Monday, September 13, 2021 at 2:25:02 PM UTC-3 0 0 wrote:
>>
>>> <$list filter="[has[frequency]]"> I have 10 recurring tasks
>>>   <$list filter="[all[current]!days:last-contact{!!frequency}]"> 7 
>>> tasks haven't been completed in {{!!frequency}} days. last-contact contains 
>>> the timestamp of latest completion.
>>> <$link><$view field="title"/>
>>>   
>>>  
>>>
>>> As expected the output is 7 tiddler titles:
>>> Task1
>>> Task2
>>> Task4
>>> Task5
>>> Task8
>>> Task9
>>> Task10
>>>
>>> After this list I want:
>>> You have *[7]* tasks.
>>> ___
>>> <$vars theCount={{{ [all[current]!days:last-contact{!!frequency}count[]] 
>>> }}} > does not seem to work.
>>> "[all[current]..." contains only one title at a time which then either 
>>> passes the !days filter or not. Thus after count[], <> variable 
>>> will contain a 1 or a 0.
>>>
>>> I'm afraid there is no solution at my level of competence :/
>>>
>>> maanantai 13. syyskuuta 2021 klo 18.36.56 UTC+3 cj.v...@gmail.com 
>>> kirjoitti:
>>>
 This may seem silly, but a mock-up screenshot of expected output would 
 be pretty awesome. Information with labels of what the information means.

 My last sample I posted should have had the question "something like 
 this?", because it definitely wasn't any kind of "this is the answer 
 you're 
 looking for.'



 On Monday, September 13, 2021 at 12:20:15 PM UTC-3 Charlie Veniot wrote:

> Well, in the middle of doing something else, so not quite sure if I 
> have the right count in the highlighted filter.
>
> On Monday, September 13, 2021 at 12:18:45 PM UTC-3 Charlie Veniot 
> wrote:
>
>> <$list filter="[has[frequency]]">
>> *<$vars theCount={{{ 
>> [all[current]!days:last-contact{!!frequency}count[]] }}} >*
>>
>>   <$list filter="[all[current]!days:last-contact{!!frequency}]">
>> <$link><$view field="title"/>
>>   
>> **
>> 
>>
>> On Monday, September 13, 2021 at 12:12:45 PM UTC-3 0 0 wrote:
>>
>>> Thank you for your answer, I appreciate your help.
>>> However, your suggestion does not seem to affect the underlying 
>>> problem: I'm unable to get the number of tiddlers that pass the filter 
>>> of 
>>> second list.
>>> I'll try to elaborate what I meant in my original post.
>>>
>>> For example let's say the outer list alone would output 100 
>>> tiddlers. If I added count[] to this filter to get the number of 
>>> tiddlers 
>>> this outer list outputs I will see the number 100 instead of 100 
>>> individual 
>>> titles.
>>> Then the inner list filters out 30 tiddlers that do not satisfy the 
>>> additional condition. I see 70 tiddler titles that pass the outer AND 
>>> inner 
>>> filter, but I'm unable to count them (except by hand).
>>> Adding count[] to the inner list would just yield a mix of 30 zeroes 
>>> (0 0 0 0...for each time the currently evaluated tiddler does not pass 
>>> the 
>>> inner filter) and 70 ones (1 1 1 1...whenever it does).
>>>
>>> Now either I'd need some way to have a variable that would increase 
>>> each time a tiddler passes the inner filter, or I'd need to have it all 
>>> in 
>>> a single-level list (which with current setup doesn't work exactly for 
>>> the 
>>> reason Eric describes). Or there could be a completely different 
>>> approach 
>>> that I'm unable to see.
>>>
>>> 0
>>> maanantai 13. syyskuuta 2021 klo 18.02.58 UTC+3 Eric Shulman 
>>> kirjoitti:
>>>
 On Monday, September 13, 

[tw5] Re: ISO week date format template

2021-09-13 Thread J N
Nice to hear it is already taken care of, thank you.
I was almost on my way to make a pull request myself, as an exercise in 
contributing to an open source project, but I am not sure about the 
customs, if I should create an issue first.

Of curiosity, may I ask why you chose "" as the token for week date 
number, instead of the "D" symbol used in the ISO 8601 formats notation?


On Sunday, 12 September 2021 at 12:58:44 UTC+2 jeremy... wrote:

> Thanks CJ for the cunning workaround. For v5.2.0 I've now added a new date 
> format string token "" for directly obtaining the ISO weekday number 
> (ie 1=Monday, 7=Sunday):
>
> https://tiddlywiki.com/prerelease/#DateFormat
>
> (It'll take a few minutes from this posting until the change shows up).
>
> Best wishes
>
> Jeremy.
>
> On Sunday, September 12, 2021 at 11:26:51 AM UTC+1 J N wrote:
>
>> Thank you for the suggested workaround.
>>
>> Is it possible to define that operation in a tiddler and then refer to 
>> the value in a template for creating a new journal entry?
>>
>> If so, maybe one could also use JavaScript directly to provide the value 
>> for the tiddler template.
>>
>>
>> On Saturday, 11 September 2021 at 15:19:35 UTC+2 cj.v wrote:
>>
>>> *  Oops, typo in the last "search-replace"  *
>>>
>>> "[Thu],[7]" should be "[Sun],[7]"
>>>
>>> The dangers of mindless cut and paste ...
>>>
>>> On Saturday, September 11, 2021 at 12:49:23 AM UTC-3 Charlie Veniot 
>>> wrote:
>>>
 G'day,

 Just to get the conversation started, try this in a new tiddler in some 
 tiddlywiki:

 <$vars dateNow= <>>

 {{{ 
 [search-replace:[Mon],[1]search-replace:[Tue],[2]search-replace:[Wed],[3]search-replace:[Thu],[4]search-replace:[Fri],[5]search-replace:[Sat],[6]search-replace:[Thu],[7]]
  
 }}}

 




-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/4101de67-bd22-489b-bdd7-3b98ab99be3fn%40googlegroups.com.


[tw5] Re: Count[], sum[] etc. in nested lists?

2021-09-13 Thread 0 0
Thanks, but still no luck (the syntax didn't matter either).
Result looks something like this (I add some arbitrary linebreaks here to 
make the logic clearer):
Task1 *You have 1*
Task2* You have 1*
*You have 0*
Task 4 *You have 1*
Task 5 *You have 1*
*You have 0*
*You have 0*
Task 8 *You have 1*
Task 9 *You have 1*
Task 10 *You have 1*
maanantai 13. syyskuuta 2021 klo 20.58.04 UTC+3 cj.v...@gmail.com kirjoitti:

>  Hi, give this a spin:
>
> <$list filter="[has[frequency]]">
> *<$vars theCount={{{ [all[current]!days:last-contact{!!frequency}count[]] 
> }}} >*
>
>   <$list filter="[all[current]!days:last-contact{!!frequency}]">
> <$link><$view field="title"/>
>   
>
> *You have <$text text=<>/>*
> **
> 
>
> Not being convinced I have my vars set right, this as an alternative:
> *<$vars theCount={{{ [all[current]!days:last-contact{!!frequency}] 
> +[count[]] }}} >*
> On Monday, September 13, 2021 at 2:25:02 PM UTC-3 0 0 wrote:
>
>> <$list filter="[has[frequency]]"> I have 10 recurring tasks
>>   <$list filter="[all[current]!days:last-contact{!!frequency}]"> 7 tasks 
>> haven't been completed in {{!!frequency}} days. last-contact contains the 
>> timestamp of latest completion.
>> <$link><$view field="title"/>
>>   
>>  
>>
>> As expected the output is 7 tiddler titles:
>> Task1
>> Task2
>> Task4
>> Task5
>> Task8
>> Task9
>> Task10
>>
>> After this list I want:
>> You have *[7]* tasks.
>> ___
>> <$vars theCount={{{ [all[current]!days:last-contact{!!frequency}count[]] 
>> }}} > does not seem to work.
>> "[all[current]..." contains only one title at a time which then either 
>> passes the !days filter or not. Thus after count[], <> variable 
>> will contain a 1 or a 0.
>>
>> I'm afraid there is no solution at my level of competence :/
>>
>> maanantai 13. syyskuuta 2021 klo 18.36.56 UTC+3 cj.v...@gmail.com 
>> kirjoitti:
>>
>>> This may seem silly, but a mock-up screenshot of expected output would 
>>> be pretty awesome. Information with labels of what the information means.
>>>
>>> My last sample I posted should have had the question "something like 
>>> this?", because it definitely wasn't any kind of "this is the answer you're 
>>> looking for.'
>>>
>>>
>>>
>>> On Monday, September 13, 2021 at 12:20:15 PM UTC-3 Charlie Veniot wrote:
>>>
 Well, in the middle of doing something else, so not quite sure if I 
 have the right count in the highlighted filter.

 On Monday, September 13, 2021 at 12:18:45 PM UTC-3 Charlie Veniot wrote:

> <$list filter="[has[frequency]]">
> *<$vars theCount={{{ 
> [all[current]!days:last-contact{!!frequency}count[]] }}} >*
>
>   <$list filter="[all[current]!days:last-contact{!!frequency}]">
> <$link><$view field="title"/>
>   
> **
> 
>
> On Monday, September 13, 2021 at 12:12:45 PM UTC-3 0 0 wrote:
>
>> Thank you for your answer, I appreciate your help.
>> However, your suggestion does not seem to affect the underlying 
>> problem: I'm unable to get the number of tiddlers that pass the filter 
>> of 
>> second list.
>> I'll try to elaborate what I meant in my original post.
>>
>> For example let's say the outer list alone would output 100 tiddlers. 
>> If I added count[] to this filter to get the number of tiddlers this 
>> outer 
>> list outputs I will see the number 100 instead of 100 individual titles.
>> Then the inner list filters out 30 tiddlers that do not satisfy the 
>> additional condition. I see 70 tiddler titles that pass the outer AND 
>> inner 
>> filter, but I'm unable to count them (except by hand).
>> Adding count[] to the inner list would just yield a mix of 30 zeroes 
>> (0 0 0 0...for each time the currently evaluated tiddler does not pass 
>> the 
>> inner filter) and 70 ones (1 1 1 1...whenever it does).
>>
>> Now either I'd need some way to have a variable that would increase 
>> each time a tiddler passes the inner filter, or I'd need to have it all 
>> in 
>> a single-level list (which with current setup doesn't work exactly for 
>> the 
>> reason Eric describes). Or there could be a completely different 
>> approach 
>> that I'm unable to see.
>>
>> 0
>> maanantai 13. syyskuuta 2021 klo 18.02.58 UTC+3 Eric Shulman 
>> kirjoitti:
>>
>>> On Monday, September 13, 2021 at 6:51:14 AM UTC-7 cj.v...@gmail.com 
>>> wrote:
>>>
 Aside: we could merge the two <$list> filters together 
>>>
>>>
>>> That wouldn't work in this case, as the inner filter uses 
>>> `{!!frequency}`, which depends upon the outer filter to set the 
>>> `currentTiddler` value to each tiddler that `has[frequency]`
>>> If the two filters were merged, then `{!!frequency}` would refer to 
>>> the tiddler that contains the `$list` widget, rather than each tiddler 
>>> that 
>>> `has[frequency]`
>>>
>>> -e
>>>

[tw5] Re: Count[], sum[] etc. in nested lists?

2021-09-13 Thread Charlie Veniot
 Hi, give this a spin:

<$list filter="[has[frequency]]">
*<$vars theCount={{{ [all[current]!days:last-contact{!!frequency}count[]] 
}}} >*

  <$list filter="[all[current]!days:last-contact{!!frequency}]">
<$link><$view field="title"/>
  

*You have <$text text=<>/>*
**


Not being convinced I have my vars set right, this as an alternative:
*<$vars theCount={{{ [all[current]!days:last-contact{!!frequency}] 
+[count[]] }}} >*
On Monday, September 13, 2021 at 2:25:02 PM UTC-3 0 0 wrote:

> <$list filter="[has[frequency]]"> I have 10 recurring tasks
>   <$list filter="[all[current]!days:last-contact{!!frequency}]"> 7 tasks 
> haven't been completed in {{!!frequency}} days. last-contact contains the 
> timestamp of latest completion.
> <$link><$view field="title"/>
>   
>  
>
> As expected the output is 7 tiddler titles:
> Task1
> Task2
> Task4
> Task5
> Task8
> Task9
> Task10
>
> After this list I want:
> You have *[7]* tasks.
> ___
> <$vars theCount={{{ [all[current]!days:last-contact{!!frequency}count[]] 
> }}} > does not seem to work.
> "[all[current]..." contains only one title at a time which then either 
> passes the !days filter or not. Thus after count[], <> variable 
> will contain a 1 or a 0.
>
> I'm afraid there is no solution at my level of competence :/
>
> maanantai 13. syyskuuta 2021 klo 18.36.56 UTC+3 cj.v...@gmail.com 
> kirjoitti:
>
>> This may seem silly, but a mock-up screenshot of expected output would be 
>> pretty awesome. Information with labels of what the information means.
>>
>> My last sample I posted should have had the question "something like 
>> this?", because it definitely wasn't any kind of "this is the answer you're 
>> looking for.'
>>
>>
>>
>> On Monday, September 13, 2021 at 12:20:15 PM UTC-3 Charlie Veniot wrote:
>>
>>> Well, in the middle of doing something else, so not quite sure if I have 
>>> the right count in the highlighted filter.
>>>
>>> On Monday, September 13, 2021 at 12:18:45 PM UTC-3 Charlie Veniot wrote:
>>>
 <$list filter="[has[frequency]]">
 *<$vars theCount={{{ 
 [all[current]!days:last-contact{!!frequency}count[]] }}} >*

   <$list filter="[all[current]!days:last-contact{!!frequency}]">
 <$link><$view field="title"/>
   
 **
 

 On Monday, September 13, 2021 at 12:12:45 PM UTC-3 0 0 wrote:

> Thank you for your answer, I appreciate your help.
> However, your suggestion does not seem to affect the underlying 
> problem: I'm unable to get the number of tiddlers that pass the filter of 
> second list.
> I'll try to elaborate what I meant in my original post.
>
> For example let's say the outer list alone would output 100 tiddlers. 
> If I added count[] to this filter to get the number of tiddlers this 
> outer 
> list outputs I will see the number 100 instead of 100 individual titles.
> Then the inner list filters out 30 tiddlers that do not satisfy the 
> additional condition. I see 70 tiddler titles that pass the outer AND 
> inner 
> filter, but I'm unable to count them (except by hand).
> Adding count[] to the inner list would just yield a mix of 30 zeroes 
> (0 0 0 0...for each time the currently evaluated tiddler does not pass 
> the 
> inner filter) and 70 ones (1 1 1 1...whenever it does).
>
> Now either I'd need some way to have a variable that would increase 
> each time a tiddler passes the inner filter, or I'd need to have it all 
> in 
> a single-level list (which with current setup doesn't work exactly for 
> the 
> reason Eric describes). Or there could be a completely different approach 
> that I'm unable to see.
>
> 0
> maanantai 13. syyskuuta 2021 klo 18.02.58 UTC+3 Eric Shulman kirjoitti:
>
>> On Monday, September 13, 2021 at 6:51:14 AM UTC-7 cj.v...@gmail.com 
>> wrote:
>>
>>> Aside: we could merge the two <$list> filters together 
>>
>>
>> That wouldn't work in this case, as the inner filter uses 
>> `{!!frequency}`, which depends upon the outer filter to set the 
>> `currentTiddler` value to each tiddler that `has[frequency]`
>> If the two filters were merged, then `{!!frequency}` would refer to 
>> the tiddler that contains the `$list` widget, rather than each tiddler 
>> that 
>> `has[frequency]`
>>
>> -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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/29dced74-6f11-4bb5-938a-48adc89865b5n%40googlegroups.com.


[tw5] Re: Count[], sum[] etc. in nested lists?

2021-09-13 Thread 0 0
 <$list filter="[has[frequency]]"> I have 10 recurring tasks
  <$list filter="[all[current]!days:last-contact{!!frequency}]"> 7 tasks 
haven't been completed in {{!!frequency}} days. last-contact contains the 
timestamp of latest completion.
<$link><$view field="title"/>
  
 

As expected the output is 7 tiddler titles:
Task1
Task2
Task4
Task5
Task8
Task9
Task10

After this list I want:
You have *[7]* tasks.
___
<$vars theCount={{{ [all[current]!days:last-contact{!!frequency}count[]] 
}}} > does not seem to work.
"[all[current]..." contains only one title at a time which then either 
passes the !days filter or not. Thus after count[], <> variable 
will contain a 1 or a 0.

I'm afraid there is no solution at my level of competence :/

maanantai 13. syyskuuta 2021 klo 18.36.56 UTC+3 cj.v...@gmail.com kirjoitti:

> This may seem silly, but a mock-up screenshot of expected output would be 
> pretty awesome. Information with labels of what the information means.
>
> My last sample I posted should have had the question "something like 
> this?", because it definitely wasn't any kind of "this is the answer you're 
> looking for.'
>
>
>
> On Monday, September 13, 2021 at 12:20:15 PM UTC-3 Charlie Veniot wrote:
>
>> Well, in the middle of doing something else, so not quite sure if I have 
>> the right count in the highlighted filter.
>>
>> On Monday, September 13, 2021 at 12:18:45 PM UTC-3 Charlie Veniot wrote:
>>
>>> <$list filter="[has[frequency]]">
>>> *<$vars theCount={{{ 
>>> [all[current]!days:last-contact{!!frequency}count[]] }}} >*
>>>
>>>   <$list filter="[all[current]!days:last-contact{!!frequency}]">
>>> <$link><$view field="title"/>
>>>   
>>> **
>>> 
>>>
>>> On Monday, September 13, 2021 at 12:12:45 PM UTC-3 0 0 wrote:
>>>
 Thank you for your answer, I appreciate your help.
 However, your suggestion does not seem to affect the underlying 
 problem: I'm unable to get the number of tiddlers that pass the filter of 
 second list.
 I'll try to elaborate what I meant in my original post.

 For example let's say the outer list alone would output 100 tiddlers. 
 If I added count[] to this filter to get the number of tiddlers this outer 
 list outputs I will see the number 100 instead of 100 individual titles.
 Then the inner list filters out 30 tiddlers that do not satisfy the 
 additional condition. I see 70 tiddler titles that pass the outer AND 
 inner 
 filter, but I'm unable to count them (except by hand).
 Adding count[] to the inner list would just yield a mix of 30 zeroes (0 
 0 0 0...for each time the currently evaluated tiddler does not pass the 
 inner filter) and 70 ones (1 1 1 1...whenever it does).

 Now either I'd need some way to have a variable that would increase 
 each time a tiddler passes the inner filter, or I'd need to have it all in 
 a single-level list (which with current setup doesn't work exactly for the 
 reason Eric describes). Or there could be a completely different approach 
 that I'm unable to see.

 0
 maanantai 13. syyskuuta 2021 klo 18.02.58 UTC+3 Eric Shulman kirjoitti:

> On Monday, September 13, 2021 at 6:51:14 AM UTC-7 cj.v...@gmail.com 
> wrote:
>
>> Aside: we could merge the two <$list> filters together 
>
>
> That wouldn't work in this case, as the inner filter uses 
> `{!!frequency}`, which depends upon the outer filter to set the 
> `currentTiddler` value to each tiddler that `has[frequency]`
> If the two filters were merged, then `{!!frequency}` would refer to 
> the tiddler that contains the `$list` widget, rather than each tiddler 
> that 
> `has[frequency]`
>
> -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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/a9444a68-9979-468f-9a68-336830edd27en%40googlegroups.com.


[tw5] Re: Count[], sum[] etc. in nested lists?

2021-09-13 Thread Charlie Veniot
This may seem silly, but a mock-up screenshot of expected output would be 
pretty awesome. Information with labels of what the information means.

My last sample I posted should have had the question "something like 
this?", because it definitely wasn't any kind of "this is the answer you're 
looking for.'



On Monday, September 13, 2021 at 12:20:15 PM UTC-3 Charlie Veniot wrote:

> Well, in the middle of doing something else, so not quite sure if I have 
> the right count in the highlighted filter.
>
> On Monday, September 13, 2021 at 12:18:45 PM UTC-3 Charlie Veniot wrote:
>
>> <$list filter="[has[frequency]]">
>> *<$vars theCount={{{ [all[current]!days:last-contact{!!frequency}count[]] 
>> }}} >*
>>
>>   <$list filter="[all[current]!days:last-contact{!!frequency}]">
>> <$link><$view field="title"/>
>>   
>> **
>> 
>>
>> On Monday, September 13, 2021 at 12:12:45 PM UTC-3 0 0 wrote:
>>
>>> Thank you for your answer, I appreciate your help.
>>> However, your suggestion does not seem to affect the underlying problem: 
>>> I'm unable to get the number of tiddlers that pass the filter of second 
>>> list.
>>> I'll try to elaborate what I meant in my original post.
>>>
>>> For example let's say the outer list alone would output 100 tiddlers. If 
>>> I added count[] to this filter to get the number of tiddlers this outer 
>>> list outputs I will see the number 100 instead of 100 individual titles.
>>> Then the inner list filters out 30 tiddlers that do not satisfy the 
>>> additional condition. I see 70 tiddler titles that pass the outer AND inner 
>>> filter, but I'm unable to count them (except by hand).
>>> Adding count[] to the inner list would just yield a mix of 30 zeroes (0 
>>> 0 0 0...for each time the currently evaluated tiddler does not pass the 
>>> inner filter) and 70 ones (1 1 1 1...whenever it does).
>>>
>>> Now either I'd need some way to have a variable that would increase each 
>>> time a tiddler passes the inner filter, or I'd need to have it all in a 
>>> single-level list (which with current setup doesn't work exactly for the 
>>> reason Eric describes). Or there could be a completely different approach 
>>> that I'm unable to see.
>>>
>>> 0
>>> maanantai 13. syyskuuta 2021 klo 18.02.58 UTC+3 Eric Shulman kirjoitti:
>>>
 On Monday, September 13, 2021 at 6:51:14 AM UTC-7 cj.v...@gmail.com 
 wrote:

> Aside: we could merge the two <$list> filters together 


 That wouldn't work in this case, as the inner filter uses 
 `{!!frequency}`, which depends upon the outer filter to set the 
 `currentTiddler` value to each tiddler that `has[frequency]`
 If the two filters were merged, then `{!!frequency}` would refer to the 
 tiddler that contains the `$list` widget, rather than each tiddler that 
 `has[frequency]`

 -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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/97d82f57-4bbd-4b7f-9e04-c291ab624c16n%40googlegroups.com.


[tw5] Re: Count[], sum[] etc. in nested lists?

2021-09-13 Thread Charlie Veniot
Well, in the middle of doing something else, so not quite sure if I have 
the right count in the highlighted filter.

On Monday, September 13, 2021 at 12:18:45 PM UTC-3 Charlie Veniot wrote:

> <$list filter="[has[frequency]]">
> *<$vars theCount={{{ [all[current]!days:last-contact{!!frequency}count[]] 
> }}} >*
>
>   <$list filter="[all[current]!days:last-contact{!!frequency}]">
> <$link><$view field="title"/>
>   
> **
> 
>
> On Monday, September 13, 2021 at 12:12:45 PM UTC-3 0 0 wrote:
>
>> Thank you for your answer, I appreciate your help.
>> However, your suggestion does not seem to affect the underlying problem: 
>> I'm unable to get the number of tiddlers that pass the filter of second 
>> list.
>> I'll try to elaborate what I meant in my original post.
>>
>> For example let's say the outer list alone would output 100 tiddlers. If 
>> I added count[] to this filter to get the number of tiddlers this outer 
>> list outputs I will see the number 100 instead of 100 individual titles.
>> Then the inner list filters out 30 tiddlers that do not satisfy the 
>> additional condition. I see 70 tiddler titles that pass the outer AND inner 
>> filter, but I'm unable to count them (except by hand).
>> Adding count[] to the inner list would just yield a mix of 30 zeroes (0 0 
>> 0 0...for each time the currently evaluated tiddler does not pass the inner 
>> filter) and 70 ones (1 1 1 1...whenever it does).
>>
>> Now either I'd need some way to have a variable that would increase each 
>> time a tiddler passes the inner filter, or I'd need to have it all in a 
>> single-level list (which with current setup doesn't work exactly for the 
>> reason Eric describes). Or there could be a completely different approach 
>> that I'm unable to see.
>>
>> 0
>> maanantai 13. syyskuuta 2021 klo 18.02.58 UTC+3 Eric Shulman kirjoitti:
>>
>>> On Monday, September 13, 2021 at 6:51:14 AM UTC-7 cj.v...@gmail.com 
>>> wrote:
>>>
 Aside: we could merge the two <$list> filters together 
>>>
>>>
>>> That wouldn't work in this case, as the inner filter uses 
>>> `{!!frequency}`, which depends upon the outer filter to set the 
>>> `currentTiddler` value to each tiddler that `has[frequency]`
>>> If the two filters were merged, then `{!!frequency}` would refer to the 
>>> tiddler that contains the `$list` widget, rather than each tiddler that 
>>> `has[frequency]`
>>>
>>> -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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/e7d0c78f-0b61-49d8-800b-1bfd64b1d13cn%40googlegroups.com.


[tw5] Re: Count[], sum[] etc. in nested lists?

2021-09-13 Thread Charlie Veniot
<$list filter="[has[frequency]]">
*<$vars theCount={{{ [all[current]!days:last-contact{!!frequency}count[]] 
}}} >*
  <$list filter="[all[current]!days:last-contact{!!frequency}]">
<$link><$view field="title"/>
  
**


On Monday, September 13, 2021 at 12:12:45 PM UTC-3 0 0 wrote:

> Thank you for your answer, I appreciate your help.
> However, your suggestion does not seem to affect the underlying problem: 
> I'm unable to get the number of tiddlers that pass the filter of second 
> list.
> I'll try to elaborate what I meant in my original post.
>
> For example let's say the outer list alone would output 100 tiddlers. If I 
> added count[] to this filter to get the number of tiddlers this outer list 
> outputs I will see the number 100 instead of 100 individual titles.
> Then the inner list filters out 30 tiddlers that do not satisfy the 
> additional condition. I see 70 tiddler titles that pass the outer AND inner 
> filter, but I'm unable to count them (except by hand).
> Adding count[] to the inner list would just yield a mix of 30 zeroes (0 0 
> 0 0...for each time the currently evaluated tiddler does not pass the inner 
> filter) and 70 ones (1 1 1 1...whenever it does).
>
> Now either I'd need some way to have a variable that would increase each 
> time a tiddler passes the inner filter, or I'd need to have it all in a 
> single-level list (which with current setup doesn't work exactly for the 
> reason Eric describes). Or there could be a completely different approach 
> that I'm unable to see.
>
> 0
> maanantai 13. syyskuuta 2021 klo 18.02.58 UTC+3 Eric Shulman kirjoitti:
>
>> On Monday, September 13, 2021 at 6:51:14 AM UTC-7 cj.v...@gmail.com 
>> wrote:
>>
>>> Aside: we could merge the two <$list> filters together 
>>
>>
>> That wouldn't work in this case, as the inner filter uses 
>> `{!!frequency}`, which depends upon the outer filter to set the 
>> `currentTiddler` value to each tiddler that `has[frequency]`
>> If the two filters were merged, then `{!!frequency}` would refer to the 
>> tiddler that contains the `$list` widget, rather than each tiddler that 
>> `has[frequency]`
>>
>> -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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/5b499945-b112-44d7-9d0c-1dc1ad25f2d4n%40googlegroups.com.


[tw5] Re: Count[], sum[] etc. in nested lists?

2021-09-13 Thread 0 0
 Thank you for your answer, I appreciate your help.
However, your suggestion does not seem to affect the underlying problem: 
I'm unable to get the number of tiddlers that pass the filter of second 
list.
I'll try to elaborate what I meant in my original post.

For example let's say the outer list alone would output 100 tiddlers. If I 
added count[] to this filter to get the number of tiddlers this outer list 
outputs I will see the number 100 instead of 100 individual titles.
Then the inner list filters out 30 tiddlers that do not satisfy the 
additional condition. I see 70 tiddler titles that pass the outer AND inner 
filter, but I'm unable to count them (except by hand).
Adding count[] to the inner list would just yield a mix of 30 zeroes (0 0 0 
0...for each time the currently evaluated tiddler does not pass the inner 
filter) and 70 ones (1 1 1 1...whenever it does).

Now either I'd need some way to have a variable that would increase each 
time a tiddler passes the inner filter, or I'd need to have it all in a 
single-level list (which with current setup doesn't work exactly for the 
reason Eric describes). Or there could be a completely different approach 
that I'm unable to see.

0
maanantai 13. syyskuuta 2021 klo 18.02.58 UTC+3 Eric Shulman kirjoitti:

> On Monday, September 13, 2021 at 6:51:14 AM UTC-7 cj.v...@gmail.com wrote:
>
>> Aside: we could merge the two <$list> filters together 
>
>
> That wouldn't work in this case, as the inner filter uses `{!!frequency}`, 
> which depends upon the outer filter to set the `currentTiddler` value to 
> each tiddler that `has[frequency]`
> If the two filters were merged, then `{!!frequency}` would refer to the 
> tiddler that contains the `$list` widget, rather than each tiddler that 
> `has[frequency]`
>
> -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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/492433af-77c6-47b7-b177-660f5ffe8dd2n%40googlegroups.com.


[tw5] Re: Count[], sum[] etc. in nested lists?

2021-09-13 Thread Charlie Veniot
Oh yeah, oops.  Scatter-brained.

On Monday, September 13, 2021 at 12:02:58 PM UTC-3 Eric Shulman wrote:

> On Monday, September 13, 2021 at 6:51:14 AM UTC-7 cj.v...@gmail.com wrote:
>
>> Aside: we could merge the two <$list> filters together 
>
>
> That wouldn't work in this case, as the inner filter uses `{!!frequency}`, 
> which depends upon the outer filter to set the `currentTiddler` value to 
> each tiddler that `has[frequency]`
> If the two filters were merged, then `{!!frequency}` would refer to the 
> tiddler that contains the `$list` widget, rather than each tiddler that 
> `has[frequency]`
>
> -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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/2ea13df5-33f0-4645-b98d-c6153cdeb27cn%40googlegroups.com.


[tw5] Re: Count[], sum[] etc. in nested lists?

2021-09-13 Thread Eric Shulman
On Monday, September 13, 2021 at 6:51:14 AM UTC-7 cj.v...@gmail.com wrote:

> Aside: we could merge the two <$list> filters together 


That wouldn't work in this case, as the inner filter uses `{!!frequency}`, 
which depends upon the outer filter to set the `currentTiddler` value to 
each tiddler that `has[frequency]`
If the two filters were merged, then `{!!frequency}` would refer to the 
tiddler that contains the `$list` widget, rather than each tiddler that 
`has[frequency]`

-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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/3013288f-49c1-4246-8cab-7cf82008bb49n%40googlegroups.com.


[tw5] Re: Count[], sum[] etc. in nested lists?

2021-09-13 Thread Charlie Veniot
Aside: we could merge the two <$list> filters together as a fun exercise to 
reduce the amount of code, but there is nothing wrong with having the two 
there as an explicit note to yourself of what you're thinking and how you 
got there.

Reducing code/steps is a silly thing to do when those steps are a 
visual/explicit reminder or something (i.e. a trail of breadcrumbs!)

On Monday, September 13, 2021 at 10:46:50 AM UTC-3 Charlie Veniot wrote:

> G'day,
>
> Just focusing on this bit of your code:
>
> <$list filter="[all[current]!days:last-contact{!!frequency}]">
> <$link><$view field="title"/>
>   
>
> Let's do this:
>
> <$list *variable="thisTiddler" *
> filter="[all[current]!days:last-contact{!!frequency}]">
>
> <$link><$view field="title"/>
>   
>
>
> Now you can use this variable to do all sorts of things inside there.  For 
> example:
>
>
> <$list variable="thisTiddler" 
> filter="[all[current]!days:last-contact{!!frequency}]">
> <$link><$view field="title"/>*: <$text text={{{ 
> [regexpcount[]] }}}/>*
>   
>
> Please note: I've just typed all of the above here without testing/trying 
> the code in a TiddlyWiki.  So let's say that is just there for discussion's 
> sake.
> On Monday, September 13, 2021 at 6:25:03 AM UTC-3 0 0 wrote:
>
>> Hello!
>> To generate a list of overdue recurrent tiddlers I'm currently using a 
>> nested list so I can compare for each tiddler whether they haven't been 
>> interacted with in the period defined for each tiddler (frequency). 
>> Something like this:
>>
>> <$list filter="[has[frequency]]">
>>   <$list filter="[all[current]!days:last-contact{!!frequency}]">
>> <$link><$view field="title"/>
>>   
>> 
>>
>> Now due to the second list loop handling only a single title at a time, 
>> I'm unable to extract any statistical insights out of this, such as count[] 
>> -ing all the overdue tiddlers to calculate their percentage or getting the 
>> sum[] of a field value the tiddlers share (e.g. time requirement).
>>
>> Could the overdue filtering process be handled with a single list loop in 
>> any way?
>> Or is it perhaps possible to set a variable inside the inner list loop 
>> that would additively store the value for each item inside the inner list? 
>> Could you suggest any other way to approach this problem?
>>
>> Thanks a lot
>> 0
>>
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/318184c7-ba4f-47a6-ae54-5baad6443826n%40googlegroups.com.


[tw5] Re: Count[], sum[] etc. in nested lists?

2021-09-13 Thread Charlie Veniot
G'day,

Just focusing on this bit of your code:

<$list filter="[all[current]!days:last-contact{!!frequency}]">
<$link><$view field="title"/>
  

Let's do this:

<$list *variable="thisTiddler" *
filter="[all[current]!days:last-contact{!!frequency}]">
<$link><$view field="title"/>
  

Now you can use this variable to do all sorts of things inside there.  For 
example:

<$list variable="thisTiddler" 
filter="[all[current]!days:last-contact{!!frequency}]">
<$link><$view field="title"/>*: <$text text={{{ 
[regexpcount[]] }}}/>*
  

Please note: I've just typed all of the above here without testing/trying 
the code in a TiddlyWiki.  So let's say that is just there for discussion's 
sake.
On Monday, September 13, 2021 at 6:25:03 AM UTC-3 0 0 wrote:

> Hello!
> To generate a list of overdue recurrent tiddlers I'm currently using a 
> nested list so I can compare for each tiddler whether they haven't been 
> interacted with in the period defined for each tiddler (frequency). 
> Something like this:
>
> <$list filter="[has[frequency]]">
>   <$list filter="[all[current]!days:last-contact{!!frequency}]">
> <$link><$view field="title"/>
>   
> 
>
> Now due to the second list loop handling only a single title at a time, 
> I'm unable to extract any statistical insights out of this, such as count[] 
> -ing all the overdue tiddlers to calculate their percentage or getting the 
> sum[] of a field value the tiddlers share (e.g. time requirement).
>
> Could the overdue filtering process be handled with a single list loop in 
> any way?
> Or is it perhaps possible to set a variable inside the inner list loop 
> that would additively store the value for each item inside the inner list? 
> Could you suggest any other way to approach this problem?
>
> Thanks a lot
> 0
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/0521e999-14e9-4c0e-adb0-ba52e241927bn%40googlegroups.com.


[tw5] Count[], sum[] etc. in nested lists?

2021-09-13 Thread 0 0
Hello!
To generate a list of overdue recurrent tiddlers I'm currently using a 
nested list so I can compare for each tiddler whether they haven't been 
interacted with in the period defined for each tiddler (frequency). 
Something like this:

<$list filter="[has[frequency]]">
  <$list filter="[all[current]!days:last-contact{!!frequency}]">
<$link><$view field="title"/>
  


Now due to the second list loop handling only a single title at a time, I'm 
unable to extract any statistical insights out of this, such as count[] 
-ing all the overdue tiddlers to calculate their percentage or getting the 
sum[] of a field value the tiddlers share (e.g. time requirement).

Could the overdue filtering process be handled with a single list loop in 
any way?
Or is it perhaps possible to set a variable inside the inner list loop that 
would additively store the value for each item inside the inner list? Could 
you suggest any other way to approach this problem?

Thanks a lot
0

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/17c7e70b-5ccd-4d01-a804-de62e04f29f2n%40googlegroups.com.


[tw5] Re: If possible, can GG continue to co-exist with TiddlyTalk?

2021-09-13 Thread strikke...@gmail.com
Kosmo,

Agreed, for all its faults, I find GG easier to use, and would like the 
> group here to remain active. TT is just fussy and annoying.
>

I do not think it is just fussy and annoying. More material will be 
collected in one place over time and be easier to find. Example the *How to* 
and the *Showcase *categories - and more.

It is worth testing Talk tiddlywiki out for some time - if at all possible. 
Some of us have not used Discourse before and need some time to find out 
how it really works.

GG active or not  does not help much if most of the activity has moved. 



-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/487ac89b-7fb8-4912-a8a7-b4f29086bef0n%40googlegroups.com.