<?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: Expression to count the number of features where a condition is true. in ArcGIS Experience Builder Questions</title>
    <link>https://community.esri.com/t5/arcgis-experience-builder-questions/expression-to-count-the-number-of-features-where-a/m-p/1222565#M5543</link>
    <description>&lt;P&gt;ExB doesn't have much in terms of expressions. Certainly not conditional statements. Data source views are (currently) the only way to accomplish this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Oct 2022 17:51:44 GMT</pubDate>
    <dc:creator>jcarlson</dc:creator>
    <dc:date>2022-10-17T17:51:44Z</dc:date>
    <item>
      <title>Expression to count the number of features where a condition is true.</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/expression-to-count-the-number-of-features-where-a/m-p/1221891#M5507</link>
      <description>&lt;P&gt;In ExB I'd like to count the number of features where the condition met is true. I have a number of features with a text field called "Is an Issue Flagged?". If the value is "Yes" (i.e True) then I'd like to count them. So if I have 6 features with the field&amp;nbsp; &amp;nbsp;Is an Issue Flagged&amp;nbsp; = "Yes"&amp;nbsp; &amp;nbsp;I'd put a 6 in a dynamic text box.&lt;/P&gt;&lt;P&gt;Here is my expression that doesn't work:&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN class=""&gt;IF&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;{Is an Issue Flagged?}&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"Yes"&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;THEN&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;COUNT&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;{ObjectID}&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;END&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;GR&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 03:14:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/expression-to-count-the-number-of-features-where-a/m-p/1221891#M5507</guid>
      <dc:creator>GregReinecke</dc:creator>
      <dc:date>2022-10-14T03:14:49Z</dc:date>
    </item>
    <item>
      <title>Re: Expression to count the number of features where a condition is true.</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/expression-to-count-the-number-of-features-where-a/m-p/1221981#M5509</link>
      <description>&lt;P&gt;Where is this calculation in the experience?&amp;nbsp; If you are able to use Arcade,&amp;nbsp;I saw this Geonet response that filtered by the field and I think you could do something similar.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-online-questions/arcade-totaling-field-values-of-features-contained/m-p/603540#M30196" target="_self"&gt;https://community.esri.com/t5/arcgis-online-questions/arcade-totaling-field-values-of-features-contained/m-p/603540#M30196&lt;/A&gt;&lt;/P&gt;&lt;P&gt;alternatively,&lt;/P&gt;&lt;LI-CODE lang="python"&gt;var fc = FeatureSetBYName($datastore, "layername", ["Is an issue flagged"], True);

var cnt = 0;

for (var yes in fc) {
    if (yes.is an issue lagged == "yes")  {
        cnt += 1;
    }
}
return cnt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I based the above off of a solution here:&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-arcade-filter-function-issue/td-p/206017" target="_self"&gt;https://community.esri.com/t5/arcgis-pro-questions/attribute-rule-arcade-filter-function-issue/td-p/206017&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 12:25:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/expression-to-count-the-number-of-features-where-a/m-p/1221981#M5509</guid>
      <dc:creator>Kara_Shindle</dc:creator>
      <dc:date>2022-10-14T12:25:56Z</dc:date>
    </item>
    <item>
      <title>Re: Expression to count the number of features where a condition is true.</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/expression-to-count-the-number-of-features-where-a/m-p/1222489#M5539</link>
      <description>&lt;P&gt;The approach is likely not an arcade solution but the approach you presented is perfect. I did actually use views in ExB and &amp;nbsp;counted items from there. I was just trying to skip that step. Thanks you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2022 14:06:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/expression-to-count-the-number-of-features-where-a/m-p/1222489#M5539</guid>
      <dc:creator>WFNSProject</dc:creator>
      <dc:date>2022-10-17T14:06:41Z</dc:date>
    </item>
    <item>
      <title>Re: Expression to count the number of features where a condition is true.</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/expression-to-count-the-number-of-features-where-a/m-p/1222565#M5543</link>
      <description>&lt;P&gt;ExB doesn't have much in terms of expressions. Certainly not conditional statements. Data source views are (currently) the only way to accomplish this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2022 17:51:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/expression-to-count-the-number-of-features-where-a/m-p/1222565#M5543</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-10-17T17:51:44Z</dc:date>
    </item>
    <item>
      <title>Re: Expression to count the number of features where a condition is true.</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/expression-to-count-the-number-of-features-where-a/m-p/1627618#M19562</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/598171"&gt;@GregReinecke&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;This feature is supported in the June 2025 AGOL release. You can now add an Arcade expression to the text widget.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Shengdi&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jun 2025 07:37:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/expression-to-count-the-number-of-features-where-a/m-p/1627618#M19562</guid>
      <dc:creator>ShengdiZhang</dc:creator>
      <dc:date>2025-06-27T07:37:06Z</dc:date>
    </item>
  </channel>
</rss>

