<?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 Arcade data expression in dashboard with Groupby function returns null values in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-data-expression-in-dashboard-with-groupby/m-p/1337629#M8575</link>
    <description>&lt;P&gt;Dear All, I am trying&amp;nbsp; to calculate the sum of values grouped by two fields, however it returns null values and, in addition to this, it seems it doesn't group at all (see image attached).&lt;/P&gt;&lt;P&gt;Any idea?&lt;/P&gt;&lt;P&gt;My dahboard is running on Portal for Arcgis 11.1.&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;Here is the code:&lt;/P&gt;&lt;P&gt;var myPortal = Portal('&lt;A href="https://www.myportal.it/portal" target="_blank" rel="noopener"&gt;https://www.myportal.it/portal&lt;/A&gt;');&lt;BR /&gt;var itemId = '123456789';&lt;BR /&gt;var layerId = 0;&lt;BR /&gt;var fs = FeatureSetByPortalItem(myPortal,itemId, layerId,&lt;BR /&gt;['cod_reg','anno','csuolo8','clammi3_num'],false);&lt;/P&gt;&lt;P&gt;Console('Somma clammi3_num: ', sum(fs,'clammi3_num'));&lt;BR /&gt;Console('primo record: ',First(fs));&lt;/P&gt;&lt;P&gt;return GroupBy(fs, ['anno','cod_reg'], [&lt;BR /&gt;{name: 'sum_clammi', expression: 'clammi3_num', statistic: 'SUM' },&lt;BR /&gt;{name: 'sum_csuolo', expression: 'csuolo8', statistic: 'SUM' }&lt;BR /&gt;]);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Arpa_PiemonteGeoportal_Team_0-1697188323912.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/83021i0B87263D52660588/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Arpa_PiemonteGeoportal_Team_0-1697188323912.png" alt="Arpa_PiemonteGeoportal_Team_0-1697188323912.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 13 Oct 2023 09:34:08 GMT</pubDate>
    <dc:creator>Arpa_PiemonteGeoportal_Team</dc:creator>
    <dc:date>2023-10-13T09:34:08Z</dc:date>
    <item>
      <title>Arcade data expression in dashboard with Groupby function returns null values</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-data-expression-in-dashboard-with-groupby/m-p/1337629#M8575</link>
      <description>&lt;P&gt;Dear All, I am trying&amp;nbsp; to calculate the sum of values grouped by two fields, however it returns null values and, in addition to this, it seems it doesn't group at all (see image attached).&lt;/P&gt;&lt;P&gt;Any idea?&lt;/P&gt;&lt;P&gt;My dahboard is running on Portal for Arcgis 11.1.&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;Here is the code:&lt;/P&gt;&lt;P&gt;var myPortal = Portal('&lt;A href="https://www.myportal.it/portal" target="_blank" rel="noopener"&gt;https://www.myportal.it/portal&lt;/A&gt;');&lt;BR /&gt;var itemId = '123456789';&lt;BR /&gt;var layerId = 0;&lt;BR /&gt;var fs = FeatureSetByPortalItem(myPortal,itemId, layerId,&lt;BR /&gt;['cod_reg','anno','csuolo8','clammi3_num'],false);&lt;/P&gt;&lt;P&gt;Console('Somma clammi3_num: ', sum(fs,'clammi3_num'));&lt;BR /&gt;Console('primo record: ',First(fs));&lt;/P&gt;&lt;P&gt;return GroupBy(fs, ['anno','cod_reg'], [&lt;BR /&gt;{name: 'sum_clammi', expression: 'clammi3_num', statistic: 'SUM' },&lt;BR /&gt;{name: 'sum_csuolo', expression: 'csuolo8', statistic: 'SUM' }&lt;BR /&gt;]);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Arpa_PiemonteGeoportal_Team_0-1697188323912.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/83021i0B87263D52660588/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Arpa_PiemonteGeoportal_Team_0-1697188323912.png" alt="Arpa_PiemonteGeoportal_Team_0-1697188323912.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2023 09:34:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-data-expression-in-dashboard-with-groupby/m-p/1337629#M8575</guid>
      <dc:creator>Arpa_PiemonteGeoportal_Team</dc:creator>
      <dc:date>2023-10-13T09:34:08Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade data expression in dashboard with Groupby function returns null values</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-data-expression-in-dashboard-with-groupby/m-p/1555493#M10457</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have the same problem (on Arcgis 10.9.1). I really don't get why it does not work. I ended up copying the data in a new FeatureSet the same way it is done in this subject&amp;nbsp; &lt;A href="https://community.esri.com/t5/arcgis-dashboards-questions/arcade-data-expression-groupby-not-grouping/td-p/1486509" target="_self"&gt;https://community.esri.com/t5/arcgis-dashboards-questions/arcade-data-expression-groupby-not-grouping/td-p/1486509&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I am not quite satisfied that the normal way does not work but still, it prevents from creating new tables in the database. I hope it can be useful as much as I hope someone will find a better way to do it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2024 16:51:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcade-data-expression-in-dashboard-with-groupby/m-p/1555493#M10457</guid>
      <dc:creator>ml_caln_france</dc:creator>
      <dc:date>2024-11-05T16:51:09Z</dc:date>
    </item>
  </channel>
</rss>

