Text (PQL)
Executes text concatenation aggregation on a column of data from the model. The column does NOT need to have numerical data for it to be functional.
- Returned Output: Text
- Library: PQL \ Semantic \ Aggregate
- Version: 2023.00.000
- Compatibility: Pyramid Query Language (PQL) data sources
Syntax
* Click on the function's arguments above for more details on the input values.
Comments
- The measure parameter must refer to a valid column in the data model, formatted as [table].[column name]. This can either be an attribute or an existing measure, such as [measures].[column name].
- The Text function is typically applied to attributes, allowing the aggregation of values from multiple rows into a single column. This is particularly useful for grouping attribute values.
Function Behavior
The Text function works similarly to the SQL SUM()
function, but instead of summing numerical values, it concatenates text values into a single result. This enables the aggregation of text-based data from a column, bringing together multiple values in a single, concatenated output.
Examples
To create a measure that aggregates all manufacturers in the model, using the demo dataset:
Text([Manufacturers].[Manufacturer])
This function will concatenate all manufacturer names, displaying them in a single row. For example, manufacturers in a city can be grouped together and listed in a single, aggregated column: