0

count (aka cnt)

To return the number of concrete items in an array

With this function, you can count the number of entries in arrays or tables that are not null or empty strings ("").

ℹ️ If you'd like to count all items in your array, we recommend using length().

In combination with select ... where you can count records that meet a specific condition. For example, how many entries have the status open, or how many last names start with a B.

The function can also be very helpful to find out if there are any duplicates in your table.

 

Syntax

count([any])

cnt([any])

 

Return

number

 

Examples

count("A", "B", "")count("A", "B", "")

Result: 2

count(select Invoices where Total >= 1000)count(select Invoices where Total >= 1000)

Result: 98

(if the table Invoices contains 98 records, where the Total is greater than USD1,000)

let ids := (select Contact).'Customer-Id';cnt(ids) = cnt(unique(ids))let ids := (select Contact).'Customer-Id'; cnt(ids) = cnt(unique(ids))

Return: If all IDs are unique, the result is Yes (true). If there are duplicates, the result is No (false).

 

 

See also

select ... where

length, which returns the count of all characters in a string or all items in an array.

ℹ️ Do you want to dive deeper into the topic? Take a look at the corresponding part of our video tutorial.

Reply

null