DISTINCTCOUNTNOBLANKX
The DISTINCTCOUNTNOBLANKX function in Infoveave calculates the number of unique, distinct values in a column or dataset, while considering a specific condition or criteria defined. It counts how many different items meet the specified condition, excluding rows or items that are blank or empty.
Applicable to
- Calculated Columns
- Expressions
Return Value
- The return value of the DISTINCTCOUNTNOBLANKX function is an integer representing the count of unique, non-blank values in the specified column or dataset that satisfy the specified condition.
Remark
- DISTINCTCOUNTNOBLANKX is useful when you want to count the number of distinct items in a column or dataset while applying a specific condition or filter. It ensures that only rows or items with meaningful (non-blank) values are considered.
- DISTINCTCOUNTNOBLANKX function can be used across Date, Strings and Numbers.
- DISTINCTCOUNTNOBLANKX function takes only all values into account.
Syntax
DISTINCTCOUNTNOBLANKX(<expression>,<Condition>)
DISTINCTCOUNTNOBLANKX in Board Expression
Parameter | Description |
---|---|
Expression | A placeholder in a function that is replaced with the actual widget and measure names. |
Condition | A placeholder in a function that is replaced with the condition filter. |
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. |
Dimension | Represents the dimension column that is being displayed or analyzed using the widget. |
Dimension Value | Represents the specific dimension items within the dimension column used for the visualization in the widget. |
Steps to Use DISTINCTCOUNTNOBLANKX
- Write the DISTINCTCOUNTNOBLANKX function. For instance
DISTINCTCOUNTNOBLANKX(<expression>,<condition>)
- Replace
<expression>
with'Widget Name'[Measure]
and<condition>
with[Dimension Name]="Dimension Value"
. Replace Widget Name, Measure, Dimension, and Dimension Value with your actual values. - Set the DISTINCTCOUNTNOBLANKX function based on the scenario.
- To learn how to configure an Expression in Infoveave, visit the section Configure Expression.
Example
Scenario
- You are managing a dataset and an associated Infoboard named ‘Finance Customers’ within your Finance Management System. Your primary objective is to monitor the eligibility of finance customers for discounts. Specifically, you want to count the number of unique finance customers who belong to either the “Pay on Time” or “No Discount” category. Moreover, you aim to ensure that this count remains less than or equal to 100. If the count of eligible customers drops to 100 or below, you intend to trigger a specific action on your dashboard.
Scenario Details
- Dashboard Name Finance Management Dashboard
- Widget Name Finance Customers
- Measure Name Customers (representing the number of customers)
- Dimension Name Discount Types (categorizing customers based on their payment behavior)
- Dimension Values “Pay on Time” (customers who pay their bills on time) and “No Discount” (customers not eligible for any discount)
Objective
Your objective is to count the number of unique solar customers who belong to either the “Pay on Time” or “No Discount” category, and you want to ensure this count is less than or equal to 100 to trigger a specific action on your dashboard.
- You can use the
DISTINCTCOUNTNONBLANKX
function like this
DISTINCTCOUNTNONBLANKX('Finance Customers'[Total Customers], [Discount Types] = "Pay on Time" OR [Discount Types] = "No Discount") <= 100
DISTINCTCOUNTNOBLANKX in Calculated Columns
Parameter | Description |
---|---|
Expression | A placeholder in a function that is replaced with the column names. |
Condition | A placeholder in a function that is replaced with the condition filter. |
Column Name | The name of the column in the dataset or Datasource that contains the values you want to analyze. |
Filter Condition | A filter condition returns the data points that meet the defined condition that you want to analyze. The filter condition can be either a string or a numeric. |
Steps to Use DISTINCTCOUNTNOBLANKX
- Write the DISTINCTCOUNTNOBLANKX function. For instance
DISTINCTCOUNTNOBLANKX(<expression>,<condition>)
- Replace
<expression>
with[Column Name]
and<condition>
with[Column Name]="Column Value"
. Replace Column Name with the required column name in the dataset. - To learn how to use Infoveave functions in calculated columns, visit Add Calculated Column under Sources.
Example
Objective Consider that you have the below sales dataset, your goal is to count the distinct number of rows in the dataset where COUNTRY is BRAZIL and CATEGORY is BABY FOOD, excluding null or blanks.
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
DISTINCTCOUNTNOBLANKX
function like
DISTINCTCOUNTNOBLANKX([COUNTRY],[COUNTRY]="Brazil" AND [CATEGORY]="Baby Food")
The new calculated column will return the total number of rows that met the condition as 1
ORDER DATE | COUNTRY | CATEGORY | UNIT PRICE | MARKET PRICE | QUANTITY | COUNTRY COUNT |
---|---|---|---|---|---|---|
03-01-2024 | Brazil | Baby Food | 38.41 | 43.7874 | 2 | 1 |
07-01-2024 | Japan | Spices | 45.56 | 50.8155 | 20 | 1 |
Japan | 43.7874 | 10 | 1 | |||
18-01-2024 | 32.3019 | 4 | 1 | |||
22-01-2024 | Brazil | Cosmetics | 28.335 | 23.0109 | 7 | 1 |
26-01-2024 | Canada | 20.185 | 23.0109 | 9 | 1 | |
04-01-2024 | France | Cereal | 25.26 | 28.7964 | 9 | 1 |
09-01-2024 | Brazil | Cereal | 44.575 | 50.8155 | 8 | 1 |
14-01-2024 | Brazil | Snacks | 20.185 | 4 | 1 | |
Brazil | Cosmetics | 40.485 | 46.1529 | 2 | 1 |