<?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 Counting a field from a related table - Pop ups in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/counting-a-field-from-a-related-table-pop-ups/m-p/1203397#M6322</link>
    <description>&lt;P&gt;Hello all, new to arcade and while I have some experience working with related tables, I can not for the life of me figure out how to count the records by individual fields.&lt;/P&gt;&lt;P&gt;I have a series of numeric fields in a solid waste survey that I would like to count by response.&amp;nbsp; Fields are numeric with 1 = yes and 0 = no (0).&amp;nbsp; I'd like to count and display each fields totals in popup.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Field name example would be&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;BWCnt.&amp;nbsp; Bulky Waste Items&lt;/LI&gt;&lt;LI&gt;RecCnt - Recyclables&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;etc...&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
    <pubDate>Tue, 16 Aug 2022 17:31:53 GMT</pubDate>
    <dc:creator>ScottStepro1</dc:creator>
    <dc:date>2022-08-16T17:31:53Z</dc:date>
    <item>
      <title>Counting a field from a related table - Pop ups</title>
      <link>https://community.esri.com/t5/developers-questions/counting-a-field-from-a-related-table-pop-ups/m-p/1203397#M6322</link>
      <description>&lt;P&gt;Hello all, new to arcade and while I have some experience working with related tables, I can not for the life of me figure out how to count the records by individual fields.&lt;/P&gt;&lt;P&gt;I have a series of numeric fields in a solid waste survey that I would like to count by response.&amp;nbsp; Fields are numeric with 1 = yes and 0 = no (0).&amp;nbsp; I'd like to count and display each fields totals in popup.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Field name example would be&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;BWCnt.&amp;nbsp; Bulky Waste Items&lt;/LI&gt;&lt;LI&gt;RecCnt - Recyclables&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;etc...&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2022 17:31:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/counting-a-field-from-a-related-table-pop-ups/m-p/1203397#M6322</guid>
      <dc:creator>ScottStepro1</dc:creator>
      <dc:date>2022-08-16T17:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: Counting a field from a related table - Pop ups</title>
      <link>https://community.esri.com/t5/developers-questions/counting-a-field-from-a-related-table-pop-ups/m-p/1203634#M6323</link>
      <description>&lt;P&gt;You can use &lt;A href="https://developers.arcgis.com/arcade/function-reference/math_functions/#sum" target="_blank" rel="noopener"&gt;Sum()&lt;/A&gt; for that.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// get the related table
var related = FeatureSetBy*(...)

// build the popup lines
var popup_lines = [
    "Bulky Waste Items: " + Sum(related, "BWCnt"),
    "Recyclables: " + Sum(related, "RecCnt"),
]

// conacatenate and return
return Concatenate(popup_lines, TextFormatting.NewLine)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 17 Aug 2022 07:51:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/counting-a-field-from-a-related-table-pop-ups/m-p/1203634#M6323</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-08-17T07:51:22Z</dc:date>
    </item>
  </channel>
</rss>

