<?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: Arcade trouble with GroupBy function in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/arcade-trouble-with-groupby-function/m-p/1641366#M65917</link>
    <description>&lt;P&gt;nevermind, I found the descirptions below.&lt;/P&gt;</description>
    <pubDate>Tue, 12 Aug 2025 19:29:02 GMT</pubDate>
    <dc:creator>dcaESRIwvges</dc:creator>
    <dc:date>2025-08-12T19:29:02Z</dc:date>
    <item>
      <title>Arcade trouble with GroupBy function</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-trouble-with-groupby-function/m-p/1302442#M53039</link>
      <description>&lt;P&gt;I have a layer of locations with a related table that contains 'calls for service' to a given location by police, fire, or code enforcement staff. I want to include in the pop up a breakdown of the types of alls made to each location, including the number of each unique type and a summary of a points score applied to each call based on the severity of the call type (for instance homicides get a 10, wiring infractions a 1). I think I can do this using a combination of the GroupBy function and FeatureSetByRelationshipName function. However, I keep running into a problem with the GroupBy syntax where Arcade flags the GroupBy statement and says it is an invalid variable assignment. I've modeled this after examples provided and can't figure out what i am missing in my code which is below. Any thoughts?&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;LI-CODE lang="javascript"&gt;var CallsByType = GroupBy(FeatureSetByRelationshipName($feature, "AdaptLocationCallDetails"),
[
  {name:'Department', expression:'BU_SOURCE'}
  {name:'Type' , expression:'CALLDESCRIPTION'}
],
[
  {name:'Total',expression:'1',statistic:'COUNT'}
  {name:'Points',expression:'POINTVALUE',statistic:'SUM'}
]
);

&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 23 Jun 2023 13:54:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-trouble-with-groupby-function/m-p/1302442#M53039</guid>
      <dc:creator>clt_cabq</dc:creator>
      <dc:date>2023-06-23T13:54:14Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade trouble with GroupBy function</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-trouble-with-groupby-function/m-p/1302447#M53041</link>
      <description>&lt;P&gt;The first thing that catches my eye is that you don't have commas separating the objects in the arrays.&amp;nbsp; Also if this is the only line of your expression, make sure to return CallsByType (or don't even declare the variable).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var CallsByType = GroupBy(FeatureSetByRelationshipName($feature, "AdaptLocationCallDetails"),
[
  {name:'Department', expression:'BU_SOURCE'},
  {name:'Type' , expression:'CALLDESCRIPTION'}
],
[
  {name:'Total',expression:'1',statistic:'COUNT'},
  {name:'Points',expression:'POINTVALUE',statistic:'SUM'}
]
);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2023 14:07:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-trouble-with-groupby-function/m-p/1302447#M53041</guid>
      <dc:creator>Justin_Greco</dc:creator>
      <dc:date>2023-06-23T14:07:18Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade trouble with GroupBy function</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-trouble-with-groupby-function/m-p/1641365#M65916</link>
      <description>&lt;P&gt;I'm so glad i found this! I can't find a description of what is required for the GroupByFields and Statistics part of this function. I know name: in the first section is the field name, but what is the expression: in the first section and and what does the "name:" refer to in the last section or statistics? is this arbitrary? why is it expression: '1' and 'POINTVALUE', The ESRI help only gives some bad examples but doesn't explain the parts of the function.&amp;nbsp;&lt;A href="https://developers.arcgis.com/arcade/function-reference/featureset_functions/#groupby" target="_blank"&gt;https://developers.arcgis.com/arcade/function-reference/featureset_functions/#groupby&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Aug 2025 19:26:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-trouble-with-groupby-function/m-p/1641365#M65916</guid>
      <dc:creator>dcaESRIwvges</dc:creator>
      <dc:date>2025-08-12T19:26:54Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade trouble with GroupBy function</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-trouble-with-groupby-function/m-p/1641366#M65917</link>
      <description>&lt;P&gt;nevermind, I found the descirptions below.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Aug 2025 19:29:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-trouble-with-groupby-function/m-p/1641366#M65917</guid>
      <dc:creator>dcaESRIwvges</dc:creator>
      <dc:date>2025-08-12T19:29:02Z</dc:date>
    </item>
  </channel>
</rss>

