<?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 Arcade percent total in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-percent-total/m-p/1410360#M81900</link>
    <description>&lt;P&gt;Based on the sample data below I am trying to calculate the percentage&amp;nbsp;&lt;/P&gt;&lt;P&gt;(number / sum of all numbers) * 100&lt;/P&gt;&lt;P&gt;I go to calculate field and create a new field and enter the following, however I keep getting `100%` for each data point.&amp;nbsp; What am I doing wrong with the expression?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var IBPL_Total = sum($feature.data)

var IBPL_PctTotal = ($feature.data/ IBPL_Total)*100

return IBPL_PctTotal&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;data = (1, 2, 3, 4, 5, 6, 7, 8, 10)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 16 Apr 2024 16:17:16 GMT</pubDate>
    <dc:creator>Ed_</dc:creator>
    <dc:date>2024-04-16T16:17:16Z</dc:date>
    <item>
      <title>Arcade percent total</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-percent-total/m-p/1410360#M81900</link>
      <description>&lt;P&gt;Based on the sample data below I am trying to calculate the percentage&amp;nbsp;&lt;/P&gt;&lt;P&gt;(number / sum of all numbers) * 100&lt;/P&gt;&lt;P&gt;I go to calculate field and create a new field and enter the following, however I keep getting `100%` for each data point.&amp;nbsp; What am I doing wrong with the expression?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var IBPL_Total = sum($feature.data)

var IBPL_PctTotal = ($feature.data/ IBPL_Total)*100

return IBPL_PctTotal&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;data = (1, 2, 3, 4, 5, 6, 7, 8, 10)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2024 16:17:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-percent-total/m-p/1410360#M81900</guid>
      <dc:creator>Ed_</dc:creator>
      <dc:date>2024-04-16T16:17:16Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade percent total</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-percent-total/m-p/1410401#M81903</link>
      <description>&lt;P&gt;You're just getting the sum of that single feature in line 1, so its percentage would always be 100%. You have to get the sum of all the features in the dataset to calculate the percentage&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;return $feature.data/Sum($layer, 'data') * 100)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2024 16:36:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-percent-total/m-p/1410401#M81903</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-04-16T16:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade percent total</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-percent-total/m-p/1410411#M81904</link>
      <description>&lt;P&gt;Hi Ken, hope all is well and thank you for the quick response&lt;BR /&gt;&lt;BR /&gt;So based on the original feature class which has multiple columns, the following is what I wrote but I am getting null values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;return $feature.disability_ACSHHDIS/Sum($feature, 'disability_ACSHHDIS') * 100&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ed__0-1713285823677.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/101065iEF05F1A3839E39DF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ed__0-1713285823677.png" alt="Ed__0-1713285823677.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2024 16:44:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-percent-total/m-p/1410411#M81904</guid>
      <dc:creator>Ed_</dc:creator>
      <dc:date>2024-04-16T16:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade percent total</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-percent-total/m-p/1410427#M81905</link>
      <description>&lt;P&gt;Ooops, I tested it on a popup, not the field calculator. You have to get the layer from the &lt;A href="https://developers.arcgis.com/arcade/profiles/field-calculation/#profile-variables" target="_self"&gt;$datastore&lt;/A&gt; variable, not the $layer variable.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var fs = FeatureSetByName($datastore,'your layer name')
return $feature.disability_ACSHHDIS/Sum(fs, 'disability_ACSHHDIS') * 100&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2024 16:57:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-percent-total/m-p/1410427#M81905</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-04-16T16:57:01Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade percent total</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-percent-total/m-p/1410430#M81906</link>
      <description>&lt;P&gt;Yup that worked like a charm sir cheers&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2024 16:59:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-percent-total/m-p/1410430#M81906</guid>
      <dc:creator>Ed_</dc:creator>
      <dc:date>2024-04-16T16:59:45Z</dc:date>
    </item>
  </channel>
</rss>

