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.

Reference

Share
Published by
Adam Spriggs @wvpv

Recent Posts

3D Printed Mechanical Counter

https://youtu.be/pBoHq3AG8rw 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?

https://youtu.be/8Yrmopm5Npc [...] 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

https://youtu.be/D-QaDLfogNM Check out 143 hook shots by Robin Lopez from the 2018-19 season.

3 weeks ago

How Pencils are Made

https://youtu.be/aPb-slJH9Vs

4 weeks ago

Just read the documentation

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

2 months ago