# MissingCount - 圖表函數

MissingCount() 用來彙總每一個圖表維度中遺漏值的數目。遺失值全部都是非數值。

語法：

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

傳回的資料類型： 整數

引數：

引數

| 引數 | 描述 |
| --- | --- |
| expr | 包含待測量之資料的運算式或欄位。 |
| SetExpression | 依預設，彙總函數將彙總選項所定義的一組可能記錄。集合分析運算式可定義一組替代的記錄。 |
| DISTINCT | 如果 DISTINCT 這個字出現在函數引數之前，會忽略評估函數引數所產生的重複項目。 |
| TOTAL | 如果單字 TOTAL 位於函數引數之前，則會在提供現行選項的所有可能值上進行計算，而不僅僅是關於目前維度值的那些選項，也就是說，它會忽略圖表維度。<br><br>透過使用 TOTAL [&lt;fld {.fld}&gt;] (其中 TOTAL 限定詞後面是做為圖表維度變數子集之一或更多欄位名稱的清單)，您可建立總可能值的子集。<br><br>[定義彙總範圍](https://help.qlik.com/zh-TW/sense/November2024/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/define-aggregation-scope.htm) |

範例與結果：

Data

| Customer | Product | OrderNumber | UnitSales | Unit Price |
| --- | --- | --- | --- | --- |
| 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 | DD | 3 |  | 25 |

範例與結果

| 範例 | 結果 |
| --- | --- |
| `MissingCount([OrderNumber])` | 3，因為 10 個 OrderNumber 欄位中有 3 個為空白<br><br>資訊備註"0" 計為某個值，而不是空的儲存格。然而，如果某個維度的量值彙總為 0，則該維度不會包括在圖表中。 |
| `MissingCount ([OrderNumber])/MissingCount ({1} Total [OrderNumber])` | 運算式會從所選客戶傳回不完整訂單數，作為來自所有客戶的不完整訂單部分。所有客戶總共有 3 個 OrderNumber 遺漏值。因此，針對每個具有 Product 遺漏值的 Customer，結果為 1/3。 |

範例中使用的資料：

`Temp:` `LOAD * inline [` `Customer|Product|OrderNumber|UnitSales|UnitPrice` `Astrida|AA|1|4|16` `Astrida|AA|7|10|15` `Astrida|BB|4|9|9` `Betacab|CC|6|5|10` `Betacab|AA|5|2|20` ` Betacab|BB|||  25  ` `Canutility|AA|||15` `Canutility|CC| ||19` `Divadip|CC|2|4|16` `Divadip|DD|3|1|25` `] (delimiter is '|');`