count function
The count function returns the number of times each distinct value is present in an attribute.
In its most simple form, count(), it can also be used to simply count the number of overall values in an attribute.
Parameters
count(group)
Parameter | Description |
---|---|
group | The attribute by which you want to group results. A list of attributes can also be provided in the column parameter, as long as they are enclosed in double brackets, i.e. count((column1, column2)), or as a range of values, divided by a colon, i.e. count(column1 : column5). |
Example - count
The following example uses the Bike Sales dataset.
Description | Screenshot |
---|---|
In the example, we want to fill the count attribute with the number of overall values in the attribute. We simply write the formula | |
If we want to count the number times distinct values are present in the Country attribute, enter Country in the column parameter. The formula to write will be: The results show us that Canada is present in the Country attribute 14178 times, while Australia is present 23936 times, and so on. | |
If we want to group the Country results by a State, we can enter both attributes as a list in the column parameter. The formula to write will be: The results can be read as follows:
|