<?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 How to render a feature layer using multiple fields in the query condition? in Qt Maps SDK Questions</title>
    <link>https://community.esri.com/t5/qt-maps-sdk-questions/how-to-render-a-feature-layer-using-multiple/m-p/1183134#M4596</link>
    <description>&lt;P&gt;We are trying to use a custom renderer based on a client's requirements that the values basically operate in two tiers of value:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;If FIELD_ONE = ‘TIER 1’ AND DATE is within last 2 years then flag GREEN&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If FIELD_ONE = ‘TIER 1’ AND DATE is not within last 2 years, then flag RED&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If FIELD_ONE = ‘TIER 2’ AND DATE is within last 5 years then flag GREEN&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If FIELD_ONE = ‘TIER 2’ AND DATE is not within last 5 years, then flag RED&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;We do not have any problems calculating the last 2 or 5 years for the DATE field, so that is not an issue. The actual issue is that the Renderer(s) that are available seem to only allow the use of one field or doesn't fit our needs.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P data-unlink="true"&gt;We have tried using &lt;A href="https://developers.arcgis.com/qt/qml/api-reference/qml-esri-arcgisruntime-uniquevaluerenderer.html" target="_self"&gt;UniqueValueRenderer&lt;/A&gt;, but each date being a unique value creates problems. &lt;A href="https://developers.arcgis.com/qt/qml/api-reference/qml-esri-arcgisruntime-classbreaksrenderer.html" target="_self"&gt;ClassBreaksRenderer&lt;/A&gt; does not apply either since the fieldName property only accepts one field. The best method yet that we've found is applying an Arcade expression to the layer's symbology in Portal, and then importing it into the code via PortalItem (still in progress). We would like to know if there are ways to render the layer client-side in the application using our conditions. We looked at &lt;A href="https://developers.arcgis.com/qt/qml/api-reference/qml-esri-arcgisruntime-arcadeexpression.html" target="_self"&gt;ArcadeExpression&lt;/A&gt; type as well, but it did not look like there was a way to insert that into the Renderer&amp;nbsp;types.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 15 Jun 2022 13:56:57 GMT</pubDate>
    <dc:creator>DrewMorris</dc:creator>
    <dc:date>2022-06-15T13:56:57Z</dc:date>
    <item>
      <title>How to render a feature layer using multiple fields in the query condition?</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/how-to-render-a-feature-layer-using-multiple/m-p/1183134#M4596</link>
      <description>&lt;P&gt;We are trying to use a custom renderer based on a client's requirements that the values basically operate in two tiers of value:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;If FIELD_ONE = ‘TIER 1’ AND DATE is within last 2 years then flag GREEN&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If FIELD_ONE = ‘TIER 1’ AND DATE is not within last 2 years, then flag RED&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If FIELD_ONE = ‘TIER 2’ AND DATE is within last 5 years then flag GREEN&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If FIELD_ONE = ‘TIER 2’ AND DATE is not within last 5 years, then flag RED&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;We do not have any problems calculating the last 2 or 5 years for the DATE field, so that is not an issue. The actual issue is that the Renderer(s) that are available seem to only allow the use of one field or doesn't fit our needs.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P data-unlink="true"&gt;We have tried using &lt;A href="https://developers.arcgis.com/qt/qml/api-reference/qml-esri-arcgisruntime-uniquevaluerenderer.html" target="_self"&gt;UniqueValueRenderer&lt;/A&gt;, but each date being a unique value creates problems. &lt;A href="https://developers.arcgis.com/qt/qml/api-reference/qml-esri-arcgisruntime-classbreaksrenderer.html" target="_self"&gt;ClassBreaksRenderer&lt;/A&gt; does not apply either since the fieldName property only accepts one field. The best method yet that we've found is applying an Arcade expression to the layer's symbology in Portal, and then importing it into the code via PortalItem (still in progress). We would like to know if there are ways to render the layer client-side in the application using our conditions. We looked at &lt;A href="https://developers.arcgis.com/qt/qml/api-reference/qml-esri-arcgisruntime-arcadeexpression.html" target="_self"&gt;ArcadeExpression&lt;/A&gt; type as well, but it did not look like there was a way to insert that into the Renderer&amp;nbsp;types.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2022 13:56:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/how-to-render-a-feature-layer-using-multiple/m-p/1183134#M4596</guid>
      <dc:creator>DrewMorris</dc:creator>
      <dc:date>2022-06-15T13:56:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to render a feature layer using multiple fields in the query condition?</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/how-to-render-a-feature-layer-using-multiple/m-p/1183305#M4599</link>
      <description>&lt;P&gt;You could use the unique value renderer with an Arcade expression.&amp;nbsp; &amp;nbsp;Something like this could work for what you wrote.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var DateDifference = DateDiff(today(),$feature.created_date, "year")
