# 字串彙總函數

本節描述與字串相關的彙總函數。

使用每個函數中的下拉式功能表，以查看每個函數的簡要描述及語法。按一下語法描述中的函數名稱，以取得進一步詳細資料。

## 資料載入指令碼中的字串彙總函數

[](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/StringAggregationFunctions/string-aggregation-functions.htm)

#### Concat

Concat() 用來組合字串值。該指令碼函數會針對由 group by 子句所定義之若干記錄上反覆運算的所有運算式值，傳回彙總字串串連。

[**concat**](https://help.qlik.com/zh-TW/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/StringAggregationFunctions/concat.htm)([**concat**](https://help.qlik.com/zh-TW/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/StringAggregationFunctions/concat.htm)**concat**concat([ distinct ] expression [, delimiter [, sort-weight]][ distinct ] expression [, delimiter [, sort-weight]]))

[](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/StringAggregationFunctions/string-aggregation-functions.htm)

#### FirstValue

FirstValue() 會傳回首先從運算式定義之記錄中載入的值，按 group by 子句排序。

資訊備註此函數只可作為指令碼函數。

[**FirstValue**](https://help.qlik.com/zh-TW/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/StringAggregationFunctions/FirstValue.htm) ([**FirstValue**](https://help.qlik.com/zh-TW/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/StringAggregationFunctions/FirstValue.htm)**FirstValue**FirstValue (expressionexpression))

[](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/StringAggregationFunctions/string-aggregation-functions.htm)

#### LastValue

LastValue() 會傳回最後從運算式定義之記錄中載入的值，按 group by 子句排序。

資訊備註此函數只可作為指令碼函數。

[**LastValue**](https://help.qlik.com/zh-TW/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/StringAggregationFunctions/LastValue.htm) ([**LastValue**](https://help.qlik.com/zh-TW/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/StringAggregationFunctions/LastValue.htm)**LastValue**LastValue (expressionexpression))

[](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/StringAggregationFunctions/string-aggregation-functions.htm)

#### MaxString

MaxString() 會尋找運算式中的字串值，並傳回在若干記錄上按字母排序的最後一個文字值，如 group by 子句所定義。

[**MaxString**](https://help.qlik.com/zh-TW/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/StringAggregationFunctions/MaxString.htm)([**MaxString**](https://help.qlik.com/zh-TW/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/StringAggregationFunctions/MaxString.htm)**MaxString**MaxString(expression expression ))

[](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/StringAggregationFunctions/string-aggregation-functions.htm)

#### MinString

MinString() 會尋找運算式中的字串值，並傳回在若干記錄上按字母排序的第一個文字值，如 group by 子句所定義。

[**MinString**](https://help.qlik.com/zh-TW/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/StringAggregationFunctions/MinString.htm)([**MinString**](https://help.qlik.com/zh-TW/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/StringAggregationFunctions/MinString.htm)**MinString**MinString(expression expression ))

## 圖表中的字串彙總函數

下列圖表函數可用於圖表中的彙總字串

[](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/StringAggregationFunctions/string-aggregation-functions.htm)

#### Concat

Concat() 用來組合字串值。該函數傳回對每個維度評估之運算式的所有值的彙總字串串連。

[**concat**](https://help.qlik.com/zh-TW/cloud-services/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/StringAggregationFunctions/concat.htm)({[SetExpression] [DISTINCT] [TOTAL [&lt;fld{, fld}&gt;]] string[, delimiter[, sort\_weight]])

[](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/StringAggregationFunctions/string-aggregation-functions.htm)

#### MaxString

MaxString() 尋找運算式或欄位中的字串值，並傳回按字母排序順序中的最後一個文字值。

[**maxstring**](https://help.qlik.com/zh-TW/cloud-services/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/StringAggregationFunctions/maxstring.htm)({[SetExpression] [TOTAL [&lt;fld{, fld}&gt;]]} expr)

[](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/StringAggregationFunctions/string-aggregation-functions.htm)

#### MinString

MinString() 尋找運算式或欄位中的字串值，並傳回按字母排序順序中的第一個文字值。

[**minstring**](https://help.qlik.com/zh-TW/cloud-services/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/StringAggregationFunctions/minstring.htm)({[SetExpression] [TOTAL [&lt;fld {, fld}&gt;]]} expr)