# 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/cloud-services/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/CounterAggregationFunctions/textcount.htm)