Re: Re: mathematical calculation tracker field
In order to create a mathematical calculation, you need to create two 'numeric' type fields + a mathematical calculation field for the mathematical calculation to work, here is an example -
(assumtion - tracker is already created)
Create fields:
- Go into that tracker by chosing 'edit fields' > 'add field' > type 'numeric field' (from the drop down menu)
Permanent Name:
- this is very important to note, as the 'permanent name' will almost always be slightly different from the name you gave the field.
- in the case of non-English language it almost alwasy changes it to the letter 'f' + the number of the field, i.e. 'f_254'
- in the screenshot below you can see the permament name for field #95, 'Hectares_Start' was changed to 'hectaresStart'
Mathematical Calculation:
- finally, you create your 'mathematical formula' type field, give it a name, open up the second option, 'Options for Mathematical Calculations', and place your formula in the box 'Calculation'
- always put it in parenthesis
- always start with what you want to do
- add is 'add', subtract is 'sub', divide is 'div', multiply is 'mul'
- I'm still learning the advanced 'if', 'and', 'or', etc.
- in my example I need to calculate how many hectares the farming combine harvested of corn (hectares is square kilometers, i.e. square miles) so I created a formula that subtracted the ending amount from the starting amount. Like when you drive in a car and started at 46555 km (say, for example the permanent field name is 'start') and ended at 46560 km (field name 'end'), or you drove 5km, you would need the formula to subtract 46560 km - 46550 km = 5km. Mathematical formula would look like this: (sub end start)
- rounding: next problem you will discover (mostly with multiply or divide formulas) is too many numbers after the decimal place, i.e. 4.58690485. To solve this add another set of parenthesis with two parts, the word 'round' at the beginning, and a number at the end for how many digits you want after the decimal place (two in this example):
- i.e. (round(sub end start)2)
As you noted, all the formulas are on the Advanced Ratings page.
I don't use templates, but just Tracker List on a tiki page and enter all the parameters I want to display (fields to display, filters, sorting, etc.)
Hope this helps a little,
Mike