Arcade function to show unique values (remove duplicate values)

9550
23
02-18-2021 05:42 PM
Status: Already Offered
Labels (2)
LindsayRaabe_FPCWA
Occasional Contributor III

When using the Table Attribute dynamic text function in ArcGIS Pro you can return a string of values visible in the map frame (i.e.1, 2, 3, 4,...). Sometimes you may have a dataset with multiple features with the same value (i.e.1, 2, 2, 2, 3, 3, 4,...).. By using this function in it's current format, you would see the results as per the example given, but sometimes you may want to only see Unique values (i.e. 1, 2, 2, 2, 3, 3, 4 would be returned as 1, 2, 3, 4). It would be good if there was an Arcade function that shows unique values, removing any duplicates (suggestion below). 

LindsayRaabe_FPCWA_0-1613698748784.png

 

This post is another example of where this function would be useful: https://community.esri.com/t5/arcgis-pro-questions/how-to-remove-duplicate-values-from-dynamic-text-... 

23 Comments
ZacharyHart

@KoryKramer @CraigWilliams 

are there any updates from the Esri side of this? 2 years is a long time. 

Being able to retrieve unique records from a field would be incredibly beneficial for map production!

LindsayRaabe_FPCWA

Bug report still states "In Product Plan", so I'm going to assume no fixes are in place yet. 

KoryKramer

@ZacharyHart is is actively being worked on in the 3.2 development cycle right now.

LindsayRaabe_FPCWA

@KoryKramer Welcome news! Can finally start tidying up our project layouts!

jchester73

Does anyone know whether this issue has been addressed in ArcGIS Pro 3?

ZacharyHart

@jchester73No. See @KoryKramer  response that it's in the product plan for 3.2.

I really wish this worked...I don't know how a function can be listed in the help guides starting several versions ago if it doesn't even work.

This would greatly improve our map production process. Right now in order to accomplish this, we have duplicated layers that are unsymbolized and have another clause in the definition query reference one unique record for a subject property. The various dynamic text elements reference this dummy layer in the TOC to do the labeling we need.

LindsayRaabe_FPCWA

Just got this in an email from ESRI. 

 

Updates have been made to the following defect which you are associated with:
BUG-000137676 - In ArcGIS Pro, unable to remove duplicates using the Distinct Arcade function in the Dynamic Text tool for table attribute values.

Status: Fixed (Learn More)
Version Fixed: 3.2
Additional Information: This issue is addressed in ArcGIS Pro 3.2.

jakek
by

Has anyone been able to make this work?  I'm using an Arcade calculate field expression, "Distinct($feature.CONCATENATE_subset_cd)" w/out quotes and repeatedly fails.  Here is a sample of 65 values in a single field in a single row in the table (other rows have many more values in this field):  

300,902,902,902,126,126,126,126,126,126,126,126,126,124,126,127,109,126,109,902,124,902,126,902,902,126,126,123,126,126,126,126,902.3

WARNING 001156: Failed on input OID 14, could not write value 'Unknown Object' to output field SubcodeUnique

Any suggestions?

I have also submitted a new idea to concatenate unique only values here: Concatenate Unique values (only) - Esri Community .  Please upvote this idea!  Thank you.

LindsayRaabe_FPCWA

Nope - I still can't make it work either. Example below. 

No Distinct expression:

LindsayRaabe_FPCWA_0-1689558270801.png

With Distinct expression:

 

LindsayRaabe_FPCWA_3-1689558374581.png

Tried it with a text field as well with the same results. I don't see how this has been fixed. Will try reopen my support ticket. 

 

 

ZacharyHart

3.2🤞

It's ridiculous to me you would  advertise functionality in advance of it never working...and even have documentation for it...and then only by users reporting the issue is the issue roadmapped to be implemented several versions later 🤣

 

Clearly Esri isn't testing their own functionality. The insult to injury is that the user base needs to justify why this functionality matters before the solution provider considers development on it to actually make it work. All too often. 

This is ridiculous...do better Esri....