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.

Reference

1
Leave a Reply

avatar
1 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
1 Comment authors
Emilie Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
Emilie
Guest
Emilie

Hello there,

Thanks a lot for the code!
I’d like to use it but also to order my products with another column that the name, would that be possible?
I should then store all the previous displayed product name, how could I do that?

Thanks a lot,