# MissingCount - chart function

MissingCount() is used to aggregate the number of missing values in each chart dimension. Missing values are all non-numeric values.

Syntax:

MissingCount({[SetExpression] [DISTINCT] [TOTAL [&lt;fld {,fld}&gt;]]} expr)

Return data type: integer

Arguments

| Argument | Description |
| --- | --- |
| expr | The expression or field containing the data to be measured. |
| SetExpression | By default, the aggregation function<br>will aggregate over the set of possible records defined by the selection.<br>An alternative set of records can be defined by a set analysis<br>expression. |
| DISTINCT | If the word<br>DISTINCT occurs before the function<br>arguments, duplicates resulting from the evaluation of the function arguments are disregarded. |
| TOTAL | If the word<br>TOTAL occurs before the function<br>arguments, the calculation is made over all possible values given<br>the current selections, and not just those that pertain to the current dimensional value, that is, it disregards the chart dimensions.<br><br>By using TOTAL [&lt;fld {.fld}&gt;], where the TOTAL qualifier is followed by a list of one or more field names as a subset of the chart dimension variables, you create a subset of the total possible values.<br><br>[Defining the aggregation scope](https://help.qlik.com/en-US/sense/November2025/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/define-aggregation-scope.htm) |

Example: Chart expressions

| Example | Result |
| --- | --- |
| `MissingCount(OrderNumber)` | Returns the number of missing values where `OrderNumber` fields are empty.<br><br>Information note"0" counts as a value and not an empty cell. However, if a measure aggregates to 0 for a dimension, that dimension will not be included in charts. |
| `MissingCount(OrderNumber)/MissingCount({1} TOTAL OrderNumber)` | The expression returns the number of incomplete orders from the selected customer as a fraction of incomplete orders from all customers. |

## Example - MissingCount fundamentals

[](https://help.qlik.com/en-US/sense/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/CounterAggregationFunctions/missingcount.htm)

#### Chart expression

Overview

Open the Data load editor and add the load script below to a new section.

The load script contains:

* A dataset which is loaded into a data table called `Example`.

* The following fields in the data table:

  * `Customer`

  * `Product`

  * `OrderNumber`

  * `UnitSales`

  * `UnitPrice`

Load script

```
Example:
LOAD * inline [
Customer, Product, OrderNumber, UnitSales, UnitPrice
Astrida,AA, 1,4,16
Astrida, AA,7,10,15
Astrida, BB,4,9,9
Betacab, BB,6,5,10
Betacab, CC,5,2,20
Betacab ,DD,,,25
Canutility, AA,,,15
Canutility, CC,,,19
Divadip, AA,2,4,16
Divadip, BB,,4,16
Divadip, DD,3,,25
];
```

Results

Load the data and open a sheet. Create a new table and add this field as a dimension:

* `Customer`

Create the following measures:

* `=MissingCount(OrderNumber)`, to calculate the number of orders missing an `OrderNumber`.

* `=MissingCount(OrderNumber)/MissingCount ({1} Total [OrderNumber])`, to return the number of incomplete orders from the selected customer as a fraction of incomplete orders from all customers. To show this value as a percentage, under Number formatting, select Number &gt; Formatting Simple &gt; 12.34%.

Results table

| Customer | MissingCount(OrderNumber) | MissingCount(OrderNumber)/MissingCount ({1} Total [OrderNumber]) |
| --- | --- | --- |
| Totals | 4 | 100.00% |
| Astrida | 0 | 0.00% |
| Betacab | 1 | 25.00% |
| Canutility | 2 | 50.00% |
| Divadip | 1 | 25.00% |

In the first measure, the `MissingCount` function returns `4` because `4` of the `11` records in the `OrderNumber` field are empty.

Information note"0" counts as a value and not an empty cell. However, if a measure aggregates to 0 for a dimension, that dimension will not be included in charts.

In the second measure, the output of the `MissingCount` function returns the number of incomplete orders from the selected customer as a percentage of incomplete orders from all customers. For example, if you select `Canutility` from the `Customer` dimension, the measure returns `50%` because half of all incomplete orders (`2` of `4`) are with this customer.

## Example - Using MissingCount to identify missing product data

[](https://help.qlik.com/en-US/sense/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/CounterAggregationFunctions/missingcount.htm)

#### Chart expression

Overview

A dataset contains monthly key product indicater (KPI) data. A product manager wants to find out which KPIs have missing data.

Open the Data load editor and add the load script below to a new section.

The load script contains:

* A dataset which is loaded into a data table called `Example`.

* The following fields in the data table:

  * `Month`

  * `KPI`

  * `Value`

Load script

```
Example:
Load * inline [
Month, KPI, Value
2024-01-01, Revenue, 5000
2024-02-01, Revenue,
2024-03-01, Revenue, 5500
2024-04-01, Revenue,
2024-01-01, Expenses, 3000
2024-02-01, Expenses, 3100
2024-03-01, Expenses,
2024-04-01, Expenses, 3200
2024-01-01,Customer Count, 200
2024-02-01,Customer Count, 210
2024-03-01,Customer Count,
2024-04-01,Customer Count,
];
```

Results

Load the data and open a sheet. Create a new table and add this field as a dimension:

* `KPI`

Create the following measure:

* `=MissingCount(Value)`, to calculate the number of missing values.

Results table

| KPI | MissingCount(Value) |
| --- | --- |
| Totals | 5 |
| Customer Count | 2 |
| Expenses | 1 |
| Revenue | 2 |

The results show that `5` records in the dataset have missing data as well as the KPI categories to which these records relate.