<?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 Compare a value from FeatureSetByName Column w/ $feature column in Attribute Rules Questions</title>
    <link>https://community.esri.com/t5/attribute-rules-questions/compare-a-value-from-featuresetbyname-column-w/m-p/1337744#M1140</link>
    <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to flag any rows that contain a value greater than a column value from a different table.&amp;nbsp; Based on the code below, I am having an issue referring to the MLENGTH field.&amp;nbsp; It says a Dictionary Type is expected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var lrsRoute = FeatureSetByName($datastore, 'RH_LRS_Routes', ['ROUTEID', 'MLENGTH'], false)
var routeID = $feature.ROUTEID

var beg_mi = $feature.BEG_MI
var end_mi = $feature.END_MI
var maxMileage = Max([beg_mi, end_mi])

var routeFilter = Filter(lrsRoute, "ROUTEID = @routeID")

IIF(maxMileage &amp;lt; routeFilter.MLENGTH, True, False)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 13 Oct 2023 14:55:46 GMT</pubDate>
    <dc:creator>ColtonSnelling1</dc:creator>
    <dc:date>2023-10-13T14:55:46Z</dc:date>
    <item>
      <title>Compare a value from FeatureSetByName Column w/ $feature column</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/compare-a-value-from-featuresetbyname-column-w/m-p/1337744#M1140</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to flag any rows that contain a value greater than a column value from a different table.&amp;nbsp; Based on the code below, I am having an issue referring to the MLENGTH field.&amp;nbsp; It says a Dictionary Type is expected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var lrsRoute = FeatureSetByName($datastore, 'RH_LRS_Routes', ['ROUTEID', 'MLENGTH'], false)
var routeID = $feature.ROUTEID

var beg_mi = $feature.BEG_MI
var end_mi = $feature.END_MI
var maxMileage = Max([beg_mi, end_mi])

var routeFilter = Filter(lrsRoute, "ROUTEID = @routeID")

IIF(maxMileage &amp;lt; routeFilter.MLENGTH, True, False)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2023 14:55:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/compare-a-value-from-featuresetbyname-column-w/m-p/1337744#M1140</guid>
      <dc:creator>ColtonSnelling1</dc:creator>
      <dc:date>2023-10-13T14:55:46Z</dc:date>
    </item>
    <item>
      <title>Re: Compare a value from FeatureSetByName Column w/ $feature column</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/compare-a-value-from-featuresetbyname-column-w/m-p/1337757#M1141</link>
      <description>&lt;P&gt;Filter returns a FeatureSet and you need the first feature in that set for your IFF function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var routeFilter = First(Filter(lrsRoute, "ROUTEID = @routeID"));&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2023 15:11:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/compare-a-value-from-featuresetbyname-column-w/m-p/1337757#M1141</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2023-10-13T15:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: Compare a value from FeatureSetByName Column w/ $feature column</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/compare-a-value-from-featuresetbyname-column-w/m-p/1337865#M1142</link>
      <description>&lt;P&gt;Not sure if I 100% understand what you are trying to achieve (the filter function does not make sense to me) - I assume your end goal is to have either the value&amp;nbsp;&lt;EM&gt;True&amp;nbsp;&lt;/EM&gt;or&amp;nbsp;&lt;EM&gt;False&lt;/EM&gt; written to your feature's attribute table. If so, I think your expression needs to look something more like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;var lrsRoute = FeatureSetByName($datastore, 'RH_LRS_Routes', ['ROUTEID', 'MLENGTH'], false);
var maxMileage=Max($feature.BEG_MI ,$feature.END_MI);
var routeFilter = Filter(lrsRoute, "ROUTEID = @routeID");

for (var Route in routeFilter){
If (maxMileage &amp;lt; $feature.MLENGHT){
return ‘True’}
Else {
Return ‘False’}}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2023 17:55:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/compare-a-value-from-featuresetbyname-column-w/m-p/1337865#M1142</guid>
      <dc:creator>SarahRijneke</dc:creator>
      <dc:date>2023-10-13T17:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: Compare a value from FeatureSetByName Column w/ $feature column</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/compare-a-value-from-featuresetbyname-column-w/m-p/1337898#M1143</link>
      <description>&lt;P&gt;So the lrsRoute table is a live table that gets updated frequently.&amp;nbsp; It has a RouteID field and the Mlength value that I am trying to check against.&lt;/P&gt;&lt;P&gt;The $feature table that is grabbing BEG_MI and END_MI and ROUTEID is what I am actually trying to check.&amp;nbsp; If the maxMileage is greater than the Mlength field from the lrsRoute table, flag it as an error.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2023 18:57:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/compare-a-value-from-featuresetbyname-column-w/m-p/1337898#M1143</guid>
      <dc:creator>ColtonSnelling1</dc:creator>
      <dc:date>2023-10-13T18:57:32Z</dc:date>
    </item>
    <item>
      <title>Re: Compare a value from FeatureSetByName Column w/ $feature column</title>
      <link>https://community.esri.com/t5/attribute-rules-questions/compare-a-value-from-featuresetbyname-column-w/m-p/1337911#M1144</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;var lrsRoute = FeatureSetByName($datastore, 'RH_LRS_Routes', ['ROUTEID', 'MLENGTH'], false);
for (var row in lrsRoute){
var id = row.ROUTEID
var filteredRow = Filter($feature, “routeID = @id”)
for (var feat in FilteredRow){
var maxMileage=Max(feat.BEG_MI ,feat.END_MI);
If (maxMileage &amp;lt; feat.MLENGHT){
return “True”}
else{
return “False”}
}}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2023 19:40:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/attribute-rules-questions/compare-a-value-from-featuresetbyname-column-w/m-p/1337911#M1144</guid>
      <dc:creator>SarahRijneke</dc:creator>
      <dc:date>2023-10-13T19:40:10Z</dc:date>
    </item>
  </channel>
</rss>

