Dedupe and sum merging values

Hi guys,

I’m trying to merge duplicates then also merge numerical values, but I’ve not found a way to sum the numerical values together.

Here’s my table

So I want to sum the numbers under the GA:pageviews column. I’ve tried the following features:

  • SUM - doesn’t work, I have changed the merge delimiter to + but it only sums up to 0. If I add a “SUM” like = SUM{ga:pageviews} it causes an error.
  • MERGE Values - I tried to merge the values but it merge the whole column instead

I don’t know what else to try :expressionless:

Hey @Charity_De_La_Cruz!

There may still be a better way, but you could try using the Split column step, as shown below:

And then use the Insert math column step to sum the new columns that were created:

Then I’d use the Remove columns step to Keep the original columns and your new ga:pageviews total column.

Hope that helps!

2 Likes

Hey Charity,

If you used a step to merge duplicates together to get to the table that you posted, then the following will work:

Instead of merging the duplicates, use the Sum Values step to sum duplicates!
Add a Sum Values step to your flow, and then tell it to Sum the ga:pageviews column, and group it by whichever column you want to use as your duplicate checking column - maybe ga:pageTitle or ga:pagePath or you can use both!

That step will create the same output as you posted, but instead of the page views merged together, they are summed!

2 Likes

Hey Brian,

I found this solution easier but I noticed that I can’t have another column without it being checked for duplicates. Is there a way to get around this?

Hi @Charity_De_La_Cruz - Yep, there is a way to workaround it. You’ll most likely need to use another Join step to join the results of the Sum Values step with the other column(s) you want in the table.

Can you reply back with the some screenshots of the columns of data you’re trying to join back with the results of the Sum Values step?

Here’s the screenshot, so I’ve created a sum values for “Pageviews”, keeping only the page title, but I want to keep the PagePath as well

Got it. Before joining the ga:pagePath and ga:pageviews back, use a Column Filter step to filter that branch to just ga:pageTitle and ga:pagePath. Use a Dedupe step to make sure you only have unique rows.

Once you do that, you can join in with the results of your Sum Values step and it should successfully attach the ga:pagePath column without creating any additional rows.

1 Like