var result ="";
if (($feature.FIELD_ONE == 'TIER 1')&amp;amp;&amp;amp;(DateDifference &amp;lt;= 2)) {
result = 'Green Flag';
} else if (($feature.FIELD_ONE == 'TIER 1')&amp;amp;&amp;amp;(DateDifference &amp;gt;= 2)) {
result = 'Red Flag';
}else if (($feature.FIELD_ONE == 'TIER 2')&amp;amp;&amp;amp;(DateDifference &amp;lt;= 5)) {
result = 'Green Flag';
}else if (($feature.FIELD_ONE == 'TIER 2')&amp;amp;&amp;amp;(DateDifference &amp;gt;= 5)) {
result = 'Red Flag';
}
return result;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In mapviewer choose Attributes set an Expression&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MarkBockenhauer_0-1655326101283.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/43557i2A32D515E2261623/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MarkBockenhauer_0-1655326101283.png" alt="MarkBockenhauer_0-1655326101283.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or in ArcGIS Pro&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MarkBockenhauer_1-1655326172646.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/43558iD91EE332FB05E594/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MarkBockenhauer_1-1655326172646.png" alt="MarkBockenhauer_1-1655326172646.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can set symbology for each returned result from your expression.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jun 2022 20:50:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/how-to-render-a-feature-layer-using-multiple/m-p/1183305#M4599</guid>
      <dc:creator>MarkBockenhauer</dc:creator>
      <dc:date>2022-06-15T20:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to render a feature layer using multiple fields in the query condition?</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/how-to-render-a-feature-layer-using-multiple/m-p/1183522#M4600</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2733"&gt;@MarkBockenhauer&lt;/a&gt;&amp;nbsp;, we do have an Arcade expression set up that performs the correct query just like yours, we just don't know how to implement it client-side in QML via the UniqueValueRenderer type (or any other Renderer). Is there a way to add an Arcade expression to a Renderer QML object? Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2022 13:56:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/how-to-render-a-feature-layer-using-multiple/m-p/1183522#M4600</guid>
      <dc:creator>DrewMorris</dc:creator>
      <dc:date>2022-06-16T13:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to render a feature layer using multiple fields in the query condition?</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/how-to-render-a-feature-layer-using-multiple/m-p/1184668#M4604</link>
      <description>&lt;P&gt;We don't have a client side API at the moment, so you'll need to set it in the web map.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2022 14:29:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/how-to-render-a-feature-layer-using-multiple/m-p/1184668#M4604</guid>
      <dc:creator>LucasDanzinger</dc:creator>
      <dc:date>2022-06-21T14:29:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to render a feature layer using multiple fields in the query condition?</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/how-to-render-a-feature-layer-using-multiple/m-p/1184722#M4605</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/184785"&gt;@LucasDanzinger&lt;/a&gt;&amp;nbsp;, I think we're going the route of using multiple feature layers to render these conditions.&amp;nbsp; We were trying to use a FeatureLayer type with PortalItem but we were unsuccessful due to the reasons my colleague has described&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-runtime-sdk-for-qt-questions/what-is-the-recommended-best-practice-for-adding/m-p/1167241/highlight/true#M4526" target="_self"&gt;here.&lt;/A&gt;&amp;nbsp;What we're trying now is loading two different FeatureLayer instances in which each one has a different definitionExpression for FIELD_ONE.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jun 2022 15:56:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/how-to-render-a-feature-layer-using-multiple/m-p/1184722#M4605</guid>
      <dc:creator>DrewMorris</dc:creator>
      <dc:date>2022-06-21T15:56:28Z</dc:date>
    </item>
  </channel>
</rss>

