<?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: Invalid Where clause - Left function - Expression Builder - Arcade - Attribute Rule in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/invalid-where-clause-left-function-expression/m-p/1516179#M7162</link>
    <description>&lt;P&gt;Still the same error.&lt;/P&gt;</description>
    <pubDate>Wed, 07 Aug 2024 16:02:58 GMT</pubDate>
    <dc:creator>hw_mwf</dc:creator>
    <dc:date>2024-08-07T16:02:58Z</dc:date>
    <item>
      <title>Invalid Where clause - Left function - Expression Builder - Arcade - Attribute Rule</title>
      <link>https://community.esri.com/t5/developers-questions/invalid-where-clause-left-function-expression/m-p/1516115#M7156</link>
      <description>&lt;P&gt;Trying to create an attribute rule (immediate calculation rule) on a feature class within an Enterprise Geodatabase in Oracle (.sde) within ArcGIS Pro 2.9.5. I want to filter to improve performance. Specifically, selecting only records when the first five characters of the UNITID text field equal the WINDEX text field. I am starting with the following two lines of Arcade code in the Expression Builder and when I click the green Verify check mark, its says 'Expression is valid'.&lt;/P&gt;&lt;P&gt;var cur_unitid = Filter(FeatureSetByName($datastore, "WSL", ['UNITID'], false), 'Left(UNITID, 5) == $feature.WINDEX');&lt;BR /&gt;var cur_unitid_desc = OrderBy(cur_unitid, 'UNITID DESC');&lt;/P&gt;&lt;P&gt;However, when I add the following third line of code and click the green Verify check mark, it says 'Invalid expression. Error on line 3. Invalid where clause (Left(UNITID, 5) == $feature.WINDEX)'.&lt;/P&gt;&lt;P&gt;var cur_unitid_max = first(cur_unitid_desc);&lt;/P&gt;&lt;P&gt;Can the Left function be used on a feature class field name and/or is there an error in how I am using it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 14:38:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/invalid-where-clause-left-function-expression/m-p/1516115#M7156</guid>
      <dc:creator>hw_mwf</dc:creator>
      <dc:date>2024-08-07T14:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Where clause - Left function - Expression Builder - Arcade - Attribute Rule</title>
      <link>https://community.esri.com/t5/developers-questions/invalid-where-clause-left-function-expression/m-p/1516132#M7157</link>
      <description>&lt;P&gt;Your sql expression is invalid, since it doesn't understand Arcade syntax (including variables such as $feature). You can only use SQL92 syntax. An expression like this should work&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var value = $feature.WINDEX;
var cur_unitid = Filter(FeatureSetByName($datastore, "WSL", ['UNITID'], false), "Substring(UNITID, 1, 5) = @value");
var cur_unitid_desc = OrderBy(cur_unitid, 'UNITID DESC');
var cur_unitid_max = first(cur_unitid_desc);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 14:59:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/invalid-where-clause-left-function-expression/m-p/1516132#M7157</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-08-07T14:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Where clause - Left function - Expression Builder - Arcade - Attribute Rule</title>
      <link>https://community.esri.com/t5/developers-questions/invalid-where-clause-left-function-expression/m-p/1516152#M7158</link>
      <description>&lt;P&gt;Thanks for the reply. The first 3 lines of your code yield 'Expression is valid', however the 4th line yields the error 'Invalid expression. Error on line 4. General evaluation error'.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 15:22:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/invalid-where-clause-left-function-expression/m-p/1516152#M7158</guid>
      <dc:creator>hw_mwf</dc:creator>
      <dc:date>2024-08-07T15:22:04Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Where clause - Left function - Expression Builder - Arcade - Attribute Rule</title>
      <link>https://community.esri.com/t5/developers-questions/invalid-where-clause-left-function-expression/m-p/1516162#M7159</link>
      <description>&lt;P&gt;Have you tried completing the rule, adding in what you want to return?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 15:33:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/invalid-where-clause-left-function-expression/m-p/1516162#M7159</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-08-07T15:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Where clause - Left function - Expression Builder - Arcade - Attribute Rule</title>
      <link>https://community.esri.com/t5/developers-questions/invalid-where-clause-left-function-expression/m-p/1516172#M7160</link>
      <description>&lt;P&gt;I added the below as the 5th line, and the error remains (&lt;SPAN&gt;Error on line 4. General evaluation error).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;return cur_unitid_max.UNITID;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 15:43:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/invalid-where-clause-left-function-expression/m-p/1516172#M7160</guid>
      <dc:creator>hw_mwf</dc:creator>
      <dc:date>2024-08-07T15:43:43Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Where clause - Left function - Expression Builder - Arcade - Attribute Rule</title>
      <link>https://community.esri.com/t5/developers-questions/invalid-where-clause-left-function-expression/m-p/1516176#M7161</link>
      <description>&lt;P&gt;What happens with this code? I know it's not giving the maximum record, but it's just testing out the filtered result.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var value = $feature.WINDEX;
