# 字串彙總函數

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

使用各個函數的下拉式清單，查看各函數的簡短描述及語法。按一下語法描述中的函數名稱以取得更多詳細資料。

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

[](https://help.qlik.com/en-US/qlikview/Subsystems/Client/Content/QV_QlikView/Scripting/StringAggregationFunctions/string-aggregation-functions.htm)

#### Concat

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

[**concat**](https://help.qlik.com/zh-TW/qlikview/September2025/Subsystems/Client/Content/QV_QlikView/Scripting/StringAggregationFunctions/concat.htm)([**concat**](https://help.qlik.com/zh-TW/qlikview/September2025/Subsystems/Client/Content/QV_QlikView/Scripting/StringAggregationFunctions/concat.htm)**concat**concat([ distinct ] expression [, delimiter [, sort-weight]][ distinct ] expression [, delimiter [, sort-weight]]))

[](https://help.qlik.com/en-US/qlikview/Subsystems/Client/Content/QV_QlikView/Scripting/StringAggregationFunctions/string-aggregation-functions.htm)

#### FirstValue

FirstValue() 會傳回從運算式所定義之記錄載入的第一個值 (按照 group by 子句排序)。

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

[**FirstValue**](https://help.qlik.com/zh-TW/qlikview/September2025/Subsystems/Client/Content/QV_QlikView/Scripting/StringAggregationFunctions/FirstValue.htm) ([**FirstValue**](https://help.qlik.com/zh-TW/qlikview/September2025/Subsystems/Client/Content/QV_QlikView/Scripting/StringAggregationFunctions/FirstValue.htm)**FirstValue**FirstValue (expressionexpression))

[](https://help.qlik.com/en-US/qlikview/Subsystems/Client/Content/QV_QlikView/Scripting/StringAggregationFunctions/string-aggregation-functions.htm)

#### LastValue

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

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

[**LastValue**](https://help.qlik.com/zh-TW/qlikview/September2025/Subsystems/Client/Content/QV_QlikView/Scripting/StringAggregationFunctions/LastValue.htm) ([**LastValue**](https://help.qlik.com/zh-TW/qlikview/September2025/Subsystems/Client/Content/QV_QlikView/Scripting/StringAggregationFunctions/LastValue.htm)**LastValue**LastValue (expressionexpression))

[](https://help.qlik.com/en-US/qlikview/Subsystems/Client/Content/QV_QlikView/Scripting/StringAggregationFunctions/string-aggregation-functions.htm)

#### MaxString

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

[**MaxString**](https://help.qlik.com/zh-TW/qlikview/September2025/Subsystems/Client/Content/QV_QlikView/Scripting/StringAggregationFunctions/MaxString.htm)([**MaxString**](https://help.qlik.com/zh-TW/qlikview/September2025/Subsystems/Client/Content/QV_QlikView/Scripting/StringAggregationFunctions/MaxString.htm)**MaxString**MaxString(expression expression ))

[](https://help.qlik.com/en-US/qlikview/Subsystems/Client/Content/QV_QlikView/Scripting/StringAggregationFunctions/string-aggregation-functions.htm)

#### MinString

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

[**MinString**](https://help.qlik.com/zh-TW/qlikview/September2025/Subsystems/Client/Content/QV_QlikView/Scripting/StringAggregationFunctions/MinString.htm)([**MinString**](https://help.qlik.com/zh-TW/qlikview/September2025/Subsystems/Client/Content/QV_QlikView/Scripting/StringAggregationFunctions/MinString.htm)**MinString**MinString(expression expression ))

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

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

[](https://help.qlik.com/en-US/qlikview/Subsystems/Client/Content/QV_QlikView/Scripting/StringAggregationFunctions/string-aggregation-functions.htm)

#### Concat

Concat() 用於結合字串值。該函數會針對每個維度上評估的所有運算式的值，傳回彙總的字串串連。

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

[](https://help.qlik.com/en-US/qlikview/Subsystems/Client/Content/QV_QlikView/Scripting/StringAggregationFunctions/string-aggregation-functions.htm)

#### MaxString

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

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

[](https://help.qlik.com/en-US/qlikview/Subsystems/Client/Content/QV_QlikView/Scripting/StringAggregationFunctions/string-aggregation-functions.htm)

#### MinString

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

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