<?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: GroupBy and left characters of a field in Dashbord data expression in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/groupby-and-left-characters-of-a-field-in-dashbord/m-p/1374451#M8985</link>
    <description>&lt;P&gt;Glad to help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp; If your question is answered, please mark the solution so that this thread shows as answered.&lt;/P&gt;</description>
    <pubDate>Thu, 25 Jan 2024 16:27:44 GMT</pubDate>
    <dc:creator>JohannesLindner</dc:creator>
    <dc:date>2024-01-25T16:27:44Z</dc:date>
    <item>
      <title>GroupBy and left characters of a field in Dashbord data expression</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/groupby-and-left-characters-of-a-field-in-dashbord/m-p/1374136#M8979</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;The following code work. But hard to believe that I can't groupby the 4 left characters of field "nojob"...&lt;/P&gt;
&lt;P&gt;I tried lot of scenario, without success&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;var portail = Portal('&lt;A href="https://xxxxx.ca/portal" target="_blank" rel="noopener"&gt;https://xxxxx.ca/portal&lt;/A&gt;');&lt;BR /&gt;var fs = FeatureSetByPortalItem(&lt;BR /&gt;portail,&lt;BR /&gt;//itemid layer jobsignalisation&lt;BR /&gt;'250b512105df48169e8d01xxxxxxxxxx',&lt;BR /&gt;//layer id&lt;BR /&gt;0,&lt;BR /&gt;[&lt;BR /&gt;'nojob'&lt;BR /&gt;],&lt;BR /&gt;false);&lt;/P&gt;
&lt;P&gt;var group_exp = [&lt;BR /&gt;{ name: 'jobsparannee', expression: 'nojob', statistic: 'COUNT'}]&lt;/P&gt;
&lt;P&gt;return GroupBy(fs,['nojob'], group_exp)&lt;/P&gt;
&lt;P&gt;return fs&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2024 16:53:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/groupby-and-left-characters-of-a-field-in-dashbord/m-p/1374136#M8979</guid>
      <dc:creator>mfafard</dc:creator>
      <dc:date>2024-06-28T16:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: GroupBy and left characters of a field in Dashbord data expression</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/groupby-and-left-characters-of-a-field-in-dashbord/m-p/1374184#M8980</link>
      <description>&lt;LI-CODE lang="javascript"&gt;var fs = Featureset({
  fields: [{name:"nojob", type:"esriFieldTypeString"}],
  features:[
    {attributes: {nojob: "abcdefg"}},
    {attributes: {nojob: "abcdabc"}},
    {attributes: {nojob: "abcd"}},
    {attributes: {nojob: "uvwx"}},
    {attributes: {nojob: "uvwxabc"}},
  ]
})

return GroupBy(fs, 
  [{name: "test", expression: "SUBSTRING(nojob, 1, 4)"}], 
  [{name: "test_count", statistic: "COUNT", expression: "1"}]
)&lt;/LI-CODE&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="JohannesLindner_0-1706134984947.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/92728iCBFDA0323135013D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohannesLindner_0-1706134984947.png" alt="JohannesLindner_0-1706134984947.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2024 22:23:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/groupby-and-left-characters-of-a-field-in-dashbord/m-p/1374184#M8980</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2024-01-24T22:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: GroupBy and left characters of a field in Dashbord data expression</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/groupby-and-left-characters-of-a-field-in-dashbord/m-p/1374327#M8981</link>
      <description>&lt;P&gt;Thank you Johannes, but my field "nojob" come from an attributes rule (year(now()) + - + sequentiel). So, I want to count how many job in 2024, etc.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 12:40:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/groupby-and-left-characters-of-a-field-in-dashbord/m-p/1374327#M8981</guid>
      <dc:creator>mfafard</dc:creator>
      <dc:date>2024-01-25T12:40:52Z</dc:date>
    </item>
    <item>
      <title>Re: GroupBy and left characters of a field in Dashbord data expression</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/groupby-and-left-characters-of-a-field-in-dashbord/m-p/1374340#M8982</link>
      <description>&lt;P&gt;Yes, I used test data here...&lt;/P&gt;&lt;P&gt;Your expression would look like this:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var portail = Portal('https://xxxxx.ca/portal');
var fs = FeatureSetByPortalItem(
    portail,
    //itemid layer jobsignalisation
    '250b512105df48169e8d01xxxxxxxxxx',
    //layer id
    0,
    [
        'nojob'
    ],
    false);

return GroupBy(fs, 
  [{name: "test", expression: "SUBSTRING(nojob, 1, 4)"}], 
  [{name: "test_count", statistic: "COUNT", expression: "1"}]
)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 25 Jan 2024 13:33:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/groupby-and-left-characters-of-a-field-in-dashbord/m-p/1374340#M8982</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2024-01-25T13:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: GroupBy and left characters of a field in Dashbord data expression</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/groupby-and-left-characters-of-a-field-in-dashbord/m-p/1374406#M8984</link>
      <description>&lt;P&gt;Yep, thank you! I didn't think about these two steps (substring then count...)&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 15:35:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/groupby-and-left-characters-of-a-field-in-dashbord/m-p/1374406#M8984</guid>
      <dc:creator>mfafard</dc:creator>
      <dc:date>2024-01-25T15:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: GroupBy and left characters of a field in Dashbord data expression</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/groupby-and-left-characters-of-a-field-in-dashbord/m-p/1374451#M8985</link>
      <description>&lt;P&gt;Glad to help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp; If your question is answered, please mark the solution so that this thread shows as answered.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jan 2024 16:27:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/groupby-and-left-characters-of-a-field-in-dashbord/m-p/1374451#M8985</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2024-01-25T16:27:44Z</dc:date>
    </item>
  </channel>
</rss>