var cur_unitid = Filter(FeatureSetByName($datastore, "WSL", ['UNITID'], false), "Substring(UNITID, 1, 5) = @value");
//var cur_unitid_desc = OrderBy(cur_unitid, 'UNITID DESC');
var cur_unitid_max = First(cur_unitid);
return cur_unitid_max.UNITID;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 15:57:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/invalid-where-clause-left-function-expression/m-p/1516176#M7161</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-08-07T15:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Where clause - Left function - Expression Builder - Arcade - Attribute Rule</title>
      <link>https://community.esri.com/t5/developers-questions/invalid-where-clause-left-function-expression/m-p/1516179#M7162</link>
      <description>&lt;P&gt;Still the same error.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 16:02:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/invalid-where-clause-left-function-expression/m-p/1516179#M7162</guid>
      <dc:creator>hw_mwf</dc:creator>
      <dc:date>2024-08-07T16:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Where clause - Left function - Expression Builder - Arcade - Attribute Rule</title>
      <link>https://community.esri.com/t5/developers-questions/invalid-where-clause-left-function-expression/m-p/1516182#M7163</link>
      <description>&lt;P&gt;Let's check whether you're getting anything back from the Filter&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var value = $feature.WINDEX;
var cur_unitid = Filter(FeatureSetByName($datastore, "WSL", ['UNITID'], false), "Substring(UNITID, 1, 5) = @value");
return Count(cur_unitid);&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 07 Aug 2024 16:09:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/invalid-where-clause-left-function-expression/m-p/1516182#M7163</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-08-07T16:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Where clause - Left function - Expression Builder - Arcade - Attribute Rule</title>
      <link>https://community.esri.com/t5/developers-questions/invalid-where-clause-left-function-expression/m-p/1516223#M7164</link>
      <description>&lt;P&gt;This is now the error 'Invalid expression. Error on line 3. Failed to query statistics.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 17:08:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/invalid-where-clause-left-function-expression/m-p/1516223#M7164</guid>
      <dc:creator>hw_mwf</dc:creator>
      <dc:date>2024-08-07T17:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Where clause - Left function - Expression Builder - Arcade - Attribute Rule</title>
      <link>https://community.esri.com/t5/developers-questions/invalid-where-clause-left-function-expression/m-p/1516267#M7168</link>
      <description>&lt;P&gt;The testing I've done in the &lt;A href="https://developers.arcgis.com/arcade/playground/" target="_self"&gt;Playground&lt;/A&gt; using the example public portal item has worked correctly.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Snag_157b5bf.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/111861iD3B3BCD2FE6161A4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Snag_157b5bf.png" alt="Snag_157b5bf.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Are you sure you have the correct information for the FeatureSetByName function? What happens with this code?&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var cur_unitid = FeatureSetByName($datastore, "WSL", ['UNITID'], false);
return Count(cur_unitid);&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 07 Aug 2024 18:11:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/invalid-where-clause-left-function-expression/m-p/1516267#M7168</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-08-07T18:11:54Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Where clause - Left function - Expression Builder - Arcade - Attribute Rule</title>
      <link>https://community.esri.com/t5/developers-questions/invalid-where-clause-left-function-expression/m-p/1516276#M7169</link>
      <description>&lt;P&gt;So that code does verify to &lt;SPAN&gt;'Expression is valid'. But when I go back to adding in a filter it still errors.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I know the first record's UNITID is HC58W017. If I try this code:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;var value = "HC58W0187";&lt;BR /&gt;var cur_unitid = Filter(FeatureSetByName($datastore, "WSL", ['UNITID'], false), "Substring(UNITID, 1, 5) = @value");&lt;BR /&gt;return Count(cur_unitid);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It says 'Failed to query statistics'. If I try this code:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;var value = "HC58W0187";&lt;BR /&gt;var cur_unitid = Filter(FeatureSetByName($datastore, "WSL", ['UNITID'], false), "@value");&lt;BR /&gt;return Count(cur_unitid);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It says 'Invalid where clause ('HC58W0187')'&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 18:31:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/invalid-where-clause-left-function-expression/m-p/1516276#M7169</guid>
      <dc:creator>hw_mwf</dc:creator>
      <dc:date>2024-08-07T18:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Where clause - Left function - Expression Builder - Arcade - Attribute Rule</title>
      <link>https://community.esri.com/t5/developers-questions/invalid-where-clause-left-function-expression/m-p/1516286#M7170</link>
      <description>&lt;P&gt;It won't filter correctly since the variable value has to be five characters long. Try this instead&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var value = Left($feature.WINDEX, 5);
