<?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: Division operator not working in Arcade Expression in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/division-operator-not-working-in-arcade-expression/m-p/1596202#M10899</link>
    <description>&lt;P&gt;Thanks for reply, Cody.&amp;nbsp; I pasted that in and I still got this:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Test execution error: Expected "!=", ")", "*", "+", ",", "-", "/", "&amp;lt;", "&amp;lt;=", "&amp;lt;&amp;gt;", "=", "&amp;gt;", "&amp;gt;=", "AND", "BETWEEN", "IN", "IS", "LIKE", "NOT", "OR", "||", or [ \t\n\r] but "&amp;amp;" found.. Verify test data.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So I actually ran a filter at the feature set definition and that fixed my original expression.&amp;nbsp; The insight on the null or 0 values was a huge help though.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Mar 2025 16:47:55 GMT</pubDate>
    <dc:creator>ScottFortman1</dc:creator>
    <dc:date>2025-03-17T16:47:55Z</dc:date>
    <item>
      <title>Division operator not working in Arcade Expression</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/division-operator-not-working-in-arcade-expression/m-p/1596141#M10897</link>
      <description>&lt;P&gt;Hi there community!&lt;/P&gt;&lt;P&gt;I am really hoping for some help on this, it is driving me mad!&amp;nbsp; I have an Arcade script being used in an indicator widget in a dashboard on10.9.1 Portal and works great.&amp;nbsp; I am migrating same dashboard and widget to 11.3.1.&amp;nbsp; I copied the original script to new dashboard, changed the Portal location, service id, layer id, and the fields I pull in are identical.&amp;nbsp; The script is just doing a Groupby function to create a table with a handful of existing fields plus two new fields that are calculated.&amp;nbsp; The first one is using a multiply math operator and works fine.&amp;nbsp; The second expression is using division and I get a "Test execution error: Unknown Error. Verify test data.&lt;/P&gt;&lt;P&gt;I have commented out the second expression and the script works, so I know it is good up to there.&amp;nbsp; If I change the division operator to addition, subtraction, or multiplication, it also works, just not the value I need.&lt;/P&gt;&lt;P&gt;Any help or thoughts are greatly appreciated, Thanks!&lt;/P&gt;&lt;P&gt;Script where second expression doesn't work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var tvwdportal = Portal('https://acadia.tvwd.org/portal')
var flush = FeatureSetByPortalItem(tvwdportal,"4159ad26944145339b8ae97ea484c331",70,['Duration', 'EstimatedFlushTime', 'Turbidity','StartTime', 'StopTime','assetid'],true)
 
groupby(
    flush,
    ["StopTime", "assetid", "Turbidity","EstimatedFlushTime", "Duration",
        
    ],
    [
    {name:'EstimatedTimex2', expression: 'EstimatedFlushTime * 2', statistic: 'MAX'},    
    {name: 'PipeVolumeTurnover', expression: 'Duration / EstimatedFlushTime', statistic: 'SUM'} 
        ]
        )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;Script and table if I change operator on second expression (Line11)&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var tvwdportal = Portal('https://acadia.tvwd.org/portal')
var flush = FeatureSetByPortalItem(tvwdportal,"4159ad26944145339b8ae97ea484c331",70,['Duration', 'EstimatedFlushTime', 'Turbidity','StartTime', 'StopTime','assetid'],true)
 
