Skip to main content

Remove Duplicates from a lookup field


Forum|alt.badge.img+6

Hello

I have a lookup field that lists every area code in each time zone.  These are listed by zip code within each time zone so there are a ton of repeats.  You can see them in the area_codes field:

I've tried to create a formula field (UniqueAreaCodes) to remove all the duplicates but as you can see it is still outputting some duplicates.  I have tried ARRAYUNIQUE(area_codes) as well as 

ARRAYUNIQUE(ARRAYFLATTEN(area_codes)).  These provide the same result.  I've also tried a myriad of other complex formulas with no luck.  I think part of the problem is that area_codes field is seperated by a carriage return and is not all one string.  I tried to put that field into a continuous string first before using the array formula.  Still no luck.  
 

Any advice is greatly apprceiated.  

 

3 replies

Forum|alt.badge.img+19
  • Inspiring
  • 560 replies
  • February 8, 2024

Hi @Mike_Thorington,

What fields are "area_codes"?
It seems that a single record may contain multiple codes.
If it is one code per record, there should be no problem.


Forum|alt.badge.img+6
Sho wrote:

Hi @Mike_Thorington,

What fields are "area_codes"?
It seems that a single record may contain multiple codes.
If it is one code per record, there should be no problem.


The fields that area codes are in are individual zipcodes.  Think of the zipcode you live in and all the surronding zip codes.  They will all have the same listed area code(s) in that area.  Some overlap, some are very large areas with 1 area code.  So there will be many area codes of the same number listed per zipcode

For example:

 

 


Forum|alt.badge.img+6
Sho wrote:

Hi @Mike_Thorington,

What fields are "area_codes"?
It seems that a single record may contain multiple codes.
If it is one code per record, there should be no problem.


It is possible to have more that one code per record to follow up.    


Reply