Question

Concatenete values

  • 22 December 2022
  • 2 replies
  • 34 views

Hi,

I would like to know how can I create a new field which will concatenete x values (area code) into one string value.

Example:
 


In example above, I would like to have a new field named “Parking Group” where we I can have a value named “Visitors” and which will include area code 750.009+750.016+750.015

Thanks for your help.


This topic has been closed for comments

2 replies

Hi @Faridininho

I'm not sure which database you used for the query. You can use GROUP_CONCAT if using MySQL or BigQuery, and STRING_AGG is applied to SQL Server, Azure SQL Database, and Azure Synapse Analytics.  Both concatenates the values of string expressions and places separator values between them

measure: parking_group {
    type: number
    sql: GROUP_CONCAT(${parking_area_code});;
  }

 

Hi,

 

There are different options, one of them is to create a parking_group dimension: