Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples
New in version: 9.0   9.1   9.2   9.3   9.4   9.5   10.0   10.1   10.2   10.3    Statistic  


Calculates sum value in a matrix column.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
Matrix 9.2 Yes Yes Yes Yes Yes
MBS( "Matrix.Sum"; MatrixRef; Column { ; firstRow; lastRow } )   More


Parameter Description Example value
MatrixRef The matrix reference number. $matrix
Column The index of the column.
Default is 0.
firstRow Optional
The index of first row.
Default is 0.
lastRow Optional
The index of last row.
Default is FM.SQL.RowCount-1.


Returns number or error.


Calculates sum value in a matrix column.
You got a record set in memory and we can walk over a column in a given row range to add the sum value.


Sums the values in a matrix:

Set Variable [ $matrix; Value: MBS("Matrix.New";3;3) ]
# Set the values of the matrix
Set Variable [ $r; Value: MBS( "Matrix.SetColumn"; $matrix; 0;"15¶07¶92" ) ]
Set Variable [ $r; Value: MBS( "Matrix.SetColumn"; $matrix; 1;"17¶3¶60" ) ]
Set Variable [ $r; Value: MBS( "Matrix.SetColumn"; $matrix; 2;"15¶1¶87" ) ]
# Add all numbers in the matrix (3x3)
Set Variable [ $a; Value: MBS( "Matrix.Sum"; $matrix; 0 ) ]
Set Variable [ $b; Value: MBS( "Matrix.Sum"; $matrix; 1 ) ]
Set Variable [ $c; Value: MBS( "Matrix.Sum"; $matrix; 2 ) ]
Set Variable [ $sum; Value: $a+$b+$c ]

Set Variable [ $r; Value: MBS("Matrix.Free"; $matrix) ]

See also

Blog Entries

FileMaker Magazin

Created 8th April 2019, last changed 17th December 2019

Matrix.SetValue   -   Matrix.Text

Feedback: Report problem or ask question.

MBS Xojo Plugins