countIf function
The countIf function counts the number of times a distinct value, which meets a specified condition, is present in an attribute.
Parameters
countIf(condition,group)
Parameter | Description |
---|---|
condition | The condition that must be met for the value to be counted. The condition parameter is mandatory. |
group | The attribute by which you want to further group results. |
Example - countIf(condition)
Description | Screenshot |
---|---|
In the example we want to count the number of times the value in the Month attribute is November. We write the following formula in the formula bar:
Only the values which satisfy the conditions will be counted. In the Month attribute, the value is November in 8734 rows. |
Example - countIf(condition, group)
Description | Screenshot |
---|---|
If we want to group our results, we just need to add a group parameter. In this example, we want to group our results by the Country attribute values, so we type the formula:
The results are:
and so on. |