<?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 GroupBy Arcade in data expression for Dashboard in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/groupby-arcade-in-data-expression-for-dashboard/m-p/1381156#M9048</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I have to GroupBy "nojob" the follwing code. I split at comma a field to have it in different lines in dashbord. I really don't know how I can add a groupby "nojob" in this case...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var portal = Portal('&lt;A href="https://xxx.xxxxx.ca/portal" target="_blank"&gt;https://xxx.xxxxx.ca/portal&lt;/A&gt;');&lt;BR /&gt;var fs = FeatureSetByPortalItem(&lt;BR /&gt;portal,&lt;BR /&gt;// Item ID of the jobsignalisation layer&lt;BR /&gt;'250b512105df48169e8d01a0xxxxxxxx',&lt;BR /&gt;// Layer ID&lt;BR /&gt;2,&lt;BR /&gt;// Fields of interest&lt;BR /&gt;[&lt;BR /&gt;'nojob', 'resumeinterventiondemandee', 'resumeinterventiondemandeep'&lt;BR /&gt;],&lt;BR /&gt;// Not Need geometry&lt;BR /&gt;false);&lt;/P&gt;&lt;P&gt;// Initialize the result variable&lt;BR /&gt;var final_result = '';&lt;/P&gt;&lt;P&gt;// Iterate through each entity in the FeatureSet&lt;BR /&gt;for (var f in fs) {&lt;BR /&gt;// Get the field values for this entity&lt;BR /&gt;var top_text = f.nojob;&lt;BR /&gt;var text1 = f.resumeinterventiondemandee;&lt;BR /&gt;var text2 = f.resumeinterventiondemandeep;&lt;/P&gt;&lt;P&gt;// Use split to divide the text by commas&lt;BR /&gt;var elements1 = Split(text1, ',');&lt;BR /&gt;var elements2 = Split(text2, ',');&lt;/P&gt;&lt;P&gt;// Initialize result variables for both fields&lt;BR /&gt;var result1 = '';&lt;BR /&gt;var result2 = '';&lt;/P&gt;&lt;P&gt;// Iterate over the elements and add them to the result variable&lt;BR /&gt;for (var i in elements1) {&lt;BR /&gt;result1 += elements1[i] + TextFormatting.NewLine;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;for (var j in elements2) {&lt;BR /&gt;result2 += elements2[j] + TextFormatting.NewLine;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;// Concatenate the results with the top text and an empty line between them&lt;BR /&gt;final_result += top_text + TextFormatting.NewLine + TextFormatting.NewLine + result1 + result2 + TextFormatting.NewLine + TextFormatting.NewLine;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;return final_result;&lt;/P&gt;</description>
    <pubDate>Mon, 12 Feb 2024 17:04:38 GMT</pubDate>
    <dc:creator>mfafard</dc:creator>
    <dc:date>2024-02-12T17:04:38Z</dc:date>
    <item>
      <title>GroupBy Arcade in data expression for Dashboard</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/groupby-arcade-in-data-expression-for-dashboard/m-p/1381156#M9048</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I have to GroupBy "nojob" the follwing code. I split at comma a field to have it in different lines in dashbord. I really don't know how I can add a groupby "nojob" in this case...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var portal = Portal('&lt;A href="https://xxx.xxxxx.ca/portal" target="_blank"&gt;https://xxx.xxxxx.ca/portal&lt;/A&gt;');&lt;BR /&gt;var fs = FeatureSetByPortalItem(&lt;BR /&gt;portal,&lt;BR /&gt;// Item ID of the jobsignalisation layer&lt;BR /&gt;'250b512105df48169e8d01a0xxxxxxxx',&lt;BR /&gt;// Layer ID&lt;BR /&gt;2,&lt;BR /&gt;// Fields of interest&lt;BR /&gt;[&lt;BR /&gt;'nojob', 'resumeinterventiondemandee', 'resumeinterventiondemandeep'&lt;BR /&gt;],&lt;BR /&gt;// Not Need geometry&lt;BR /&gt;false);&lt;/P&gt;&lt;P&gt;// Initialize the result variable&lt;BR /&gt;var final_result = '';&lt;/P&gt;&lt;P&gt;// Iterate through each entity in the FeatureSet&lt;BR /&gt;for (var f in fs) {&lt;BR /&gt;// Get the field values for this entity&lt;BR /&gt;var top_text = f.nojob;&lt;BR /&gt;var text1 = f.resumeinterventiondemandee;&lt;BR /&gt;var text2 = f.resumeinterventiondemandeep;&lt;/P&gt;&lt;P&gt;// Use split to divide the text by commas&lt;BR /&gt;var elements1 = Split(text1, ',');&lt;BR /&gt;var elements2 = Split(text2, ',');&lt;/P&gt;&lt;P&gt;// Initialize result variables for both fields&lt;BR /&gt;var result1 = '';&lt;BR /&gt;var result2 = '';&lt;/P&gt;&lt;P&gt;// Iterate over the elements and add them to the result variable&lt;BR /&gt;for (var i in elements1) {&lt;BR /&gt;result1 += elements1[i] + TextFormatting.NewLine;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;for (var j in elements2) {&lt;BR /&gt;result2 += elements2[j] + TextFormatting.NewLine;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;// Concatenate the results with the top text and an empty line between them&lt;BR /&gt;final_result += top_text + TextFormatting.NewLine + TextFormatting.NewLine + result1 + result2 + TextFormatting.NewLine + TextFormatting.NewLine;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;return final_result;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 17:04:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/groupby-arcade-in-data-expression-for-dashboard/m-p/1381156#M9048</guid>
      <dc:creator>mfafard</dc:creator>
      <dc:date>2024-02-12T17:04:38Z</dc:date>
    </item>
  </channel>
</rss>

