# 字段函数

这些函数只可用于图表表达式中。

字段函数可返回整数或字符串，以便确定不同的字段选择项情况。

使用每个函数的下拉列表可查看每个函数的简短描述和语法。单击语法描述中的函数名称可了解更多信息。

## 计数函数

[](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/FieldFunctions/field-functions-charts.htm)

#### GetAlternativeCount

GetAlternativeCount() 用于查找标识字段中可能（浅灰色）值的数量。

[**getalternativecount**](https://help.qlik.com/zh-CN/cloud-services/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/FieldFunctions/getalternativecount.htm) (field\_name)

[](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/FieldFunctions/field-functions-charts.htm)

#### GetExcludedCount

GetExcludedCount() 用于查找标识字段中排除的相异值的数量。仅计算排除的（深灰色）字段。备选值（浅灰色）和选定的排除值（带复选标记的深灰色）不计算在内。

[**getexcludedcount**](https://help.qlik.com/zh-CN/cloud-services/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/FieldFunctions/getexcludedcount.htm)(field\_name)

[](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/FieldFunctions/field-functions-charts.htm)

#### GetPossibleCount

GetPossibleCount() 用于查找标识字段中可能值的数量。如果标识字段包括选择项，则计算选定（绿色）值的数量。否则，计算相关（白色）值的数量。

[**getpossiblecount**](https://help.qlik.com/zh-CN/cloud-services/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/FieldFunctions/getpossiblecount.htm)(field\_name)

[](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/FieldFunctions/field-functions-charts.htm)

#### GetSelectedCount

GetSelectedCount() 用于查找字段中选定（绿色）值的数量。

[**getselectedcount**](https://help.qlik.com/zh-CN/cloud-services/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/FieldFunctions/getselectedcount.htm) (field\_name [, include\_excluded])

[](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/FieldFunctions/field-functions-charts.htm)

#### GetStateCounts

GetStateCounts() 图表函数用于计算与指定选择状态匹配的唯一值的总数。

[**getstatecounts**](https://help.qlik.com/zh-CN/cloud-services/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/FieldFunctions/getstatecounts.htm) (field\_name, state\_name [, state\_type1,...state\_typeN])

## 字段和选择项函数

[](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/FieldFunctions/field-functions-charts.htm)

#### GetCurrentSelections

GetCurrentSelections() 返回应用程序中当前选择的列表。如果选择是使用搜索框中的搜索字符串进行的，GetCurrentSelections() 将返回该搜索字符串。

[**getcurrentselections**](https://help.qlik.com/zh-CN/cloud-services/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/FieldFunctions/getcurrentselections.htm)([record\_sep [,tag\_sep [,value\_sep [,max\_values]]]])

[](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/FieldFunctions/field-functions-charts.htm)

#### GetFieldSelections

GetFieldSelections() 用于返回包含字段内当前选择项的字符串。

[**getfieldselections**](https://help.qlik.com/zh-CN/cloud-services/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/FieldFunctions/getfieldselections.htm) ( field\_name [, value\_sep [, max\_values]])

[](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/FieldFunctions/field-functions-charts.htm)

#### GetObjectDimension

GetObjectDimension() 返回维度的名称。Index（索引）是一个可选整数，表明应返回的维度。

[**getobjectdimension**](https://help.qlik.com/zh-CN/cloud-services/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/FieldFunctions/getobjectdimension.htm) ([index])

[](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/FieldFunctions/field-functions-charts.htm)

#### GetObjectField

GetObjectField() 返回维度的 字段表达式。Index 是一个可选整数，表示应返回的维度。

[**GetObjectField**](https://help.qlik.com/zh-CN/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/SystemFunctions/GetObjectField.htm) ([index])

[](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/FieldFunctions/field-functions-charts.htm)

#### GetObjectMeasure

GetObjectMeasure() 返回度量的名称。Index（索引）是一个可选整数，表明应返回的度量。

[**getobjectmeasure**](https://help.qlik.com/zh-CN/cloud-services/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/FieldFunctions/getobjectmeasure.htm) ([index])