<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: label related table - in one staked label in Transportation Questions</title>
    <link>https://community.esri.com/t5/transportation-questions/label-related-table-in-one-staked-label/m-p/418034#M1420</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;There is no way I can think of to reference multiple rows as a single label using label expressions. You might be able to get around it by having a separate script that creates the labels in a text file and then the label expression references that. I can't imagine it would be very good performance wise though, especially if there are a lot of features. A better way may be to create a table that has a single field for each label line. So for our sample row field1 = 204, field2 = PM2A, field 3 = HAFO (4-10T) etc. Depending on how your data is set up you could try pivot tables&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//0017000000n8000000"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#//0017000000n8000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Either way you'd probably want to create an annotation layer to reference instead of dynamically labelling each time.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Dec 2012 14:19:00 GMT</pubDate>
    <dc:creator>MathewCoyle</dc:creator>
    <dc:date>2012-12-10T14:19:00Z</dc:date>
    <item>
      <title>label related table - in one staked label</title>
      <link>https://community.esri.com/t5/transportation-questions/label-related-table-in-one-staked-label/m-p/418031#M1417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: alnesbit&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am hoping someone who knows python can figure this out. I have a similar posting here &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://forums.arcgis.com/threads/68883-Related-table-labels" rel="nofollow" target="_blank"&gt;http://forums.arcgis.com/threads/68883-Related-table-labels&lt;/A&gt;&lt;SPAN&gt; . There was an old arcscripts that worked at 9.3 here &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://arcscripts.esri.com/details.asp?dbid=12298" rel="nofollow" target="_blank"&gt;http://arcscripts.esri.com/details.asp?dbid=12298&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have been able to create a new feature class from using the Make Query Table tool that has all of my related values for my points in one feature class. What I really need know is a way to create one balloon label for each point that is a staked label of all of the related table values. Can I do this with python code or a label expression somehow? In some cases I have 6 or more balloon labels for each of my points and they are overlapping and hard to read. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am attaching a screen shot of my map book as it is labeled with the many labels for each point. Then I am showing the table that the labels are coming from - showing the many assemblies for each pole.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The last thing I will add is an idea of python labeling code. This python label expression doesn't work but I thought maybe someone out there who knew code better than me could get it to work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;def FindLabel ( [FIBER_ASSEMBLY_UNITS_ASSEMBLY_UNIT], [POLE_PRIKEY]&amp;nbsp; ): &amp;nbsp; if long( [POLE_PRIKEY] ) = long( [POLE_PRIKEY] ): &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return [FIBER_ASSEMBLY_UNITS_ASSEMBLY_UNIT] + '\n' + [FIBER_ASSEMBLY_UNITS_ASSEMBLY_UNIT] + '\n'&amp;nbsp; + [FIBER_ASSEMBLY_UNITS_ASSEMBLY_UNIT]&amp;nbsp; &amp;nbsp; else: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return [FIBER_ASSEMBLY_UNITS_ASSEMBLY_UNIT] &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I appreciate any help! &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2012 20:57:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/label-related-table-in-one-staked-label/m-p/418031#M1417</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2012-12-06T20:57:32Z</dc:date>
    </item>
    <item>
      <title>Re: label related table - in one staked label</title>
      <link>https://community.esri.com/t5/transportation-questions/label-related-table-in-one-staked-label/m-p/418032#M1418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm not sure I understand what you are trying to do with this line (besides you needing == isntead of =).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;if long( [POLE_PRIKEY] ) = long( [POLE_PRIKEY] ):&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Something like this should work though.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def FindLabel([FIBER_ASSEMBLY_UNITS_ASSEMBLY_UNIT], [POLE_PRIKEY]):
