Hello —
In your first code example, there is a space after the !!, which is invalid
syntax for a TiddlyWiki transclusion. Or rather, it's looking for a field
whose name begins with a space (and no such field exists).
In your second example, you use filters, which always produce an array
(list) of things as a result. Even with the count[] operator you are
producing an array which contains the count. (Automatic conversion might
be reasonable here but it's not how Formulas thinks...) I suggest using
the "count" *function* instead:
count([tag{!!grupo}tagging[]has[Presenças]]) / count([tag{!!grupo}tagging[]
])
You could also use the function "first" to grab the first item from the
array.
On Sunday, 18 February 2018 16:32:54 UTC-6, @magasine wrote:
>
> Hi
>
> I'm trying to use 2 fields as arguments to a function and results in
> error: "ComputeError: Can not convert 5 to number"
>
> (= divide( {{!! total_presencas}} , {{!! total_integrantes}} ) =)
>
> I also tried filters and the same thing happens
>
> (= [tag{!!grupo}tagging[]has[Presenças]count[]] / [tag{!!grupo}tagging[]
> count[]] =)
>
> Sorry, I have little code experience and I do not know what the error is.
>
> TIA
>
> Manoel.
>
>
> Em quarta-feira, 17 de janeiro de 2018 05:15:24 UTC-2, Evan Balster
> escreveu:
>>
>> Announcing the second generation of my formula plugin for TiddlyWiki.
>>
>> See the *Formula wiki* for the latest documentation:
>> http://evanbalster.com/tiddlywiki/formulas.html
>>
>> *Report issues and view source GitHub*:
>> https://github.com/EvanBalster/TiddlyWikiFormula
>>
>>
>> Formula lets you do computation in TiddlyWiki in the style of popular
>> spreadsheet apps Excel and Google Sheets, with the addition of TiddlyWiki's
>> own filter, transclude and variable systems. Tiddlers can behave like
>> individual rows in a spreadsheet. A large collection of built-in functions
>> is included, for use with text, numbers, dates, arrays and regular
>> expressions.
>>
>> Formula is implemented as a widget, with a special *(=* "mushroom
>> bracket" *=)* syntax for inclusion in WikiText, and can also be used in
>> widget/HTML attributes. Formulas included via transclusion, filters and
>> variables are computed and refreshed like any other part of your wiki.
>>
>> (= ( sum([tag[Profits]get[value]]) - sum(tag[Expenses]get[value]]) ) * {{
>> Tax!!rate}} =)
>>
>> The second generation of formula adds support for local variables,
>> comments, lambda functions and element-wise operations on arrays (such as
>> filter results), allowing more advanced computations to be expressed inside
>> TiddlyWiki. Search the wiki for "demo" to see some of the things I've
>> built.
>>
>>
>> The plugin is a work in progress and may have bugs. Please report these
>> on GitHub or in this thread.
>>
>
--
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/8ed90ed3-4eb3-49ab-bce4-3de6615f4846%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.