var cur_unitid = Filter(FeatureSetByName($datastore, "WSL", ['UNITID'], false), "Substring(UNITID, 1, 5) = @value");&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 18:42:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/invalid-where-clause-left-function-expression/m-p/1516286#M7170</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-08-07T18:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Where clause - Left function - Expression Builder - Arcade - Attribute Rule</title>
      <link>https://community.esri.com/t5/developers-questions/invalid-where-clause-left-function-expression/m-p/1516293#M7171</link>
      <description>&lt;P&gt;So just those two lines; '&lt;SPAN&gt;Expression is valid'.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;But when I add this 3rd line, I get 'Error on 3rd line. Failed to query statistics'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;return Count(cur_unitid);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Or if I don't add the 3rd line and use the first function on the 2nd line, the error is 'General evaluation error':&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;var value = Left($feature.WINDEX, 5);&lt;BR /&gt;var cur_unitid = First(Filter(FeatureSetByName($datastore, "WSL", ['UNITID'], false), "Substring(UNITID, 1, 5) = @value"));&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 18:54:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/invalid-where-clause-left-function-expression/m-p/1516293#M7171</guid>
      <dc:creator>hw_mwf</dc:creator>
      <dc:date>2024-08-07T18:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Where clause - Left function - Expression Builder - Arcade - Attribute Rule</title>
      <link>https://community.esri.com/t5/developers-questions/invalid-where-clause-left-function-expression/m-p/1516297#M7172</link>
      <description>&lt;P&gt;What is the value of $feature.WINDEX?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 19:06:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/invalid-where-clause-left-function-expression/m-p/1516297#M7172</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-08-07T19:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Where clause - Left function - Expression Builder - Arcade - Attribute Rule</title>
      <link>https://community.esri.com/t5/developers-questions/invalid-where-clause-left-function-expression/m-p/1516299#M7173</link>
      <description>&lt;P&gt;HC58W&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 19:16:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/invalid-where-clause-left-function-expression/m-p/1516299#M7173</guid>
      <dc:creator>hw_mwf</dc:creator>
      <dc:date>2024-08-07T19:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Where clause - Left function - Expression Builder - Arcade - Attribute Rule</title>
      <link>https://community.esri.com/t5/developers-questions/invalid-where-clause-left-function-expression/m-p/1516313#M7174</link>
      <description>&lt;P&gt;Honestly, I'm stumped on this. I don't have access to a dataset on Oracle, so I can't do further testing to see how the syntax may be different..&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2024 19:28:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/invalid-where-clause-left-function-expression/m-p/1516313#M7174</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2024-08-07T19:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Where clause - Left function - Expression Builder - Arcade - Attribute Rule</title>
      <link>https://community.esri.com/t5/developers-questions/invalid-where-clause-left-function-expression/m-p/1517651#M7193</link>
      <description>&lt;P&gt;Agreed. The code works when the feature class is in a .gdb but not in a .sde. Specifically, the First function fails with a 'General evaluation error'. You did solve my initial problem (use a Substring function instead of Left), so I'll 'Accept as Solution' and repost this additional issue if I cannot figure it out. Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 18:45:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/invalid-where-clause-left-function-expression/m-p/1517651#M7193</guid>
      <dc:creator>hw_mwf</dc:creator>
      <dc:date>2024-08-09T18:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Where clause - Left function - Expression Builder - Arcade - Attribute Rule</title>
      <link>https://community.esri.com/t5/developers-questions/invalid-where-clause-left-function-expression/m-p/1525951#M7209</link>
      <description>&lt;P&gt;Just to update the &lt;SPAN&gt;'General evaluation error', I have upgraded to ArcPro 3.3 and the error is now gone.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2024 17:13:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/invalid-where-clause-left-function-expression/m-p/1525951#M7209</guid>
      <dc:creator>hw_mwf</dc:creator>
      <dc:date>2024-08-22T17:13:15Z</dc:date>
    </item>
  </channel>
</rss>

