PhixFlow Help
sumIf
Function: sumIf()
Returns the sum of a set of numbers based on a series of corresponding true/false conditions.
Syntax
sumIf(numberList, conditionList)
Argument | Type | Description |
---|---|---|
numberList | Number Array | An Array containing a list of numeric values |
conditionList | Condition List | AnĀ Array containing a list of PhixFlow expressions that must evaluate to true or false |
Examples
Example 1
sumIf([1,1,1,1], [1,0,1,0])
returns 2.
Example 2
sumIf(in.Total, in.Include)
If this is applied to the 3 records from the in pipe (the following is pseudo-code used to represent a recordset):
{ {Total = 32, Include = 1}, {Total = 20, Include = 0}, {Total = 15, Include = 1}, }
returns 47.
See Also
Please let us know if we could improve this page feedback@phixflow.com