De-duplicate rows in AMPScript

Sometimes using a Query Activity to de-duplicate data before an email send isn’t feasible. You can do it in AMPScript if you don’t mind sorting your external rows.

In this code block, you just need to use a variable to keep track of the previous value that you’ve displayed. When the current row doesn’t match the previous one, output it.

See the gist on github.


Published by
Adam Spriggs @wvpv

Recent Posts

3D Printed Mechanical Counter Amazing mechanical counter by Florian Hu. Here's the 3D model. More from Florian Hu: Projects | Portfolio

5 days ago

How can leaders learn empathy? [...] maximizing shareholder value [...] where we prioritize the wants, needs, and desires of an external constituency over our…

2 weeks ago

143 Robin Lopez Hook Shots Check out 143 hook shots by Robin Lopez from the 2018-19 season.

3 weeks ago

How Pencils are Made

4 weeks ago

Just read the documentation

They said, "just read the official documentation"...

2 months ago