<?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 Dashboard Indicator Arcade Expression in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-indicator-arcade-expression/m-p/1382435#M9057</link>
    <description>&lt;P&gt;I'm seeking assistance with an arcade expression to show some data in a dashboard: Percent from two values in one field of a table to display in an indicator (matched / total).&lt;/P&gt;&lt;P&gt;If I could figure out how to do this without an expression I would be happy, but I don't think the indicator element is capable of calculating a percent.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var fs = FeatureSetByPortalItem(Portal('https://gisportal.company.com/portal'),
    'itemId',
    0,
    [
        'matched', //field name
    ],
    false
);
// Count of 'matched' by counting number of rows that are 'matched' and this one is giving me the execution error so can't even get to the next variable
var matched = Count(fs["matched"] == 'matched', 1, null);
// Total count of 'matched' and 'asset only', (this could be totally wrong) 
var total = Count((When(fs["matched"] == 'matched', 1, null)) + (When(fs["matched"] == 'asset only', 1, null))); 
          
var percentMatched = (matched / total) * 100;

return FeatureSet(percentMatched);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it matters/helps, the 'matched' field has three values: matched, asset only, gis only.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 14 Feb 2024 19:27:40 GMT</pubDate>
    <dc:creator>SeanT</dc:creator>
    <dc:date>2024-02-14T19:27:40Z</dc:date>
    <item>
      <title>Dashboard Indicator Arcade Expression</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-indicator-arcade-expression/m-p/1382435#M9057</link>
      <description>&lt;P&gt;I'm seeking assistance with an arcade expression to show some data in a dashboard: Percent from two values in one field of a table to display in an indicator (matched / total).&lt;/P&gt;&lt;P&gt;If I could figure out how to do this without an expression I would be happy, but I don't think the indicator element is capable of calculating a percent.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var fs = FeatureSetByPortalItem(Portal('https://gisportal.company.com/portal'),
    'itemId',
    0,
    [
        'matched', //field name
    ],
    false
);
// Count of 'matched' by counting number of rows that are 'matched' and this one is giving me the execution error so can't even get to the next variable
var matched = Count(fs["matched"] == 'matched', 1, null);
// Total count of 'matched' and 'asset only', (this could be totally wrong) 
var total = Count((When(fs["matched"] == 'matched', 1, null)) + (When(fs["matched"] == 'asset only', 1, null))); 
          
var percentMatched = (matched / total) * 100;

return FeatureSet(percentMatched);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it matters/helps, the 'matched' field has three values: matched, asset only, gis only.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2024 19:27:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-indicator-arcade-expression/m-p/1382435#M9057</guid>
      <dc:creator>SeanT</dc:creator>
      <dc:date>2024-02-14T19:27:40Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard Indicator Arcade Expression</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-indicator-arcade-expression/m-p/1382458#M9058</link>
      <description>&lt;P&gt;You have to return the value in a FeatureSet like this&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;return FeatureSet(Text({
  fields: [{name: 'the_percentage', type: 'esriFieldTypeSingle'}],
  geometryType: '',
  features: [{attributes:{the_percentage:percentMatched}}]
}))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2024 19:51:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-indicator-arcade-expression/m-p/1382458#M9058</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-02-14T19:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard Indicator Arcade Expression</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-indicator-arcade-expression/m-p/1382477#M9060</link>
      <description>&lt;P&gt;You don't need to use a data expression for this. Just add your data to an indicator and filter it to provide your 'matched' value. Then toggle on the reference option and add your data without a filter to display the 'total' value.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JenniferAcunto_0-1707941852110.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/94803iA9B4A457CAF80A4C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JenniferAcunto_0-1707941852110.png" alt="JenniferAcunto_0-1707941852110.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Then on the Indicator tab, remove the {value} and {reference} fields and use the {} button to select {percentage}.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JenniferAcunto_1-1707941940239.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/94804iFDE0060781B6A090/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JenniferAcunto_1-1707941940239.png" alt="JenniferAcunto_1-1707941940239.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2024 20:19:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-indicator-arcade-expression/m-p/1382477#M9060</guid>
      <dc:creator>JenniferAcunto</dc:creator>
      <dc:date>2024-02-14T20:19:41Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard Indicator Arcade Expression</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-indicator-arcade-expression/m-p/1382486#M9061</link>
      <description>&lt;P&gt;Thank you so much! I am going to try this now.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2024 20:32:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-indicator-arcade-expression/m-p/1382486#M9061</guid>
      <dc:creator>SeanT</dc:creator>
      <dc:date>2024-02-14T20:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard Indicator Arcade Expression</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-indicator-arcade-expression/m-p/1382490#M9064</link>
      <description>&lt;P&gt;I was pretty sure about the FeatureSet() part but getting the info for it was giving me trouble. May be able to do this without an expression based on the other response, so I'm going with it for now. Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2024 20:34:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/dashboard-indicator-arcade-expression/m-p/1382490#M9064</guid>
      <dc:creator>SeanT</dc:creator>
      <dc:date>2024-02-14T20:34:00Z</dc:date>
    </item>
  </channel>
</rss>

