8,849
edits
Changes
no edit summary
This works similar to [[sslogic]] but will do calculations based on the formula you provide. It works as follows:
<pre>style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><!--@sscalculation(@field@*0.05)-->
</pre>
To obtain a Sum (for example) of the values in a [[Custom Field]] for all transactions associated with a Company/Contact using [[sscalculation]]:
<prestyle="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">
<!--@sscalculation( [#(?object=transaction;)$add this$+#]0)-->
</pre>
* If you need to pull information from the level 1 when you are at level 2 within the sscalculation tag, you can use the parent keyword
<prestyle="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">
<!--@sscalculation(date_format("@parent.fullstartdate@",%Y))-->
</pre>
* To sum a value on a UTA Company field (Custom Field ID 123456) for all companies with role ''Funding Agency'' AND a value stored on the level 1 (Custom Field ID 545454) and format it with no decimal places:
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; <white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><!--@sscalculation(format(( [#(?object=company;criteria=rolename='Funding Agency') $?opc_123456.value$ + #] @#545454.value#@),0))--></pre>
* To find the average of all values (Custom Field ID 1755555) on a particular Level 2 Type (typeid=54321), excluding a particular status ([[statusid]] is not 10001), rounded to the nearest whole number:
<pre style="white-space: pre-wrap; <white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><!--@sscalculation(format( ( [#(?object=activity;criteria=typeid='54321' and status.statusid not in ('10001')) $1755555$ + #] 0 )/@level2.count(*):typeid='54321' and status.statusid not in ('10001')@,0))--> </pre>
* To parse out date/time information from a custom field and display it in a different format, you can use the following syntax on level 2, referencing the field ''fieldname'' on level 1:
<prestyle="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><!--@sscalculation(date_format("@parent.fieldname@","%M %d, %Y"))--></pre>
* Use the following arguments to format the date/time information: