Select to view content in your preferred language

How to remove duplicate values from Dynamic Text (Attribute Value)

6081
12
02-18-2021 04:00 PM
Labels (1)
by Anonymous User
Not applicable

Hi,

I'm trying to use as much dynamic text as I could for our maps. I wanted to get rid of duplicate Township labels and just show 1 value. 

RonnieSamonte2_0-1613691716469.png

Thanks

 

0 Kudos
12 Replies
LindsayRaabe_FPCWA
Honored Contributor

If you were only wanting to show 1 value (i.e. 80 but not 79 in your image above), then I'd say yes. I too struggled with this for a while. The solution I found was to add a section of spaces (i.e. "            ") to the delimiter field. This essentially added a big gap between the first and second value, resulting in the second value not fitting in the frame. The trick was putting in enough spaces to bump out the next value based on the shortest value you wanted to display (i.e. "Word" instead of "Reallylongword"). If you had enough spaces to fill the gap between two lots of "Reallylongword", but not enough to fill the gap between two "Word" values, you could still end up seeing "Word           Word". The other neat little part of this was that the text justification was based on the values displayed (i.e. it would still centre the "Word" and not factor in the delimeter). See below for clarity. 

LindsayRaabe_FPCWA_0-1613695335988.png

Unfortunately, I don't think this will work for you, as it looks like you have multiple features with the same value (i.e. 80) and therefore, you wouldn't be able to get it to discriminate between values. Arcade doesn't seem to have a solution either (no "remove duplicates" text function which would be really nice to see). I tried using the DISTINCT function but that didn't work either. It returns an array, which doesn't translate into a string, and when I tried to convert the array to a string, it just gave me what we started with. 

LindsayRaabe_FPCWA_3-1613697440888.png

 

Lindsay Raabe
GIS Officer
Forest Products Commission WA
AubriKinghorn
Esri Regular Contributor

Hi! 

You should be able to get what you want by changing your query. Instead of visible rows, try using Custom Query to build a query for just the feature you want to show. 

AubriKinghorn_1-1613698896085.png

 

Or, if you are using a map series the Map Series Row option will only the value from the map series index layer, not all the other values. 

AubriKinghorn_0-1613698837684.png

Cheers,

Aubri

Cheers,
Aubri
0 Kudos
LindsayRaabe_FPCWA
Honored Contributor

Hi @AubriKinghorn. How would yo create a filter query that shows unique values only? I've tried and looked and failed to find anything that would do this. I looked at the DISTINCT function but it didn't seem to be available. 

Lindsay Raabe
GIS Officer
Forest Products Commission WA
0 Kudos
by Anonymous User
Not applicable

Thank you Lindsay Raabe, unfortunately I tried the distinct function and it doesn't seem to work too. 

Hi Aubri, thank you for the response unfortunately I am not using map series and this map I'm working on is a general template so users won't have to edit the Map title hence I can't lock it with a query. ☹️

0 Kudos
ManishPatel
Esri Contributor

Hi @Anonymous User ,

I have had similar situation in the past and the only way I was able to achieve was to write a custom printing tool that was published to ArcGIS Enterprise to use and I modified the python script, which provides more finer control. I used a lot of dynamic text elements and changed the values for each of them based on the requirement.

 

Hope that helps.

Cheers,
Manish
0 Kudos
LindsayRaabe_FPCWA
Honored Contributor

I actually posted an idea after looking at this issue here: https://community.esri.com/t5/arcgis-pro-ideas/arcade-function-to-show-unique-values-remove-duplicat... and got a reply from an ESRI contributor saying that you could use the DISTINCT function to do this - though I fail to see how. My attempt to make it work failed (as shown in the replies). 

Lindsay Raabe
GIS Officer
Forest Products Commission WA
0 Kudos
TomBole
Esri Regular Contributor

Hi All, 

If the DISTINCT function is not working with the Value dynamic text element I would consider this a bug. Can someone log this with Support? It will help us prioritize this.

Thanks, 

Tom

LindsayRaabe_FPCWA
Honored Contributor

@TomBole thanks for that. I'll get onto it and link it back here. 

Lindsay Raabe
GIS Officer
Forest Products Commission WA
0 Kudos
LindsayRaabe_FPCWA
Honored Contributor

Support case lodged.  Support case lodged. #02745001 Removing duplicate values using DISTINCT arcade function in table value dynamic text not working

Lindsay Raabe
GIS Officer
Forest Products Commission WA
0 Kudos