&amp;nbsp;&amp;nbsp;&amp;nbsp; if long( [POLE_PRIKEY] ) == long( [POLE_PRIKEY] ):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; labelText = '{0}\n{1}\n{2}'.format([FIBER_ASSEMBLY_UNITS_ASSEMBLY_UNIT], [FIBER_ASSEMBLY_UNITS_ASSEMBLY_UNIT], [FIBER_ASSEMBLY_UNITS_ASSEMBLY_UNIT])
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return labelText
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; labelText = [FIBER_ASSEMBLY_UNITS_ASSEMBLY_UNIT]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return labelText &lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In terms of accessing the data from a relate, I think you will need to look into using a join.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:54:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/label-related-table-in-one-staked-label/m-p/418032#M1418</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2021-12-11T18:54:26Z</dc:date>
    </item>
    <item>
      <title>Re: label related table - in one staked label</title>
      <link>https://community.esri.com/t5/transportation-questions/label-related-table-in-one-staked-label/m-p/418033#M1419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: alnesbit&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Mathew,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for the response. Your code did change my labels but not exactly what I was looking for. I will explain a little bit more about what I'm trying to do. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think I need some sort of loop through the attribute table to find when the Pole.Prikey is the same, those are the assembly units I want labeled all together in one balloon. We ended up just making 3 lines of the same label. I will attach a screen shot. So for example, in the first screen shot of my attribute table I would like 204, PM2A, HAFO (4-10T), PF3-3, PM11, and PE1-2 all together staked in one balloon label.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I will attach a screen shot of more of my feature class attribute table. In the previous posting I only showed one selected pole. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And to give some background, I started out with a point feature class that had a related table of 1-M Pole.Prikey to Assembly units. Then after I used the Make Query Table tool (in ArcToolbox) to create a 1-M join, I got this new feature class which is a 1-M join. It's a pretty slick advancement for 10 or 10.1. Talked about here &lt;/SPAN&gt;&lt;A href="http://blogs.esri.com/esri/supportcenter/2012/05/10/a-quick-tip-on-performing-a-1m-join/"&gt;http://blogs.esri.com/esri/supportcenter/2012/05/10/a-quick-tip-on-performing-a-1m-join/&lt;/A&gt;&lt;SPAN&gt; So now I'm just trying to label this new table in the best way.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you. I appreciate any help,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Dec 2012 12:01:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/label-related-table-in-one-staked-label/m-p/418033#M1419</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2012-12-07T12:01:45Z</dc:date>
    </item>
    <item>
      <title>Re: label related table - in one staked label</title>
      <link>https://community.esri.com/t5/transportation-questions/label-related-table-in-one-staked-label/m-p/418034#M1420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;There is no way I can think of to reference multiple rows as a single label using label expressions. You might be able to get around it by having a separate script that creates the labels in a text file and then the label expression references that. I can't imagine it would be very good performance wise though, especially if there are a lot of features. A better way may be to create a table that has a single field for each label line. So for our sample row field1 = 204, field2 = PM2A, field 3 = HAFO (4-10T) etc. Depending on how your data is set up you could try pivot tables&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//0017000000n8000000"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#//0017000000n8000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Either way you'd probably want to create an annotation layer to reference instead of dynamically labelling each time.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Dec 2012 14:19:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/label-related-table-in-one-staked-label/m-p/418034#M1420</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2012-12-10T14:19:00Z</dc:date>
    </item>
    <item>
      <title>Re: label related table - in one staked label</title>
      <link>https://community.esri.com/t5/transportation-questions/label-related-table-in-one-staked-label/m-p/418035#M1421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: alnesbit&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;There is no way I can think of to reference multiple rows as a single label using label expressions. &lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Ok I was afraid that was the case. Yes having my table set up differently, like you mentioned, would allow me to label then. I don't know of a fast way to get the table in that form, other than manually calculating the new fields one pole at a time. There are a lot of point features so that might be a crazy task. I'll try the pivot table link and see if that helps. I'll just hope that sometime in the future someone can come up with some new code to do this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Dec 2012 14:30:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/label-related-table-in-one-staked-label/m-p/418035#M1421</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2012-12-10T14:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: label related table - in one staked label</title>
      <link>https://community.esri.com/t5/transportation-questions/label-related-table-in-one-staked-label/m-p/418036#M1422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I also came across this method. Seems like a similar issue. It's a process you'd probably want to automate as well if your labels ever change.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://forums.arcgis.com/threads/4675-Stacking-labels-multiple-records-single-point-two-attributes?p=13957&amp;amp;viewfull=1#post13957" rel="nofollow" target="_blank"&gt;http://forums.arcgis.com/threads/4675-Stacking-labels-multiple-records-single-point-two-attributes?p=13957&amp;amp;viewfull=1#post13957&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Dec 2012 14:37:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/label-related-table-in-one-staked-label/m-p/418036#M1422</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2012-12-10T14:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: label related table - in one staked label</title>
      <link>https://community.esri.com/t5/transportation-questions/label-related-table-in-one-staked-label/m-p/418037#M1423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I possibly found a way to do it. Not all that fast though. You'll have to change all the field names to your data. It will return a label for every feature populated by every item in your target field that match the key field value.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def FindLabel([QS], [TWP]):
