<?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 Help with FeatureSetByPortal function to compare 2 layers - return info from 1 layer not in another in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/help-with-featuresetbyportal-function-to-compare-2/m-p/1554950#M10451</link>
    <description>&lt;P&gt;Need a little help getting my expression to work for dashboard list.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I am trying to compare 2 layers - 1 has all locations and 1 enroute locations.&amp;nbsp; I want my list to display locations from all locations layer that are NOT in enroute locations layer.&amp;nbsp; Am I on the right track?&amp;nbsp; I had to comment out the line with Unique since that function isn't available. In theory, I shouldn't need but if user sends a duplicate survey in, there might be duplicates. I would want to evaluate the earliest timestamp.&amp;nbsp; Also, the enroute_date is stored as a date/time. I only care about comparing the date.&amp;nbsp; Would this be correct instead:&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;var&lt;/SPAN&gt; today = &lt;SPAN class=""&gt;new&lt;/SPAN&gt; &lt;SPAN class=""&gt;Date&lt;/SPAN&gt;();&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;SPAN class=""&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; dateString = today.&lt;/SPAN&gt;&lt;SPAN class=""&gt;toISOString&lt;/SPAN&gt;&lt;SPAN&gt;().&lt;/SPAN&gt;&lt;SPAN class=""&gt;split&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;'T'&lt;/SPAN&gt;&lt;SPAN&gt;)[&lt;/SPAN&gt;&lt;SPAN class=""&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;];&amp;nbsp; // will this work to get date only?&amp;nbsp; if so, how to compare to the date in enroute_date?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;var today = Date(); // Get current date as a string - includes timestamp&lt;/P&gt;&lt;P&gt;// Define the portal&lt;BR /&gt;var portal = Portal('&lt;A href="https://gis-portal.xyz.gov/arcgis" target="_blank" rel="noopener"&gt;https://gis-portal.xyz.gov/arcgis&lt;/A&gt;');&lt;/P&gt;&lt;P&gt;// Access the Vote_Center_Status layer- try vcloc instead of location_id&lt;BR /&gt;var voteCenters = featureSetByPortalItem(portal, '62f125f3eeb441afbf197128740d6fc6', 0, ['enroute_date', 'vcloc'], false);&lt;/P&gt;&lt;P&gt;// Access the VC_All layer- try loc_id, vc_site instead of location_id&lt;BR /&gt;var allVoteCenters = featureSetByPortalItem(portal, '7ca0a09aac254fe88467bb59b5d7a184', 0, ['loc_id', 'vc_site'], false);&lt;/P&gt;&lt;P&gt;// Filter Vote_Center_Status for locations that are enroute today&lt;BR /&gt;var enrouteCenters = Filter(voteCenters, 'enroute_date = @today');&lt;/P&gt;&lt;P&gt;// Extract IDs or locations from the filtered vote center status&lt;BR /&gt;var enrouteIDs = Unique(enrouteCenters, 'vcloc');&lt;/P&gt;&lt;P&gt;// Filter vc_all to get locations that are NOT en route – try loc_id instead of location_id&lt;BR /&gt;var notEnroute = Filter(allVoteCenters, 'NOT(loc_id IN @enrouteCenters)');&lt;/P&gt;&lt;P&gt;// Return the result&lt;BR /&gt;return notEnroute;&lt;/P&gt;&lt;P&gt;Testing returns this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LSSD_0-1730595356608.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/118722i4A741FCBA562BEE5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LSSD_0-1730595356608.png" alt="LSSD_0-1730595356608.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;When I save and go back a screen, I see the error that it's unable to execute Arcade script:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LSSD_1-1730595392751.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/118723i1E168B2EC1823506/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LSSD_1-1730595392751.png" alt="LSSD_1-1730595392751.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I want to be able to display the {vc_site} and {loc_id} that is returned.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thank you in advance for any help on this. Need to get working asap (of course).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 03 Nov 2024 18:01:04 GMT</pubDate>
    <dc:creator>LS-SD</dc:creator>
    <dc:date>2024-11-03T18:01:04Z</dc:date>
    <item>
      <title>Help with FeatureSetByPortal function to compare 2 layers - return info from 1 layer not in another</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/help-with-featuresetbyportal-function-to-compare-2/m-p/1554950#M10451</link>
      <description>&lt;P&gt;Need a little help getting my expression to work for dashboard list.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I am trying to compare 2 layers - 1 has all locations and 1 enroute locations.&amp;nbsp; I want my list to display locations from all locations layer that are NOT in enroute locations layer.&amp;nbsp; Am I on the right track?&amp;nbsp; I had to comment out the line with Unique since that function isn't available. In theory, I shouldn't need but if user sends a duplicate survey in, there might be duplicates. I would want to evaluate the earliest timestamp.&amp;nbsp; Also, the enroute_date is stored as a date/time. I only care about comparing the date.&amp;nbsp; Would this be correct instead:&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;var&lt;/SPAN&gt; today = &lt;SPAN class=""&gt;new&lt;/SPAN&gt; &lt;SPAN class=""&gt;Date&lt;/SPAN&gt;();&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;SPAN class=""&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; dateString = today.&lt;/SPAN&gt;&lt;SPAN class=""&gt;toISOString&lt;/SPAN&gt;&lt;SPAN&gt;().&lt;/SPAN&gt;&lt;SPAN class=""&gt;split&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;'T'&lt;/SPAN&gt;&lt;SPAN&gt;)[&lt;/SPAN&gt;&lt;SPAN class=""&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;];&amp;nbsp; // will this work to get date only?&amp;nbsp; if so, how to compare to the date in enroute_date?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;var today = Date(); // Get current date as a string - includes timestamp&lt;/P&gt;&lt;P&gt;// Define the portal&lt;BR /&gt;var portal = Portal('&lt;A href="https://gis-portal.xyz.gov/arcgis" target="_blank" rel="noopener"&gt;https://gis-portal.xyz.gov/arcgis&lt;/A&gt;');&lt;/P&gt;&lt;P&gt;// Access the Vote_Center_Status layer- try vcloc instead of location_id&lt;BR /&gt;var voteCenters = featureSetByPortalItem(portal, '62f125f3eeb441afbf197128740d6fc6', 0, ['enroute_date', 'vcloc'], false);&lt;/P&gt;&lt;P&gt;// Access the VC_All layer- try loc_id, vc_site instead of location_id&lt;BR /&gt;var allVoteCenters = featureSetByPortalItem(portal, '7ca0a09aac254fe88467bb59b5d7a184', 0, ['loc_id', 'vc_site'], false);&lt;/P&gt;&lt;P&gt;// Filter Vote_Center_Status for locations that are enroute today&lt;BR /&gt;var enrouteCenters = Filter(voteCenters, 'enroute_date = @today');&lt;/P&gt;&lt;P&gt;// Extract IDs or locations from the filtered vote center status&lt;BR /&gt;var enrouteIDs = Unique(enrouteCenters, 'vcloc');&lt;/P&gt;&lt;P&gt;// Filter vc_all to get locations that are NOT en route – try loc_id instead of location_id&lt;BR /&gt;var notEnroute = Filter(allVoteCenters, 'NOT(loc_id IN @enrouteCenters)');&lt;/P&gt;&lt;P&gt;// Return the result&lt;BR /&gt;return notEnroute;&lt;/P&gt;&lt;P&gt;Testing returns this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LSSD_0-1730595356608.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/118722i4A741FCBA562BEE5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LSSD_0-1730595356608.png" alt="LSSD_0-1730595356608.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;When I save and go back a screen, I see the error that it's unable to execute Arcade script:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="LSSD_1-1730595392751.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/118723i1E168B2EC1823506/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LSSD_1-1730595392751.png" alt="LSSD_1-1730595392751.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I want to be able to display the {vc_site} and {loc_id} that is returned.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thank you in advance for any help on this. Need to get working asap (of course).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Nov 2024 18:01:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/help-with-featuresetbyportal-function-to-compare-2/m-p/1554950#M10451</guid>
      <dc:creator>LS-SD</dc:creator>
      <dc:date>2024-11-03T18:01:04Z</dc:date>
    </item>
  </channel>
</rss>

