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.
count([any])
cnt([any])
number
1
count("A", "B", "")
Result: 2
1
count(select Invoices where Total >= 1000)
Result: 98
(if the table Invoices contains 98 records, where the Total is greater than USD1,000)
1
let ids := (select Contact).'Customer-Id';
2
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
).Do you want to dive deeper into the topic? Take a look at the corresponding part of our video tutorial.
Last modified 5mo ago