# Dedupe + merge without duplicating values in cells

**URL:** <https://community.parabola.io/t/dedupe-merge-without-duplicating-values-in-cells/780>\
**Category:** Ask a question\
**Tags:** Building-Flows\
**Created:** [July 9, 2020, 9:04am UTC](https://community.parabola.io/t/dedupe-merge-without-duplicating-values-in-cells/780 "2020-07-09T09:04:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joachim\_Brindeau](https://sea2.discourse-cdn.com/flex020/user_avatar/community.parabola.io/joachim_brindeau/32/1634_2.png) [@Joachim\_Brindeau](https://community.parabola.io/u/Joachim_Brindeau)\
**Post date:** [July 9, 2020, 9:04am UTC](https://community.parabola.io/t/dedupe-merge-without-duplicating-values-in-cells/780/1 "2020-07-09T09:04:14Z")

</div>

Hello,

I am at the last step of my flow where I merge rows with the same ID.  
The problem is for lines like this:

 ![Capture](https://us1.discourse-cdn.com/flex020/uploads/parabola/original/1X/3d176e28f2a1fb3e42377759d4ddc18ef5ea5115.png)

The phone number is the same, the e-mail is the same, the type of partner is different.  
Thus, I would like one row with the e-mail, the phone, and “typeA,typeB”.

But I get duplicated values in every cell when all I want is for him to merge cells which have different values. **The flow does not detect whether the values he is merging are the same.** Also, as in most building blocks, I feel like a “ignore blank cells” would be a great addition.

 ![Capture](https://us1.discourse-cdn.com/flex020/uploads/parabola/original/1X/3aea785c0cd1b199c18de04556d3c7ef0f0120b3.png)  
I have zero idea on working my way around this …

---

<div class="post-metadata">

**Author:** ![Joachim\_Brindeau](https://sea2.discourse-cdn.com/flex020/user_avatar/community.parabola.io/joachim_brindeau/32/1634_2.png) [@Joachim\_Brindeau](https://community.parabola.io/u/Joachim_Brindeau)\
**Post date:** [July 9, 2020, 9:33am UTC](https://community.parabola.io/t/dedupe-merge-without-duplicating-values-in-cells/780/2 "2020-07-09T09:33:43Z")

</div>

Solved it.

There must be simpler ways to do it but I basically did the following:

- Unpivot the table to create rows which are ID | TYPEOFDATA | VALUE.
- Merge the three columns to create unique values in a NEWCOLUMN
- Dedupe NEWCOLUMN, no merging
- Filter rows with blank values in VALUE
- Pivot
- Merge rows according to ID
- remove duplicate “,” _(EDIT: actually that was a bad idea, I sometimes have “valueA, ,valueB”)_

**Only problem now is that I am not good at regex and I struggle to remove leading, trailing and duplicate commas without removing commas which actually separate values.** 😅

![Capture](https://us1.discourse-cdn.com/flex020/uploads/parabola/original/1X/31f4632f7e6b0cc35b1963a672f60353bfb431d2.png)

Tipically, because dedupe cannot ignore blank cells, this is what I need to clean to only keep one comma separating values: _,,,,emballage@auto-johndoe.com,,,,,firminy.comptabilite@janedoe.com,_

_EDIT: I managed to solve part of the issue by replacing duplicated commas with single commas, now I only have leading and trailing commas !_  
_EDIT2: I managed to solve the leading comma thanks to another post by using "/^,_"  
_EDIT3: End of the story, I removed the trailing comma with “[,]$” thanks to lots of testing on [regexpal](https://www.regexpal.com/)_

If you guys have a regex idea … thank you !

---

<div class="post-metadata">

**Author:** ![Joachim\_Brindeau](https://sea2.discourse-cdn.com/flex020/user_avatar/community.parabola.io/joachim_brindeau/32/1634_2.png) [@Joachim\_Brindeau](https://community.parabola.io/u/Joachim_Brindeau)\
**Post date:** [July 9, 2020, 10:15am UTC](https://community.parabola.io/t/dedupe-merge-without-duplicating-values-in-cells/780/3 "2020-07-09T10:15:38Z")

</div>

SOLUTION (might be some simpler ones):

1. Unpivot the table to create rows which are ID | TYPEOFDATA | VALUE.
2. Merge the three columns to create unique values in a NEWCOLUMN
3. Dedupe NEWCOLUMN, no merging
4. Filter rows with blank values in VALUE
5. Pivot
6. Merge rows according to ID
7. Find double commas and replace with single commas
8. Regex to replace /^,\* and [\*,]$ with nothing.

I wouldn’t have had to do this if there was an “ignore blank” and “don’t merge identical values” in the dedupe step. Might be a good feature, but I already asked for a new feature yesterday. 😇  
[/quote]

---

<div class="post-metadata">

**Author:** ![jp](https://sea2.discourse-cdn.com/flex020/user_avatar/community.parabola.io/jp/32/20_2.png) [@jp](https://community.parabola.io/u/jp)\
**Post date:** [July 9, 2020, 4:45pm UTC](https://community.parabola.io/t/dedupe-merge-without-duplicating-values-in-cells/780/4 "2020-07-09T16:45:09Z")

</div>

Hi @Joachim_Brindeau! Glad that you were able to find a solution, and really appreciate that you documented everything here as well. This all should be immensely helpful for someone who has a similar issue down the line.

As for the Remove duplicate rows step features, those are great ideas! If you haven’t already, please submit them to #feature-requests for others in the community to vote on and our team to review. Thanks!

---

<div class="post-metadata">

**Author:** ![Joachim\_Brindeau](https://sea2.discourse-cdn.com/flex020/user_avatar/community.parabola.io/joachim_brindeau/32/1634_2.png) [@Joachim\_Brindeau](https://community.parabola.io/u/Joachim_Brindeau)\
**Post date:** [July 10, 2020, 7:40am UTC](https://community.parabola.io/t/dedupe-merge-without-duplicating-values-in-cells/780/5 "2020-07-10T07:40:01Z")

</div>

I just added the feature request [here](https://community.parabola.io/t/improve-merging-in-dedupe-step/783).  
Please vote ! 😄

---

<div class="post-metadata">

**Author:** ![Joachim\_Brindeau](https://sea2.discourse-cdn.com/flex020/user_avatar/community.parabola.io/joachim_brindeau/32/1634_2.png) [@Joachim\_Brindeau](https://community.parabola.io/u/Joachim_Brindeau)\
**Post date:** [July 15, 2020, 9:26am UTC](https://community.parabola.io/t/dedupe-merge-without-duplicating-values-in-cells/780/6 "2020-07-15T09:26:49Z")

</div>

My workaround brings my max rows from 25k to 250k because of the pivot step… I use way more credits !  
I hope the dedupe step gets fixed soon…
