<?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>idea Allow SQL, Calculated Fields for Hosted Feature Layer View in ArcGIS Online Ideas</title>
    <link>https://community.esri.com/t5/arcgis-online-ideas/allow-sql-calculated-fields-for-hosted-feature/idi-p/926474</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would like the ability to expose and edit SQL for hosted feature layer views.&amp;nbsp; This would allow much greater customization and control over the views.&amp;nbsp; An example where this can be used is when you want to filter the layer based on something dynamic.&amp;nbsp; For example, if you have a feature layer that has CreationDate and EditDate attributes and you want to filter for records where the EditDate is within 14 days of the CreationDate:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from [FeatureLayer] where EditDate &amp;lt;= DATEADD(day,14,convert(date,CreationDate))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another example is where you want to have a dynamically generated attribute on the view that is perhaps a concatenation of two attributes in the feature layer:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select [FeatureLayer].*, concat([Status] + '-' + [Priority]) as [Defect_priority]&lt;/P&gt;&lt;P&gt;from&amp;nbsp;&lt;SPAN&gt;[FeatureLayer]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or even Case statements:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select [AssetID],&lt;/P&gt;&lt;P&gt;case when&amp;nbsp;[&lt;SPAN&gt;EditDate] &amp;gt; DATEADD(day,14,convert(date,CreationDate)) then 'Overdue'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;when&amp;nbsp;[&lt;SPAN&gt;EditDate] &amp;lt;= DATEADD(day,14,convert(date,CreationDate))&lt;SPAN&gt;&amp;nbsp; then 'OnTime'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;when [EditDate] is null then 'Open'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;Else '' end as [CurrentStatus]&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;All of this can be done in an RDBMS such as SQL Server, however it could be useful to have this functionality for organizations that are using AGOL only.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Jun 2018 12:49:41 GMT</pubDate>
    <dc:creator>JamieLeitch1</dc:creator>
    <dc:date>2018-06-07T12:49:41Z</dc:date>
    <item>
      <title>Allow SQL, Calculated Fields for Hosted Feature Layer View</title>
      <link>https://community.esri.com/t5/arcgis-online-ideas/allow-sql-calculated-fields-for-hosted-feature/idi-p/926474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would like the ability to expose and edit SQL for hosted feature layer views.&amp;nbsp; This would allow much greater customization and control over the views.&amp;nbsp; An example where this can be used is when you want to filter the layer based on something dynamic.&amp;nbsp; For example, if you have a feature layer that has CreationDate and EditDate attributes and you want to filter for records where the EditDate is within 14 days of the CreationDate:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from [FeatureLayer] where EditDate &amp;lt;= DATEADD(day,14,convert(date,CreationDate))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another example is where you want to have a dynamically generated attribute on the view that is perhaps a concatenation of two attributes in the feature layer:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select [FeatureLayer].*, concat([Status] + '-' + [Priority]) as [Defect_priority]&lt;/P&gt;&lt;P&gt;from&amp;nbsp;&lt;SPAN&gt;[FeatureLayer]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or even Case statements:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select [AssetID],&lt;/P&gt;&lt;P&gt;case when&amp;nbsp;[&lt;SPAN&gt;EditDate] &amp;gt; DATEADD(day,14,convert(date,CreationDate)) then 'Overdue'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;when&amp;nbsp;[&lt;SPAN&gt;EditDate] &amp;lt;= DATEADD(day,14,convert(date,CreationDate))&lt;SPAN&gt;&amp;nbsp; then 'OnTime'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;when [EditDate] is null then 'Open'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;Else '' end as [CurrentStatus]&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;All of this can be done in an RDBMS such as SQL Server, however it could be useful to have this functionality for organizations that are using AGOL only.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jun 2018 12:49:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-ideas/allow-sql-calculated-fields-for-hosted-feature/idi-p/926474</guid>
      <dc:creator>JamieLeitch1</dc:creator>
      <dc:date>2018-06-07T12:49:41Z</dc:date>
    </item>
    <item>
      <title>Re: Allow SQL, Calculated Fields for Hosted Feature Layer View</title>
      <link>https://community.esri.com/t5/arcgis-online-ideas/allow-sql-calculated-fields-for-hosted-feature/idc-p/1305810#M10247</link>
      <description>&lt;P&gt;I agree this would be great!&amp;nbsp; I could also see arcade being used to allow for the generation of this kind of dynamic content (as can already be done in web map pop-ups).&amp;nbsp; There would be a lot of value to be able to generate dynamic information at the attribute level through SQL, Arcade, or other means.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2023 16:27:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-ideas/allow-sql-calculated-fields-for-hosted-feature/idc-p/1305810#M10247</guid>
      <dc:creator>Jesse_WI_DNR</dc:creator>
      <dc:date>2023-07-05T16:27:31Z</dc:date>
    </item>
  </channel>
</rss>

