COUNT
COUNT is a function that calculates the number of all entries within a specified column. It helps quantify the occurrence of data points in a dataset.
Applicable to
- Calculated Columns
- Expressions
Return Value
The return value of the COUNT function is an integer representing the count of all entries.
Remark
- COUNT is a versatile function can be used for assessing the size of a dataset.
- COUNT function returns the total count including nulls and blanks.
- COUNT function can be used across Dates, Strings, and Numbers.
Syntax
COUNT(<expression>)
COUNT in Board Expression
Parameters
Expression | A placeholder in a function that is replaced with the actual widget and measure names. |
---|---|
Widget Name | The specific name or identifier of the widget being used for data visualization in the specific Infoboard. |
Measure | Represents the name of the measure that is being displayed or analyzed using the widget. |
Steps to Use COUNT
- Write the COUNT function. For instance
COUNT(<expression>)
- Replace
<expression>
with'Widget Name'[Measure]
. Replace Widget Name with the actual name of your widget and Measure with the corresponding measure name. - Set the condition with the COUNT function based on the scenario. For instance, you can set the count entries that meet a certain criterion, as the condition.
- To learn how to configure an Expression in Infoveave, visit the section Configure Expression.
Example
Scenario Imagine you are responsible for overseeing a Solar Grid Management System, and your primary objective is to ensure that the grid operates efficiently and safely. One critical aspect is monitoring the number of solar customers connected to the grid in real-time.
Scenario Details
- Dashboard Name Solar Energy Dashboard
- Widget Name Solar In
- Measure Solar Customers (quantifying the number of solar customers)
- Dimension Discount Types (categorizing customers based on their payment behavior)
- Dimension Value “Always” (representing customers who pay their bills on time)
Objective Your goal is to use the COUNT function within an Expression to count the number of solar customers in real-time. When this count reaches a certain value, you want to trigger an action to alert users that the grid is approaching capacity.
You can use the COUNT function like this
COUNT('Solar In'[Solar Customers])=100
COUNT in Calculated Columns
Parameters
Expression | A placeholder in a function that is replaced with the column names. |
---|---|
Column Name | The name of the column in the dataset or Datasource that contains the values you want to analyze. |
Write the COUNT function. For instance
COUNT(<expression>)
- Replace
<expression>
with[Column Name]
.Replace Column Name with the actual name of your column required. - To learn how to add calculated columns in Infoveave, visit the section Calculated Columns.
Example
Objective Consider that you have the below sales dataset, your goal is to count the number of rows in the dataset.
ORDER DATE | COUNTRY | CATEGORY | UNIT PRICE | MARKET PRICE | QUANTITY |
---|---|---|---|---|---|
2024-01-03 | Brazil | Baby Food | 38.41 | 43.7874 | 2 |
2024-01-07 | Japan | Spices | 45.56 | 50.8155 | 20 |
Japan | 43.7874 | 10 | |||
2024-01-18 | 32.3019 | 4 | |||
2024-01-22 | Brazil | Cosmetics | 28.335 | 23.0109 | 7 |
2024-01-26 | Canada | 20.185 | 23.0109 | 9 | |
2024-01-04 | France | Cereal | 25.26 | 28.7964 | 9 |
2024-01-09 | Brazil | Cereal | 44.575 | 50.8155 | 8 |
2024-01-14 | Brazil | Snacks | 20.185 | 4 | |
Brazil | Cosmetics | 40.485 | 46.1529 | 2 |
You can use the COUNT function like
COUNT([COUNTRY])
The new calculated column “Total Entries” will return the total number of rows in the dataset considering nulls and blanks as 10
ORDER DATE | COUNTRY | CATEGORY | UNIT PRICE | MARKET PRICE | QUANTITY | TOTAL ENTRIES |
---|---|---|---|---|---|---|
03-01-2024 | Brazil | Baby Food | 38.41 | 43.7874 | 2 | 10 |
07-01-2024 | Japan | Spices | 45.56 | 50.8155 | 20 | 10 |
Japan | 43.7874 | 10 | 10 | |||
18-01-2024 | 32.3019 | 4 | 10 | |||
22-01-2024 | Brazil | Cosmetics | 28.335 | 23.0109 | 7 | 10 |
26-01-2024 | Canada | 20.185 | 23.0109 | 9 | 10 | |
04-01-2024 | France | Cereal | 25.26 | 28.7964 | 9 | 10 |
09-01-2024 | Brazil | Cereal | 44.575 | 50.8155 | 8 | 10 |
14-01-2024 | Brazil | Snacks | 20.185 | 4 | 10 | |
Brazil | Cosmetics | 40.485 | 46.1529 | 2 | 10 |