groupby(
    flush,
    ["StopTime", "assetid", "Turbidity","EstimatedFlushTime", "Duration",
        
    ],
    [
    {name:'EstimatedTimex2', expression: 'EstimatedFlushTime * 2', statistic: 'MAX'},    
    {name: 'PipeVolumeTurnover', expression: 'Duration * EstimatedFlushTime', statistic: 'SUM'} 
        ]
        )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;StopTime assetid Turbidity EstimatedFlushTime Duration EstimatedTimex2 PipeVolumeTurnover ROW__ID&lt;/P&gt;&lt;TABLE border="1" width="101.85889311364598%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="11.11111111111111%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="9.125475285171103%"&gt;&lt;SPAN class=""&gt;null&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="14.82889733840304%"&gt;&lt;SPAN class=""&gt;"FLSH105902"&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="9.252217997465145%"&gt;&lt;SPAN class=""&gt;null&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="13.561470215462613%"&gt;&lt;SPAN class=""&gt;null&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="9.125475285171103%"&gt;&lt;SPAN class=""&gt;null&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="11.153358681875792%"&gt;&lt;SPAN class=""&gt;null&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="13.561470215462613%"&gt;&lt;SPAN class=""&gt;null&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="10.139416983523446%"&gt;&lt;SPAN class=""&gt;149875&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="11.11111111111111%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="9.125475285171103%"&gt;&lt;SPAN class=""&gt;null&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="14.82889733840304%"&gt;&lt;SPAN class=""&gt;"FLSH105911"&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="9.252217997465145%"&gt;&lt;SPAN class=""&gt;1&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="13.561470215462613%"&gt;&lt;SPAN class=""&gt;21.90297563&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="9.125475285171103%"&gt;&lt;SPAN class=""&gt;60&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="11.153358681875792%"&gt;&lt;SPAN class=""&gt;43.805951&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="13.561470215462613%"&gt;&lt;SPAN class=""&gt;1314.178538&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="10.139416983523446%"&gt;&lt;SPAN class=""&gt;150675&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="11.11111111111111%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="9.125475285171103%"&gt;&lt;SPAN class=""&gt;null&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="14.82889733840304%"&gt;&lt;SPAN class=""&gt;"FLSH105985"&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="9.252217997465145%"&gt;&lt;SPAN class=""&gt;1.54&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="13.561470215462613%"&gt;&lt;SPAN class=""&gt;4.23492962&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="9.125475285171103%"&gt;&lt;SPAN class=""&gt;30&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="11.153358681875792%"&gt;&lt;SPAN class=""&gt;8.469859&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="13.561470215462613%"&gt;&lt;SPAN class=""&gt;127.047889&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="10.139416983523446%"&gt;&lt;SPAN class=""&gt;159472&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="11.11111111111111%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="9.125475285171103%"&gt;&lt;SPAN class=""&gt;null&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="14.82889733840304%"&gt;&lt;SPAN class=""&gt;"FLSH105987"&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="9.252217997465145%"&gt;&lt;SPAN class=""&gt;null&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="13.561470215462613%"&gt;&lt;SPAN class=""&gt;null&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="9.125475285171103%"&gt;&lt;SPAN class=""&gt;null&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="11.153358681875792%"&gt;&lt;SPAN class=""&gt;null&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="13.561470215462613%"&gt;&lt;SPAN class=""&gt;null&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="10.139416983523446%"&gt;&lt;SPAN class=""&gt;159872&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="11.11111111111111%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="9.125475285171103%"&gt;&lt;SPAN class=""&gt;null&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="14.82889733840304%"&gt;&lt;SPAN class=""&gt;"FLSH106037"&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="9.252217997465145%"&gt;&lt;SPAN class=""&gt;null&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="13.561470215462613%"&gt;&lt;SPAN class=""&gt;null&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="9.125475285171103%"&gt;&lt;SPAN class=""&gt;null&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="11.153358681875792%"&gt;&lt;SPAN class=""&gt;null&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="13.561470215462613%"&gt;&lt;SPAN class=""&gt;null&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="10.139416983523446%"&gt;&lt;SPAN class=""&gt;165475&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="11.11111111111111%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="9.125475285171103%"&gt;&lt;SPAN class=""&gt;null&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="14.82889733840304%"&gt;&lt;SPAN class=""&gt;"FLSH106067"&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="9.252217997465145%"&gt;&lt;SPAN class=""&gt;null&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="13.561470215462613%"&gt;&lt;SPAN class=""&gt;null&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="9.125475285171103%"&gt;&lt;SPAN class=""&gt;null&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="11.153358681875792%"&gt;&lt;SPAN class=""&gt;null&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="13.561470215462613%"&gt;&lt;SPAN class=""&gt;null&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="10.139416983523446%"&gt;&lt;SPAN class=""&gt;167875&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="11.11111111111111%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="9.125475285171103%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="14.82889733840304%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="9.252217997465145%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="13.561470215462613%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="9.125475285171103%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="11.153358681875792%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="13.561470215462613%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="10.139416983523446%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="11.11111111111111%"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Mon, 17 Mar 2025 15:50:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/division-operator-not-working-in-arcade-expression/m-p/1596141#M10897</guid>
      <dc:creator>ScottFortman1</dc:creator>
      <dc:date>2025-03-17T15:50:37Z</dc:date>
    </item>
    <item>
      <title>Re: Division operator not working in Arcade Expression</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/division-operator-not-working-in-arcade-expression/m-p/1596152#M10898</link>
      <description>&lt;P&gt;Hey &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/291958"&gt;@ScottFortman1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This usually happens if there's a chance that the value could be NULL or 0, which cannot be calculated, use this here instead:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{name: 'PipeVolumeTurnover', expression: 'IIF(!IsEmpty(EstimatedFlushTime) &amp;amp;&amp;amp; EstimatedFlushTime &amp;gt; 0, Duration / EstimatedFlushTime, 0)', statistic: 'SUM'}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it's greater than 0, it should work out for you! Edited for null avoidance too.&lt;/P&gt;&lt;P&gt;Cody&lt;/P&gt;</description>
      <pubDate>Mon, 17 Mar 2025 15:59:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/division-operator-not-working-in-arcade-expression/m-p/1596152#M10898</guid>
      <dc:creator>CodyPatterson</dc:creator>
      <dc:date>2025-03-17T15:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: Division operator not working in Arcade Expression</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/division-operator-not-working-in-arcade-expression/m-p/1596202#M10899</link>
      <description>&lt;P&gt;Thanks for reply, Cody.&amp;nbsp; I pasted that in and I still got this:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Test execution error: Expected "!=", ")", "*", "+", ",", "-", "/", "&amp;lt;", "&amp;lt;=", "&amp;lt;&amp;gt;", "=", "&amp;gt;", "&amp;gt;=", "AND", "BETWEEN", "IN", "IS", "LIKE", "NOT", "OR", "||", or [ \t\n\r] but "&amp;amp;" found.. Verify test data.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So I actually ran a filter at the feature set definition and that fixed my original expression.&amp;nbsp; The insight on the null or 0 values was a huge help though.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Mar 2025 16:47:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/division-operator-not-working-in-arcade-expression/m-p/1596202#M10899</guid>
      <dc:creator>ScottFortman1</dc:creator>
      <dc:date>2025-03-17T16:47:55Z</dc:date>
    </item>
    <item>
      <title>Re: Division operator not working in Arcade Expression</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/division-operator-not-working-in-arcade-expression/m-p/1596210#M10900</link>
      <description>&lt;P&gt;Hey &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/291958"&gt;@ScottFortman1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Great to hear you got it! So strange that || works but &amp;amp;&amp;amp; doesn't just how Arcade and JavaScript differ! Here's a corrected one from the above, even though you got it all checked out:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;IIF(!IsEmpty(EstimatedFlushTime) AND EstimatedFlushTime &amp;gt; 0, Duration / EstimatedFlushTime, 0)&lt;/LI-CODE&gt;&lt;P&gt;Cody&lt;/P&gt;</description>
      <pubDate>Mon, 17 Mar 2025 17:03:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/division-operator-not-working-in-arcade-expression/m-p/1596210#M10900</guid>
      <dc:creator>CodyPatterson</dc:creator>
      <dc:date>2025-03-17T17:03:27Z</dc:date>
    </item>
  </channel>
</rss>

