# RangeMissingCount - 指令碼與圖表函數

RangeMissingCount() 傳回運算式或欄位中的非數值 (包括 NULL) 的數目。

語法：

RangeMissingCount(first\_expr[, Expression])

傳回的資料類型： 整數

引數：

此函數的引數可能包含記錄間函數，它們會自行傳回值的清單。

引數

| 引數 | 描述 |
| --- | --- |
| first\_expr | 包含待計算資料的運算式或欄位。 |
| Expression | 包含待計算資料範圍的選用運算式或欄位。 |

範例與結果：

函數範例

| 範例 | 結果 |
| --- | --- |
| `RangeMissingCount<br>(1,2,4)` | 傳回 0 |
| `RangeMissingCount<br>(5,'abc')` | 傳回 1 |
| `RangeMissingCount<br>(null( ))` | 傳回 1 |

運算式範例：

`RangeMissingCount
 (Above(MinString(MyField),0,3))`

傳回 MinString(MyField) 函數針對目前列和目前列上方兩列，所評估的三個結果中非數值的數量。

提示備註停用 MyField 的排序，確保範例如預期運作。

樣本資料

| MyField | RangeMissingCount(Above(MinString(MyField),0,3)) | Explanation |
| --- | --- | --- |
| 10 | 2 | 傳回 2，因為此列上方沒有任何列，所以 3 個值中的 2 個值遺失。 |
| abc | 2 | 傳回 2，因為目前列上方只有一列，且目前列非數值 ('abc')。 |
| 8 | 1 | 傳回 1，因為 3 列中有 1 列包含非數值 ('abc')。 |
| def | 2 | 傳回 2，因為 3 列中有 2 列包含非數值 ('def' 和 'abc')。 |
| xyz | 2 | 傳回 2，因為 3 列中有 2 列包含非數值 (' xyz' 和 'def')。 |
| 9 | 2 | 傳回 2，因為 3 列中有 2 列包含非數值 (' xyz' 和 'def')。 |

範例中使用的資料：

`RangeTab:` `LOAD * INLINE [` `MyField` `10` `'abc'` `8` `'def'` `'xyz'` `9` `] ;`

## 瞭解更多資訊

* [MissingCount - 圖表函數](https://help.qlik.com/zh-TW/sense/November2024/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/CounterAggregationFunctions/missingcount.htm)