---
schema_version: "1"
id: 202b5254a9e8a14c4d268f990ea4bf5b6791a4e58ca2e9a113ffded157cab0e0
title: GROUPCONCAT
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/mktg/264-0-0/dato_data_mapping_formulas_group_concat.md
canonical_url: https://help.salesforce.com/s/articleView?id=mktg.dato_data_mapping_formulas_group_concat.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: ec3242933163b217d01240041d6aac89250800ea6899fb590b4fafaa954859ef
description: Use the GROUPCONCAT function to merge data from multiple rows into one field. GROUPCONCAT is a GROUP BY function and returns a string if the group contains at least 1 non-null value, if no non-null values exist, it returns a null value.
products:
  - Marketing
  - Marketing Cloud Intelligence
release: "264"
---
# GROUPCONCAT

Use the GROUPCONCAT function to merge data from multiple rows into one field. GROUPCONCAT is a GROUP BY function and returns a string if the group contains at least 1 non-null value, if no non-null values exist, it returns a null value.

**Syntax**: GROUPCONCAT(groupedDimension, keyDimension, seperator)

- groupedDimension - the dimension which values are grouped.
- keyDimension - the values according to which the groupedDimension are grouped.

For example, you can apply GROUPCONCAT to concatenate the values of your campaign name (groupedDimension) and campaign start date (keyDimension), with the specified separator between the values. The concatenation is unique, with every value appearing one time.

 
| **Campaign Name** | **Campaign Start Date** |
| --- | --- |
| Winter | 01/01/22 |
| Fall - sales | 12/01/22 |
| Q1 – new arrivals | 01/01/22 |
| Christmas | 12/01/22 |

**Formula:** GROUPCONCAT('Campaign Name', 'Campaign Start Date', ',')

**Output:**

 
| **Campaign Name** | **Campaign Start Date** |
| --- | --- |
| Q1 – new arrivals, Winter | 01/01/22 |
| Christmas, Fall – sales | 12/01/22 |

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-mktg-salesforce_datorama-264-0-0-production-enus/d38a342d-dd4a-4af8-8343-f372280a75dd/images/icon_note.png)

Note

- In order for the function to work correctly a value in the keyDimension must be linked to several values in the groupedDimension. This principle works between hierarchies and between attributes and keys. Fields with a one-to-many relationship can be used in groupconcat.
- The data table GROUPCONCAT runs on changes according to the setting the function is applied on. In the mapping screen, the function runs on the source file, and in calculated dimensions, the function runs on the workspace's database.
- When using this function in calculated dimensions, you can’t use variables such as JavaScript or other calculated dimensions as the keyDimension or the groupedDimension. Variables and calculated dimensions are calculated, per row, upon execution of a query, and aren’t saved in the workspace's database. When variables are used in GROUPCONCAT the function fails.