Features / Usability

Features / Usability

How do I create a mathematical calculation tracker field?

posts: 38 United States

I'm a bit stumped on this one. I found this page, which purports to tell me how to create a "basic tracker field that calculates its value from the other fields in the tracker item". Then it gives some syntax, which looks like LISP expressions. But where am I supposed to use this at?

I've got a tracker, and a template that lays the fields in the tracker out in a page, and a page that creates a tracker plugin to create a new item in the tracker. Presumably I also need a page that creates a similar plug-in to display the item itself using the same template.

What I'm trying to accomplish is to add several of the (numeric) fields up and display them somewhere on the page, and it sounds like the mathematical calculation tracker field can do this.

But where do all these LISP-like expressions go? The documentation is silent. It shows an example using what looks like a "TRACKERMATH" plug-in, but this apparently isn't a plug-in at all, but a parameter to a strangely named "fitness/fitnesse" plug-in for testing purposes only. If I just put the parenthesized expression on the page by itself, it just gets displayed. If I put it in braces (but then how does it know which tracker to use???), for some reason none of the template gets rendered at all on the page, and attempts to edit the page (with the tracker plugin, not the template) fail due to nasty Smarty Exception.

Now, another think I don't understand is why the mathematical calculation tracker field points me to documentation for ratings. I see the operators available there, but aside from that, what do ratings have to do with what I am trying to accomplish? I am a bit nervous, because I don't even have ratings enabled; when I try to click on them in the admin it tells me I have to create or edit a forum before I can enable ratings, and I don't want any forums. Do ratings have to be enabled before Mathematical Calculation Tracker Fields work?

Is there an example somewhere that demonstrates a working practical example? What is the context in which these parenthesized expressions are used???

posts: 38 United States

To answer my own question, based on a reply from mikeua in another thread.


The Mathematical Calculation tracker field is a special type of field added in a tracker.  It doesn't show up by default, and in the admin home you have to enabled "Advanced" features to see it.  The option is (trackerfield_math) and can be found by searching for "calculation" when the "Advanced" checkbox is checked.  It is somewhere under "trackers"  and is a field type that must be enabled.

Once "Mathematical Calculation" is selected as the type of a field, the formula is entered under the options in the dialog box for configuring the field.