Hey, Coda, Josiah —
You could try something like this:
<!-- Set a range from 1 to the number of items -->
<$formula-vars indexRange=" '1,' & count([myFilter]) ">
<!-- Go through the range... -->
<$list variable="index" filter="[range< indexRange >]">
<!-- Get the Nth element from the filter... -->
<$list filter="[myFilter] +[nth<index>]">
#<<index> = {{!!title}}
</$list>
</$list>
</$formula-vars>
In the future, Formulas should include some ability to go through arrays
and apply a function to each item inside them, which would form a more
efficient solution than the one here (which will scale up poorly because it
runs myFilter once for each element in the list).
Last year I wrote a filter operator plugin called addposition
<https://groups.google.com/forum/#!topic/tiddlywiki/13_TTJqEEiw> that can
be used to solve this same problem more efficiently.
On Friday, 22 December 2017 10:34:46 UTC-6, coda coder wrote:
>
> Hi Evan -- I have the exact same question...
>
> I was hoping to apply the range operator but couldn't figure out the
> syntax.
>
> <$list filter="[tag[x]range-magic-here[]]" variable=tid>
>
> <!-- now each iteration outputs title1, title2, title3 ... etc -->
>
> </$list>
>
> I figured maybe I need textjoin outside the filter? But again... can't
> get my head around the two syntax "universes" ;)
>
>
> Coda
>
> On Friday, December 22, 2017 at 9:51:15 AM UTC-6, @TiddlyTweeter wrote:
>>
>> Ciao Evan
>>
>> A simple question I'm not sure or not if it deals with ...
>>
>> Can it generate serial numbering?
>>
>> *Example Use Case: *12 Tiddlers, each of which, using your formulae, is
>> a financial ledger for transactions for one month of the year for multiple
>> expenses and incomes. Each transaction needs a serial number--starting from
>> 1 for the first transaction in January (Italian accounting year is
>> co-terminus with the calendar year). It would be best if this were
>> automatically incremented. Manually applying them would be error prone. In
>> book-keeping they are very useful. So that you can manually add them onto
>> source documentation so that accountants can quickly locate the source for
>> a record. In my use case I'd restart numbering at 1 each financial year.
>>
>> Just wondering as I work with your plugin creating a real book-keeping
>> system how to do this?
>>
>> Very best wishes
>> Josiah
>>
>> On Friday, 15 December 2017 05:37:26 UTC+1, Evan Balster wrote:
>>>
>>> Hello, all —
>>>
>>> I got fed up with the lack of good number-crunching capabilities in
>>> TiddlyWiki, and after griping about it for a year I fixed it.
>>>
>>> Introducing the *Formula plugin*:
>>> http://evanbalster.com/tiddlywiki/formulas.html (currently version
>>> 0.1.2)
>>>
>>
--
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 https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/f73a3a66-be66-4f93-ad6e-9ae1bdf3981b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.