&amp;nbsp;&amp;nbsp;&amp;nbsp; val_list = []
&amp;nbsp;&amp;nbsp;&amp;nbsp; keyField = "TWP"
&amp;nbsp;&amp;nbsp;&amp;nbsp; keyVal = [TWP]
&amp;nbsp;&amp;nbsp;&amp;nbsp; field = "QS"
&amp;nbsp;&amp;nbsp;&amp;nbsp; fieldVal = [QS]
&amp;nbsp;&amp;nbsp;&amp;nbsp; layer = "ats"
&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.da.SearchCursor(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; layer, field, "{0} = {1}".format(keyField, keyVal)) as cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; val1 = row[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; val_list.append(val1)
&amp;nbsp;&amp;nbsp;&amp;nbsp; returnVal = "\n".join(val_list)

&amp;nbsp;&amp;nbsp;&amp;nbsp; return returnVal&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:54:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/label-related-table-in-one-staked-label/m-p/418037#M1423</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2021-12-11T18:54:29Z</dc:date>
    </item>
    <item>
      <title>Re: label related table - in one staked label</title>
      <link>https://community.esri.com/t5/transportation-questions/label-related-table-in-one-staked-label/m-p/418038#M1424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: alnesbit&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I possibly found a way to do it. Not all that fast though. You'll have to change all the field names to your data. It will return a label for every feature populated by every item in your target field that match the key field value.&lt;BR /&gt;&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Well I changed the code to match my data but we still have the problem of it labeling for each line of the attribute table - not just giving me one label per Pole.Prikey. This is the code I used:&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def FindLabel( [POLE_PRIKEY] , [FIBER_ASSEMBLY_UNITS_ASSEMBLY_UNIT] ):
&amp;nbsp;&amp;nbsp;&amp;nbsp; val_list = []
&amp;nbsp;&amp;nbsp;&amp;nbsp; keyField = "POLE_PRIKEY"
&amp;nbsp;&amp;nbsp;&amp;nbsp; keyVal = [POLE_PRIKEY] 
&amp;nbsp;&amp;nbsp;&amp;nbsp; field = "FIBER_ASSEMBLY_UNITS_ASSEMBLY_UNIT"
&amp;nbsp;&amp;nbsp;&amp;nbsp; fieldVal = [FIBER_ASSEMBLY_UNITS_ASSEMBLY_UNIT]
&amp;nbsp;&amp;nbsp;&amp;nbsp; layer = "TEST"
&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.da.SearchCursor(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; layer, field, "{0} = {1}".format(keyField, keyVal)) as cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; val1 = row[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; val_list.append(val1)
&amp;nbsp;&amp;nbsp;&amp;nbsp; returnVal = "\n".join(val_list)

&amp;nbsp;&amp;nbsp;&amp;nbsp; return returnVal&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I will attach a screen shot of the labels as well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But I am having some success with your other post and link to the other forum &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/4675-Stacking-labels-multiple-records-single-point-two-attributes" rel="nofollow noopener noreferrer" target="_blank"&gt;http://forums.arcgis.com/threads/4675-Stacking-labels-multiple-records-single-point-two-attributes&lt;/A&gt;&lt;SPAN&gt; . I hadn't seen that forum posting before and it's an interesting idea that I am tweeking and working with. If I get it to work I will let you know. I'm really close to getting it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What's stopping me so far is an automated way to Delete Identical. I know there is an awesome new tool at 10 but I only have ArcEditor, not ArcInfo as required for that tool. Would you know of a way to Delete Identical without having ArcInfo?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:54:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/label-related-table-in-one-staked-label/m-p/418038#M1424</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-11T18:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: label related table - in one staked label</title>
      <link>https://community.esri.com/t5/transportation-questions/label-related-table-in-one-staked-label/m-p/418039#M1425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In the label placement properties did you try checking "remove duplicates"?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is a link to finding duplicates without ArcInfo. You would then need to delete or export non-identical features to a new table.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/4021-ArcGIS-10-Pre-Release-finding-duplicates?p=12085&amp;amp;viewfull=1#post12085"&gt;http://forums.arcgis.com/threads/4021-ArcGIS-10-Pre-Release-finding-duplicates?p=12085&amp;amp;viewfull=1#post12085&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Dec 2012 18:04:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/label-related-table-in-one-staked-label/m-p/418039#M1425</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2012-12-10T18:04:56Z</dc:date>
    </item>
    <item>
      <title>Re: label related table - in one staked label</title>
      <link>https://community.esri.com/t5/transportation-questions/label-related-table-in-one-staked-label/m-p/418040#M1426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: alnesbit&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Mathew,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I got it! Thank you so much for all of your help! Here is my workflow - it's crazy but it works. (Oh and that code you gave me that I tried did work after I said to Remove Duplicates labels, however, once I put it to the test on my whole data, not just a 2 pole subset, it was labeling and labeling and...so you were right, it was going to take too long. If I let it label all day it might have worked.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I select out a subset of my data - a service area, and export it to a new feature class naming it "Data1". Then I export it again, the same thing, and name it "Data2". &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then I use the Spatial Join tool in the toolbox and follow the steps explained by Chris Fox in the forum you mentioned &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/4675-Stacking-labels-multiple-records-single-point-two-attributes"&gt;http://forums.arcgis.com/threads/4675-Stacking-labels-multiple-records-single-point-two-attributes&lt;/A&gt;&lt;SPAN&gt; . I use my Data1 and my Data2 feature classes, my merge rule is Join, my delimiter is a comma and at the bottom I picked "Are Identical To". That gives me a new feature class which I named "Data_spj".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then in Data_spj I delete duplicate POLE.PRIKEY records by using the python field calculator code explained by Kent Marten here &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/4021-ArcGIS-10-Pre-Release-finding-duplicates"&gt;http://forums.arcgis.com/threads/4021-ArcGIS-10-Pre-Release-finding-duplicates&lt;/A&gt;&lt;SPAN&gt; and in the Knowledge Base Article 38700.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That gives me my feature class with one field for labeling. I use Maplex to label staked labels force split at comma, no split at space, constrain to left, minimum characters per line 7, max number of lines 8, place overlapping, reduce font size, offset 10,&amp;nbsp; allow labels to overlap border.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using data driven pages so I will add the rest of my steps in case anyone can use it. I add a new field to my Data_spj feature class called "Grid" and do a spatial join to get the Grid that each point is in into that field. Then I go to Layers - Properties - Data Frame - Clip options - Clip to current Data driven page extent. Exclude layers - my grid and my "Data_spj". Then go to the Properties of my "Data_spj" feature class - Definition Query - click on Page Definition - Enable - Page Name field "Grid", Show features that Match.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So after all of that, I get the perfect labels. Screen shot attached. Hope this helps someone in the future. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Dec 2012 19:48:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/label-related-table-in-one-staked-label/m-p/418040#M1426</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2012-12-10T19:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: label related table - in one staked label</title>
      <link>https://community.esri.com/t5/transportation-questions/label-related-table-in-one-staked-label/m-p/418041#M1427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I know this is old, but I came across &lt;A href="https://gisnuts.com/terra/blog/2012/05/16/label-features-with-attributes-from-related-records"&gt;this link&lt;/A&gt; that helped me label from a related table with an advanced expression.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Oct 2014 19:57:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/label-related-table-in-one-staked-label/m-p/418041#M1427</guid>
      <dc:creator>TimSexton1</dc:creator>
      <dc:date>2014-10-10T19:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: label related table - in one staked label</title>
      <link>https://community.esri.com/t5/transportation-questions/label-related-table-in-one-staked-label/m-p/418042#M1428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tim,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried the code you linked to but it doesn't work for me. Any idea why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Function FindLabel ( [UniqueID] )&lt;/P&gt;&lt;P&gt;Set gp = CreateObject("esriGeoprocessing.GPDispatch.1")&lt;/P&gt;&lt;P&gt;strWhereClause = chr(34) &amp;amp; "UniqueID" &amp;amp; chr(34) &amp;amp; " = '" &amp;amp; [UniqueID] &amp;amp; "'"&lt;/P&gt;&lt;P&gt;strpTable = C:\Users\abohn\Documents\RALLS_TEST.gdb\FIBER_ASSEMBLY_UNITS_AEG_gdb&lt;/P&gt;&lt;P&gt;Set prows = gp.searchcursor(strpTable,strWhereClause)&lt;/P&gt;&lt;P&gt;Set prow = prows.next&lt;/P&gt;&lt;P&gt;Do until prow is nothing&lt;/P&gt;&lt;P&gt;strLabel = prow.ASSEBMLY_UNIT&lt;/P&gt;&lt;P&gt;FindLabel = FindLabel &amp;amp; strLabel &amp;amp; vbnewline&lt;/P&gt;&lt;P&gt;Set prow = prows.next&lt;/P&gt;&lt;P&gt;Loop&lt;/P&gt;&lt;P&gt;End Function&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2015 20:01:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/label-related-table-in-one-staked-label/m-p/418042#M1428</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2015-04-20T20:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: label related table - in one staked label</title>
      <link>https://community.esri.com/t5/transportation-questions/label-related-table-in-one-staked-label/m-p/418043#M1429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The related table has to be added to the TOC.&amp;nbsp; Make sure you are setting your strpTable variable to the actual table name (without the GDB path).&amp;nbsp; I could not get it to work the way your are trying by using the full file path to the table.&amp;nbsp; Also make sure the whereclause is querying on the correct foreign key (in your code it looks like your primary key and foreign key are named the same - which may be the case, just verify).&amp;nbsp; Also make sure the "Advanced - VBscript" expression is used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;Sample code:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Function FindLabel ( [GlobalID] )&lt;/P&gt;&lt;P&gt;Set gp = CreateObject("esriGeoprocessing.GPDispatch.1")&lt;/P&gt;&lt;P&gt;strWhereClause = "OperationGUID = '" &amp;amp; [GlobalID] &amp;amp; "'"&lt;/P&gt;&lt;P&gt;strpTable = "&lt;STRONG&gt;RelatedTableNameHere&lt;/STRONG&gt;"&lt;/P&gt;&lt;P&gt;Set prows = gp.searchcursor(strpTable,strWhereClause)&lt;/P&gt;&lt;P&gt;Set prow = prows.next&lt;/P&gt;&lt;P&gt;Do until prow is nothing&lt;/P&gt;&lt;P&gt;strLabel = prow.Description&lt;/P&gt;&lt;P&gt;FindLabel = FindLabel &amp;amp; strLabel &amp;amp; vbnewline&lt;/P&gt;&lt;P&gt;Set prow = prows.next&lt;/P&gt;&lt;P&gt;Loop&lt;/P&gt;&lt;P&gt;End Function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Apr 2015 20:18:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/label-related-table-in-one-staked-label/m-p/418043#M1429</guid>
      <dc:creator>TimSexton1</dc:creator>
      <dc:date>2015-04-20T20:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: label related table - in one staked label</title>
      <link>https://community.esri.com/t5/transportation-questions/label-related-table-in-one-staked-label/m-p/418044#M1430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Awesome! It works!! I can't believe it! So cool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I didn't have quotes around my "PathToRelatedTable" so that works now and I don't have to have the table in my TOC then. But in production I actually want to use an SDE table so I will have that in my TOC so I will just use the "RelatedTableName" like you mentioned. Thank you! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a further question though. In my code below I added a Quantity field to my label. But when the Quantity is 1 I don't want it to put the "(1)" there. I just want the "(2)" quantity label when the Quantity &amp;gt; 1. Do you know how to add in this logic?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;Code:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Function FindLabel ( [UniqueID] )&lt;/P&gt;&lt;P&gt;Set gp = CreateObject("esriGeoprocessing.GPDispatch.1")&lt;/P&gt;&lt;P&gt;strWhereClause = chr(34) &amp;amp; "UniqueID" &amp;amp; chr(34) &amp;amp; " = '" &amp;amp; [UniqueID] &amp;amp; "'"&lt;/P&gt;&lt;P&gt;strpTable = "FIBER_ASSEMBLY_UNITS"&lt;/P&gt;&lt;P&gt;Set prows = gp.searchcursor(strpTable,strWhereClause)&lt;/P&gt;&lt;P&gt;Set prow = prows.next&lt;/P&gt;&lt;P&gt;Do until prow is nothing&lt;/P&gt;&lt;P&gt;strLabel = prow.ASSEMBLY_UNIT &amp;amp; " (" &amp;amp; prow.Quantity &amp;amp; ")"&lt;/P&gt;&lt;P&gt;FindLabel = FindLabel &amp;amp; strLabel &amp;amp; vbnewline&lt;/P&gt;&lt;P&gt;Set prow = prows.next&lt;/P&gt;&lt;P&gt;Loop&lt;/P&gt;&lt;P&gt;End Function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2015 16:05:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/label-related-table-in-one-staked-label/m-p/418044#M1430</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2015-04-21T16:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: label related table - in one staked label</title>
      <link>https://community.esri.com/t5/transportation-questions/label-related-table-in-one-staked-label/m-p/418045#M1431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Simply add an IF statement inside the loop prior to setting the FindLabel similar to below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do until prow is nothing&lt;/P&gt;&lt;P&gt;if prow.QuantityUsed &amp;lt;= 1 then&lt;/P&gt;&lt;P&gt;   strLabel = prow.Description&lt;/P&gt;&lt;P&gt;else&lt;/P&gt;&lt;P&gt;   strLabel = prow.Description &amp;amp; "(" &amp;amp; prow.QuantityUsed &amp;amp; ")"&lt;/P&gt;&lt;P&gt;end if&lt;/P&gt;&lt;P&gt;FindLabel = FindLabel &amp;amp; strLabel &amp;amp; vbnewline&lt;/P&gt;&lt;P&gt;Set prow = prows.next&lt;/P&gt;&lt;P&gt;Loop&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2015 13:38:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/label-related-table-in-one-staked-label/m-p/418045#M1431</guid>
      <dc:creator>TimSexton1</dc:creator>
      <dc:date>2015-04-22T13:38:11Z</dc:date>
    </item>
    <item>
      <title>Re: label related table - in one staked label</title>
      <link>https://community.esri.com/t5/transportation-questions/label-related-table-in-one-staked-label/m-p/418046#M1432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Works perfect! Thank you!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2015 16:45:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/transportation-questions/label-related-table-in-one-staked-label/m-p/418046#M1432</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2015-04-22T16:45:30Z</dc:date>
    </item>
  </channel>
</rss>

