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)

ArgumentTypeDescription
numberListNumber ArrayAn Array containing a list of numeric values
conditionListCondition ListAnĀ 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

{
	{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