# MissingCount - script function

MissingCount() returns the number of missing values aggregated in the expression, as defined by a group by clause.

Syntax:

MissingCount (MissingCount ( [ distinctdistinct ] expr ] expr))

Return data type: integer

Arguments:

MissingCount arguments

| Argument | Description |
| --- | --- |
| expr | The expression or field containing the data to be measured. |
| distinct | If the word distinct<br>occurs before the expression, all duplicates are disregarded. |

Examples and results:

Add the example script to your document and run it. Then add, at least, the fields listed in the results column to a sheet in our document to see the result.

Examples and results

| Example | Result |
| --- | --- |
| `Temp:`<br>`LOAD * inline [`<br>`Customer\|Product\|OrderNumber\|UnitSales\|UnitPrice`<br>`Astrida\|AA\|1\|4\|16`<br>`Astrida\|AA\|7\|10\|15`<br>`Astrida\|BB\|4\|9\|9`<br>`Betacab\|CC\|6\|5\|10`<br>`Betacab\|AA\|5\|2\|20`<br>` Betacab\|BB\|\|\|  25  `<br>`Canutility\|AA\|\|\|15`<br>`Canutility\|CC\| \|\|19`<br>`Divadip\|CC\|2\|4\|16`<br>`Divadip\|DD\|3\|1\|25`<br>`] (delimiter is '\|');`<br>`MissCount1:`<br>`LOAD  Customer,MissingCount(OrderNumber) as MissingOrdersByCustomer Resident Temp Group By Customer;<br>`<br>` `<br><br>`Load MissingCount(OrderNumber) as TotalMissingCount Resident Temp;` | `Customer MissingOrdersByCustomer`<br>`Astrida 0`<br>`Betacab 1`<br>`Canutility 2`<br>`Divadip 0`<br>` `<br><br>The second statement gives:<br><br>`TotalMissingCount`<br>`3`<br><br>in a table with that dimension. |
| Given that the Temp table is loaded as in the previous example:<br><br>`LOAD MissingCount(distinct OrderNumber) as TotalMissingCountDistinct Resident Temp;` | ` TotalMissingCountDistinct  `<br>`1`<br><br>Because there is only oneOrderNumber one missing value. |