Skip to main content

Concatenate Values

The Concatenate Values function makes your dataset compact for analysis. You may come across datasets that contain repetitive values for one or more columns. These datasets can be a little difficult to work on in their original format.

See the following Fruit Diet table for example.

It has two columns - Name & Orders. The column “Name” essentially has only two values - Harry & Ron - repeating over.

NameOrders
HarryWand
RonWand
HarryInvisible cloak
HarryNimbus 2000
RonMarauder's Map
RonMagic frogs
RonRobe
HarryRobe
HarryJelly Beans

The Concatenate Values function allows you to merge values in rows within a text column and map them to one or more columns, irrespective of it's datatype. So after the concatenation of rows, the above dataset would look something like this:

NameConcatenation of Orders
HarryInvisible cloak, Jelly beans, Nimbus 2000, Robe, Wand
RonMagic frogs, Marauder’s map, Robe, Wand

Here, we have concatenated the orders column and grouped them by the name column. Note the values in the concatenated cell appears alphabetically.

Let’s look at another dataset to make this clear.

NameFruit
HarryApple
RonMango
HarryKiwi
HarryMango
RonApple
RonMango
RonApple
HarryGrapes
HarryGrapes

When we concatenate the Fruit column and Group it by Name, the above table becomes this:

NameConcatenation of Fruit
HarryApple, Mango
RonApple, Grapes, Mango
HermioneGrapes, Kiwi, Mango

Let’s take Table Fruit Diet again but this time we’ll concatenate the names and group them by fruits. It would look something like this:

FruitConcatenation of Name
AppleHarry, Ron
GrapesRon, Hermione
KiwiHermoine
MangoHarry, Ron, Hermione

Concatenating values and grouping it by multiple columns

You can also concatenate values by grouping them by more than one column.

See the following table for example:

NameFruitCategory
HarryAppleFruit
HarryAppleCitrus
RonBananaFruit
RonOrangeCitrus
RonOrangeFruit
HermioneBananaFruit

When we concatenate values in the Category column and group it by the remaining two columns, this is the result we get:

NameFruitConcatenation of Category
HarryAppleCitrus, Fruit
RonBananaFruit
RonOrangeCitrus, Fruit
HermioneBananaFruit

Using the Concatenate Values function

Now that you understand the Concatenate Values function. Let’s see how you can use it in Mammoth:

  • Go to Transform > Reshape, Group and Aggregate.
  • Select the Concatenate Values function.
  • Define specifics and apply changes.
note
  1. You can rename the concatenated column and choose an appropriate delimiter to segregate the values as well. By default, these values are set as "Concatenation of {column_name} and ,, respectively.
  2. The system does not allow the concatenated column to be renamed to any of the chosen Group by columns.

You can also concatenate values and choose to group it by multiple columns. Here's how you can do that:

  • Navigate to your Dataset in your Data Library.
  • Go to Transform > Reshape, Group and Aggregate > Concatenate Values.
  • Define specifics, apply changes and you're done.
note

Cells with concatenated values can have upto a maximum of 50 unique values. Other values are ignored.