<?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 ArcGIS Dashboards Arcade Expression to categorize numeric data in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-dashboards-arcade-expression-to-categorize/m-p/1399784#M9303</link>
    <description>&lt;P&gt;Hello -&lt;/P&gt;&lt;P&gt;I am working in ArcGIS Dashboards, and have a field (PR_RANK) that ranks records based upon a score (no 2 records have the same rank). I want to create a selector so users can select a set of records based upon a range of ranks (e.g. projects with a rank of 1-50). The number selector using range does not work, as rank is null for some records causing the whole dashboard to be filtered to only records with a rank. As a result, I am trying to create an arcade data expression that creates categories (1-50, 51-100, &amp;gt;100) based upon the rank (integer) that I can then use in a category selector. I am still new to Arcade, and I am getting an error "&lt;SPAN&gt;Test execution error: Execution error - Cannot access value using a key of this type. Verify test data." for the below code. Can anyone tell me where I am going, or I am open to suggestions of other ways to make this work.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var fs = FeatureSetByPortalItem(
  Portal('https://www.arcgis.com'),
  'XXXXXXXXXXXXXXXXXXX',
  0,
  ['PROJECTID', 'PR_RANK'],
  false
);

return When(
  fs.PR_RANK&amp;gt;=1 &amp;amp;&amp;amp; fs.PR_RANK&amp;lt;=50, "1-50",
  fs.PR_RANK&amp;gt;50 &amp;amp;&amp;amp; fs.PR_RANK&amp;lt;=100, "51-100", 
  fs.PR_RANK&amp;gt;100, "&amp;gt;100",
  "n/a"
  );&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 22 Mar 2024 19:26:42 GMT</pubDate>
    <dc:creator>LJackson29</dc:creator>
    <dc:date>2024-03-22T19:26:42Z</dc:date>
    <item>
      <title>ArcGIS Dashboards Arcade Expression to categorize numeric data</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-dashboards-arcade-expression-to-categorize/m-p/1399784#M9303</link>
      <description>&lt;P&gt;Hello -&lt;/P&gt;&lt;P&gt;I am working in ArcGIS Dashboards, and have a field (PR_RANK) that ranks records based upon a score (no 2 records have the same rank). I want to create a selector so users can select a set of records based upon a range of ranks (e.g. projects with a rank of 1-50). The number selector using range does not work, as rank is null for some records causing the whole dashboard to be filtered to only records with a rank. As a result, I am trying to create an arcade data expression that creates categories (1-50, 51-100, &amp;gt;100) based upon the rank (integer) that I can then use in a category selector. I am still new to Arcade, and I am getting an error "&lt;SPAN&gt;Test execution error: Execution error - Cannot access value using a key of this type. Verify test data." for the below code. Can anyone tell me where I am going, or I am open to suggestions of other ways to make this work.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var fs = FeatureSetByPortalItem(
  Portal('https://www.arcgis.com'),
  'XXXXXXXXXXXXXXXXXXX',
  0,
  ['PROJECTID', 'PR_RANK'],
  false
);

return When(
  fs.PR_RANK&amp;gt;=1 &amp;amp;&amp;amp; fs.PR_RANK&amp;lt;=50, "1-50",
  fs.PR_RANK&amp;gt;50 &amp;amp;&amp;amp; fs.PR_RANK&amp;lt;=100, "51-100", 
  fs.PR_RANK&amp;gt;100, "&amp;gt;100",
  "n/a"
  );&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Mar 2024 19:26:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-dashboards-arcade-expression-to-categorize/m-p/1399784#M9303</guid>
      <dc:creator>LJackson29</dc:creator>
      <dc:date>2024-03-22T19:26:42Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Dashboards Arcade Expression to categorize numeric data</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-dashboards-arcade-expression-to-categorize/m-p/1405028#M9343</link>
      <description>&lt;P&gt;Hi LeilaJackson1, as far as i know, if we want to use new dataset created from data expression as data source of dashboard's widget, it has to be return as a "FeatureSet" type in the return line. probably you can refer to this post on how to create new featureset&amp;nbsp; &lt;A href="https://developers.arcgis.com/arcade/guide/featuresets/" target="_blank"&gt;https://developers.arcgis.com/arcade/guide/featuresets/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 04:41:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/arcgis-dashboards-arcade-expression-to-categorize/m-p/1405028#M9343</guid>
      <dc:creator>iprameshwari</dc:creator>
      <dc:date>2024-04-03T04:41:16Z</dc:date>
    </item>
  </channel>
</rss>

