countif — aggregate function to return the count of rows that match the query's predicate.
The countif() function with one argument returns the number of rows for which the specified predicate argument evaluates to true. When used with two arguments, it returns the number of rows for which the specified column is not null and the predicate evaluates to true.
This example shows how to issue a dynamic aggregation query that counts the number of values that meet a certain criterion.
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.
In the Select field, enter:
Item, countif (Item, lastSoldPrice > 75) as NumBigSales
In the Query field, enter the following:
group by Item
The query results open in a grid view. The countif aggregate updates when the number of rows returned by the query changes.
This LiveView aggregate function is based on the countif aggregate function in the StreamBase expression language.