<?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 Performing field calculation using related table. in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/performing-field-calculation-using-related-table/m-p/1110728#M47134</link>
    <description>&lt;P&gt;Greetings all,&lt;/P&gt;&lt;P&gt;In my database I have a point file of event locations, and another point file showing the position of people during each event. I want to perform a field calculation to record how many people were within a 5m radius of each event.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know for one-to-many relationships, you must relate the tables, but I cannot use the field calculator like I would if I could join the table. Is there any way to do this in ArcGIS Pro? I don't mind using Python if need be.&lt;/P&gt;</description>
    <pubDate>Mon, 25 Oct 2021 08:55:32 GMT</pubDate>
    <dc:creator>byllus001</dc:creator>
    <dc:date>2021-10-25T08:55:32Z</dc:date>
    <item>
      <title>Performing field calculation using related table.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/performing-field-calculation-using-related-table/m-p/1110728#M47134</link>
      <description>&lt;P&gt;Greetings all,&lt;/P&gt;&lt;P&gt;In my database I have a point file of event locations, and another point file showing the position of people during each event. I want to perform a field calculation to record how many people were within a 5m radius of each event.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know for one-to-many relationships, you must relate the tables, but I cannot use the field calculator like I would if I could join the table. Is there any way to do this in ArcGIS Pro? I don't mind using Python if need be.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Oct 2021 08:55:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/performing-field-calculation-using-related-table/m-p/1110728#M47134</guid>
      <dc:creator>byllus001</dc:creator>
      <dc:date>2021-10-25T08:55:32Z</dc:date>
    </item>
    <item>
      <title>Re: Performing field calculation using related table.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/performing-field-calculation-using-related-table/m-p/1110741#M47135</link>
      <description>&lt;P&gt;Create a new integer field in your event fc. Do not join the tables. Calculate the new field, switch to Arcade, edit and use this code.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var people_fc = FeatureSetByName($datastore, "PeopleFeatureclass", ["ObjectID"], true)
return Count(Intersects(Buffer($feature, 5), people_fc))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Oct 2021 09:20:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/performing-field-calculation-using-related-table/m-p/1110741#M47135</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2021-10-25T09:20:21Z</dc:date>
    </item>
    <item>
      <title>Re: Performing field calculation using related table.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/performing-field-calculation-using-related-table/m-p/1110755#M47137</link>
      <description>&lt;P&gt;Just ran your code with my variables, and it worked perfectly! Thank you very much, Johannes.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Oct 2021 10:12:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/performing-field-calculation-using-related-table/m-p/1110755#M47137</guid>
      <dc:creator>byllus001</dc:creator>
      <dc:date>2021-10-25T10:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: Performing field calculation using related table.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/performing-field-calculation-using-related-table/m-p/1206471#M59096</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am having a similar issue and am wondering how this code can be modified with my situation. I have a polygon feature class in a FGDB that is related to a table in the same FDGB. In the table, there are multiple rows that need to match up with one polygon in the feature class. I would like to field calculate field attributes from the table to the polygon layer. Can this be done with a variation of this code? Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2022 18:21:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/performing-field-calculation-using-related-table/m-p/1206471#M59096</guid>
      <dc:creator>AdamHart1</dc:creator>
      <dc:date>2022-08-25T18:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: Performing field calculation using related table.</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/performing-field-calculation-using-related-table/m-p/1207118#M59176</link>
      <description>&lt;P&gt;If you have built a relationship class, you can get the related table entries like this:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var related = FeatureSetByRelationshipName($feature, "NameOfTheRelationshipClass")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If not, you have to load and filter the table like this:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var table = FeatureSetByName($datastore, "NameOfTheTable")
var id = $feature.PrimaryKey
var related = Filter(table, "ForeignKey = &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/354972"&gt;@ID&lt;/a&gt;")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And then it depends on what you want to extract from the related table entries. Some examples:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// Return the count
return Count(related)

// return max/min/mean/sum of a field
return Max(related, "FieldName")&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 29 Aug 2022 08:47:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/performing-field-calculation-using-related-table/m-p/1207118#M59176</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-08-29T08:47:50Z</dc:date>
    </item>
  </channel>
</rss>

