SUM Function: Difference between revisions

From Planfix
Jump to: navigation, search
No edit summary
No edit summary
 
Line 6: Line 6:
}}
}}
'''SUM()''' — is a function that sums all values when calculating a [[formulas|formula]]. It is applied to each element of the multiplying variable.
'''SUM()''' — is a function that sums all values when calculating a [[formulas|formula]]. It is applied to each element of the multiplying variable.
== Format ==
== Format ==
*SUM(expression)
*SUM(expression)


Arguments:
Arguments:


'''Expression''' - a mandatory parameter, a variable, or a formula with the final sum of several strings.
'''Expression''' - a mandatory parameter, a variable, or a formula with the final sum of several strings.
== Example ==
== Example ==
For example, you have a data tag "Service", and you want to calculate the total cost of all services. To do this, specify the function:
For example, you have a data tag "Service", and you want to calculate the total cost of all services. To do this, specify the function:
Line 25: Line 22:


<div style="display: block; padding: 1em; margin: 0 0 10px; font-size: 13px; line-height: 1.65; color: black; word-wrap: break-word; background-color: #f9f9f9; border: 1px solid #ddd; border-radius: 4px;"><nowiki>SUM({{Data Tag.Service.Cost}}*{{Data Tag.Service.Amount}})</nowiki></div>
<div style="display: block; padding: 1em; margin: 0 0 10px; font-size: 13px; line-height: 1.65; color: black; word-wrap: break-word; background-color: #f9f9f9; border: 1px solid #ddd; border-radius: 4px;"><nowiki>SUM({{Data Tag.Service.Cost}}*{{Data Tag.Service.Amount}})</nowiki></div>
== Important ==
== Important ==
*The function SUM () can contain any formula that consists of functions.
*The function SUM () can contain any formula that consists of functions.

Latest revision as of 14:14, 30 October 2024

SUM() — is a function that sums all values when calculating a formula. It is applied to each element of the multiplying variable.

Format

  • SUM(expression)

Arguments:

Expression - a mandatory parameter, a variable, or a formula with the final sum of several strings.

Example

For example, you have a data tag "Service", and you want to calculate the total cost of all services. To do this, specify the function:

SUM({{Data Tag.Service.Cost}})


To get the total cost of services that may be provided more than once, you must multiply the cost by the quantity and then add it all up. At the end, you specify a formula like this:


SUM({{Data Tag.Service.Cost}}*{{Data Tag.Service.Amount}})

Important

  • The function SUM () can contain any formula that consists of functions.


Go To