count

count — aggregate function to return the count of rows that match the query's predicate.

SYNOPSIS

count()

count(expr)

DESCRIPTION

The count() function with no arguments returns the number of rows that meet the query predicate conditions. When used with an optional expression argument, count() includes those rows for which the expression evaluates to a non-null value.

EXAMPLE

This example shows how to issue a dynamic aggregation query that counts the number of values in a column.

  1. In LiveView Desktop connected to a server running the Hello LiveView sample, select the ItemsSales table from the Tables pane of the LiveView Tables view.

  2. In the Select field, enter:

    count(if (quantityRemaining < 10) then true else bool()) as lowInventory
    
  3. Make sure the Query field is empty.

  4. Click Open Query.

The query results open in a grid view. The count aggregate updates when the number of rows returned by the query changes.

SEE ALSO

This LiveView aggregate function is based on the count aggregate function in the StreamBase expression language.