<?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: Using Arcade GroupBy in the Field Calculator in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/using-arcade-groupby-in-the-field-calculator/m-p/1117140#M47869</link>
    <description>&lt;LI-CODE lang="javascript"&gt;// load the feature set
var fs = FeatureSetByName($datastore, 'TrailLinesQAQC')
// filter for name
var name = $feature.name
var filtered_fs = Filter(fs, "name = @name")
// get sum of sec_length_ft
return Sum(filtered_fs, "sec_length_ft")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This should work, too:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// do it with GroupBy
var group = GroupBy(FeatureSetByName($datastore, 'TrailLinesQAQC'),'name',
{name: 'trail_ft', expression: 'sec_length_ft', statistic: 'SUM'})

// you still have to filter it
var name = $feature.name
var filtered_group = Filter(group, "name = @name")
return First(filtered_group).trail_ft&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 16 Nov 2021 07:35:49 GMT</pubDate>
    <dc:creator>JohannesLindner</dc:creator>
    <dc:date>2021-11-16T07:35:49Z</dc:date>
    <item>
      <title>Using Arcade GroupBy in the Field Calculator</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/using-arcade-groupby-in-the-field-calculator/m-p/1116945#M47847</link>
      <description>&lt;P&gt;I have a column called 'name' with trail names that repeat sometimes and a column called 'sec_length_ft' with the length of each trail segment. I want to use GroupBy to add up the sections of the same trail name to populate the 'trail_ft' column. The code I've come up with is below. It runs without errors, but the table doesn't update.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;GroupBy(FeatureSetByName($datastore, 'TrailLinesQAQC'),'name',&lt;BR /&gt;{name: 'trail_ft', expression: 'sec_length_ft', statistic: 'SUM'})&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TrailLinesQAQC is the name of the layer&lt;/P&gt;&lt;P&gt;Trail_ft is the column I want to be updated&lt;/P&gt;&lt;P&gt;name is the names of the trails that I want to group the data by&lt;/P&gt;&lt;P&gt;sec_length_ft is the name of the column that contains values of trail segments to be added up for the trail_ft column&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Nov 2021 16:52:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/using-arcade-groupby-in-the-field-calculator/m-p/1116945#M47847</guid>
      <dc:creator>MarilynLong1</dc:creator>
      <dc:date>2021-11-15T16:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: Using Arcade GroupBy in the Field Calculator</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/using-arcade-groupby-in-the-field-calculator/m-p/1117140#M47869</link>
      <description>&lt;LI-CODE lang="javascript"&gt;// load the feature set
var fs = FeatureSetByName($datastore, 'TrailLinesQAQC')
// filter for name
var name = $feature.name
var filtered_fs = Filter(fs, "name = @name")
// get sum of sec_length_ft
return Sum(filtered_fs, "sec_length_ft")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This should work, too:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// do it with GroupBy
var group = GroupBy(FeatureSetByName($datastore, 'TrailLinesQAQC'),'name',
{name: 'trail_ft', expression: 'sec_length_ft', statistic: 'SUM'})

// you still have to filter it
var name = $feature.name
var filtered_group = Filter(group, "name = @name")
return First(filtered_group).trail_ft&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 16 Nov 2021 07:35:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/using-arcade-groupby-in-the-field-calculator/m-p/1117140#M47869</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2021-11-16T07:35:49Z</dc:date>
    </item>
    <item>
      <title>Re: Using Arcade GroupBy in the Field Calculator</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/using-arcade-groupby-in-the-field-calculator/m-p/1117271#M47881</link>
      <description>&lt;P&gt;Thank you so much Johannes! You saved me so many hours of work!&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 15:27:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/using-arcade-groupby-in-the-field-calculator/m-p/1117271#M47881</guid>
      <dc:creator>MarilynLong1</dc:creator>
      <dc:date>2021-11-16T15:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: Using Arcade GroupBy in the Field Calculator</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/using-arcade-groupby-in-the-field-calculator/m-p/1117579#M47905</link>
      <description>&lt;P&gt;Glad to have helped. Please accept the answer so that the question is marked as solved.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Nov 2021 06:04:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/using-arcade-groupby-in-the-field-calculator/m-p/1117579#M47905</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2021-11-17T06:04:17Z</dc:date>
    </item>
    <item>
      <title>Re: Using Arcade GroupBy in the Field Calculator</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/using-arcade-groupby-in-the-field-calculator/m-p/1264293#M66238</link>
      <description>&lt;P&gt;is there an example of GroupBy for the calculate field in Arc Pro where the layer and field name&amp;nbsp; are already&amp;nbsp; designated ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;i.e what goes in the expression box? thanks&lt;/P&gt;</description>
      <pubDate>Sat, 04 Mar 2023 23:06:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/using-arcade-groupby-in-the-field-calculator/m-p/1264293#M66238</guid>
      <dc:creator>JeanineEGS</dc:creator>
      <dc:date>2023-03-04T23:06:37Z</dc:date>
    </item>
  </channel>
</rss>

