Skip to main content

TableCount

The TableCount function returns the number of rows in a table matching the specified filter.

Prototype

    TableCount(Table ; Where)

Arguments

    Table       Variable/String       By value  

Argument contains the variable of type table or a valid string containing the name of
an AF table or an attribute table.

Where String By value

A valid string containing a Where Clause Reference the next section .
Where parameter can be empty (''). When empty, the total number of rows is returned.

See SFHub Table Row Filter Syntax for more details

Returns

    Number

The number of selected rows.

Exception

    Undefined

Undefined is returned if:

- TableName is empty, or Undefined or not a valid String
- Where is not a valid SQL statement

Examples

    TableCount($$myTable; '')

This will return the [total number of rows recorded] in $$myTable.

    TableCount('SF_Component table'; 'MolecularWeight > 20' )

This will return the number of selected rows from the AF Table SF_Component table, according to the specified filter.

    TableCount('SF_Component table'; 'Component like \'C2\'')

This will return the number of selected rows from the AF Table SF_Component table according to the specified filter [(Component starts with 'C2')].

    TableCountTableCount("i_ CompositionTrackingResults"; 'Material=\'C3\'')

This will return the number of selected rows from the data table stored into the[ i_CompositionTrackingResults] attribute according to the specified filter (Material='C3').