What I’d also like to have is the calculations grouped by the day of the week. I used the created date, and much to my surprise, the first line does seem to convert this to the days and then group them, but the rest of the calculations don’t work - probably because it’s the completely wrong approach
So, in trying to understand what’s going on, I think the 1st line uses the created date to group the tiddlers according to the particular day of the week they were created.
The 2nd line then counts the number of tiddlers created on each day (A)
So, if each tiddler has a field ‘r’, how would I, for example, count the content of the field and display it in the next column (B)?
Sorry, I didn’t have enough time this morning to explain how it works, but I think you got it right.
[…] how would I, for example, count the content of the field […]
I’m not exactly sure what you mean by “count the content”. If field r contains a number and you want to add that number for all fields with the same weekday A, then you would best use the :reduce prefix. That one is a bit complicated, but powerful. If you can confirm that I correctly identfied what you want to do, I’ll be happy to explain it with some code, though.
I changed the inner two lists to simple variable assignments, since there is nothing to iterate over, just a single value. These $let assignments use inline filtered transclusions for that. The $text widgets just makes sure that the output doesn’t get “linkified”.
The filter expression for “B” starts the same as in my previous post, but ends with basically your code, using :filter and :and: All tiddlers with a date matching <<weekday>> are filtered to see if their r field contains a number greater than zero, and the remainder counted.
There were some syntax errors in your original code (e.g. missing spaces and </$list>s) that might have contributed to you not getting the expected results. I can’t guarantee for the code above, as I had no data to test it with, but I have a good feeling about it.
Also, check out this filter debug plugin that lets you see what’s going on inside filter runs. Makes programming more complex filter expressions much easier…
The problem was that the filter output in the definition of B after the match<weekday> check is not the original title anymore, but the name of the weekday. This name is then used in subsequent runs, and naturally will not find anything, as these tiddlers don’t exist.
The correct line should be:
Here, the date name check is moved into a separate :filter run, which doesn’t change the original titles, so they are still available for the other :filter run.
In the definition of A that is not a problem, since here the original titles are not required for count.