# RangeTextCount- スクリプトおよびチャート関数

RangeTextCount() は、数値または項目に含まれる、テキスト値の数を返します。

構文:

RangeTextCount(first\_expr[, Expression])

戻り値データ型： 整数

引数：

この関数の引数式には、レコード間関数を含めることができます。これらの関数は、その内部で値リストを返します。

* first\_expr: メジャーの対象となるデータが含まれている数式または項目。
* Expression: メジャーの対象となるデータ範囲が含まれている任意の数式または項目。

例と結果

| 例 | 結果 |
| --- | --- |
| `RangeTextCount<br>(1,2,4)` | 0 を返します |
| `RangeTextCount<br>(5,'abc')` | 1 を返します |
| `RangeTextCount<br>(null( ))` | 0 を返します |

(式を使って)

`RangeTextCount
(Above(MaxString(MyField),0,3))`

現在の行とその上の 2 つの行で評価された MaxString(MyField) 関数の 3 つの結果に存在するテキスト値の数が返されます。

ヒント メモこのような場合、集計エラーを防ぐため MyField によるソートは無効にしておきます。

式の出力例

| MyField | MaxString(MyField) | RangeTextCount(Above(Sum(MyField),0,3)) |
| --- | --- | --- |
| 10 | 10 | 0 |
| abc | abc | 1 |
| 8 | 8 | 1 |
| def | def | 2 |
| xyz | xyz | 2 |
| 9 | 9 | 2 |

**例で使用されているデータ:**

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

## 詳細を見る

* [TextCount - チャート関数](https://help.qlik.com/ja-JP/qlikview/September2025/Subsystems/Client/Content/QV_QlikView/ChartFunctions/CounterAggregationFunctions/textcount.htm)