# Split values from a field and create rows for each value

**URL:** <https://community.amazonquick.com/t/split-values-from-a-field-and-create-rows-for-each-value/9975>\
**Category:** Q&A\
**Tags:** data-preparation, quick-sight\
**Created:** [February 13, 2023, 9:38pm UTC](https://community.amazonquick.com/t/split-values-from-a-field-and-create-rows-for-each-value/9975 "2023-02-13T21:38:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![DannyV](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/dannyv/32/1694_2.png) [@DannyV](https://community.amazonquick.com/u/DannyV)\
**Post date:** [February 13, 2023, 9:38pm UTC](https://community.amazonquick.com/t/split-values-from-a-field-and-create-rows-for-each-value/9975/1 "2023-02-13T21:38:47Z")

</div>

Hi team, I have the following situation. I have a group of details that are assigned to some tickets.

![image](https://d1wl4jav5dp96l.cloudfront.net/original/2X/6/6d31365c544c42c509e8d0f7314fe7f66d209683.png)

These details are concatenated in the same row as in this example.

![image](https://d1wl4jav5dp96l.cloudfront.net/original/2X/f/f979907bb9a4cb60e8add72a00c944b0a4f5a7e2.png)

I need to split this up and create a new row for each detail in order to count them and make several calculations.

![image](https://d1wl4jav5dp96l.cloudfront.net/original/2X/9/949f902e899cd2363f2c549250af384abd32d364.png)

Initially I tried the split function but it only returns one value. Also, if the split function works, another of the problems is the common denominator that I should use, since I could use the comma but as you can see, the details like “Customer request, changes needed” contain a comma within the text which would divide incorrectly the string.

I searched for similar questions ([a](https://community.amazonquick.com/t/field-containing-comma-separated-values/3293), [b](https://community.amazonquick.com/t/identifying-unique-values-in-a-field-which-are-comma-separated/8940)), but couldn’t find a solution to this although it seems to be a fairly common problem that other users might have.

So, I would like to know two things, 1) if there is a common denominator that can be used (for example a comma) how would this problem be solved, 2) and if the common denominator doesn’t work, how can I split this string (I guess the substring function may work somehow).

---

<div class="post-metadata">

**Author:** ![Max](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/max/32/2288_2.png) [@Max](https://community.amazonquick.com/u/Max)\
**Post date:** [February 14, 2023, 5:03pm UTC](https://community.amazonquick.com/t/split-values-from-a-field-and-create-rows-for-each-value/9975/2 "2023-02-14T17:03:18Z")

</div>

This is something that cannot be accomplished with a calculated field. Calculated fields are only calculations that happen at the row level (i.e they can’t create rows).

If you are using athena, you can run a split and cross join.

[https://prestodb.io/docs/current/functions/string.html](https://prestodb.io/docs/current/functions/string.html)

[https://prestodb.io/docs/current/sql/select.html#cross-join](https://prestodb.io/docs/current/sql/select.html#cross-join)
