{"id":276942,"date":"2021-11-11T09:52:35","date_gmt":"2021-11-11T17:52:35","guid":{"rendered":"http:\/\/www.esri.com\/arcgis-blog\/?post_type=blog&#038;p=276942"},"modified":"2021-11-11T09:52:35","modified_gmt":"2021-11-11T17:52:35","slug":"how-to-author-a-feature-layer-to-show-current-in-last-xx-days-or-previous-locations-in-arcgis-pro-and-share-as-a-map-service","status":"publish","type":"blog","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-enterprise\/mapping\/how-to-author-a-feature-layer-to-show-current-in-last-xx-days-or-previous-locations-in-arcgis-pro-and-share-as-a-map-service","title":{"rendered":"How to author a feature layer to show current ( &#8216;in last xx days&#8217; ) or previous locations in ArcGIS Pro and share as a map service"},"author":5971,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"_acf_changed":false,"_searchwp_excluded":""},"categories":[22941],"tags":[525722,762772,762742,762752,762762],"industry":[],"product":[36571],"class_list":["post-276942","blog","type-blog","status-publish","format-standard","hentry","category-mapping","tag-earthquakes","tag-historic","tag-in-last-query","tag-latest","tag-previous","product-arcgis-enterprise"],"acf":{"short_description":"Blog shows how to use just one layer to display latest\/current locations by default and switch it to mode to play back all previous locations","flexible_content":[{"acf_fc_layout":"content","content":"<p>Show me features from &#8216;last x number of days&#8217; is a very common workflow especially with datasets that keep updating frequently. Earthquakes, sales, traffic volumes, crimes etc. are some examples where data gets updated daily or hourly or at an irregular frequency.<\/p>\n<p>For this exercise, let&#8217;s assume we have a global earthquakes data that keeps growing. And to keep it simple, the feature layer points to a dataset that have earthquakes that are recorded for the entire year. Viewing one year worth of data on a map is too much information. Instead we usually want to see only earthquakes recorded in last 24 hours or last 7 days or last month <strong>without needing to modify the query\/filter every time<\/strong>.<\/p>\n<h2>How can we do that?<\/h2>\n<p>This part is actually pretty simple:<\/p>\n<ol>\n<li>Add the feature layer in a map in ArcGIS Pro.<\/li>\n<li>Open the layer&#8217;s <strong>Properties<\/strong> page and switch to the <strong>Definition Query<\/strong> page.<\/li>\n<li>Click <strong>New definition query<\/strong>.<\/li>\n<li>Pick the <em>date<\/em> <em>field<\/em> from the <em>fields<\/em> drop down list.<\/li>\n<li>Select <strong>is after<\/strong> from the <em>operator<\/em> drop down box.<\/li>\n<li>Click <strong>SQL<\/strong> from the upper right corner to switch to the sql mode.<br \/>\n<img decoding=\"async\" class=\"alignnone wp-image-262222 \" src=\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/11\/defQuery_dateField.png\" alt=\"\" width=\"400\" \/><\/li>\n<li>An incomplete clause like the one below will be shown.<br \/>\n<img decoding=\"async\" class=\"alignnone wp-image-262222 \" src=\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/11\/defQuery_sql.png\" alt=\"\" width=\"400\" \/><\/li>\n<li>Pick an expression from the table below that is appropriate for your data source and enter that in the text box right after the &#8216;&gt;&#8217; sign. <em>Make sure to have a space in between<\/em>.<br \/>\n<table>\n<tbody>\n<tr>\n<th><strong>Database platform<\/strong><\/th>\n<th><strong>Expression<\/strong><\/th>\n<\/tr>\n<tr>\n<td>File geodatabase<\/td>\n<td><code>CURRENT_DATE \u2010 7<\/code><\/td>\n<\/tr>\n<tr>\n<td>PostgreSQL<\/td>\n<td><code>CURRENT_TIMESTAMP \u2010 INTERVAL '7 days'<\/code><\/td>\n<\/tr>\n<tr>\n<td>SQL Server<\/td>\n<td><code>DATEADD(dd, \u2010 7, getdate())<\/code><\/td>\n<\/tr>\n<tr>\n<td>Oracle<\/td>\n<td><code>CURRENT_DATE \u2010 INTERVAL '7' DAY<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Note: <i>if you copy\/paste from this above table, you might need to delete the dash and single quotes characters, and retype in.<\/i><\/li>\n<li>It should look something like this<br \/>\n<img decoding=\"async\" class=\"alignnone wp-image-262222 \" src=\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/11\/defQuery_sql_expr.png\" alt=\"\" width=\"400\" \/><\/li>\n<li>Click <strong>Apply<\/strong> followed by <strong>OK<\/strong> button to apply this dynamic definition query to your feature layer.<\/li>\n<\/ol>\n<p>Now we have got a layer that will always show earthquakes that occurred in last 7 days.<\/p>\n"},{"acf_fc_layout":"image","image":{"ID":1397472,"id":1397472,"title":"earthquakes_last7days","filename":"earthquakes_last7days.png","filesize":109390,"url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/11\/earthquakes_last7days.png","link":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-enterprise\/mapping\/how-to-author-a-feature-layer-to-show-current-in-last-xx-days-or-previous-locations-in-arcgis-pro-and-share-as-a-map-service\/earthquakes_last7days","alt":"","author":"5971","description":"","caption":"","name":"earthquakes_last7days","status":"inherit","uploaded_to":276942,"date":"2021-11-11 06:44:51","modified":"2021-11-11 06:44:51","menu_order":0,"mime_type":"image\/png","type":"image","subtype":"png","icon":"https:\/\/www.esri.com\/arcgis-blog\/wp-includes\/images\/media\/default.png","width":600,"height":305,"sizes":{"thumbnail":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/11\/earthquakes_last7days-213x200.png","thumbnail-width":213,"thumbnail-height":200,"medium":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/11\/earthquakes_last7days.png","medium-width":464,"medium-height":236,"medium_large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/11\/earthquakes_last7days.png","medium_large-width":600,"medium_large-height":305,"large":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/11\/earthquakes_last7days.png","large-width":600,"large-height":305,"1536x1536":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/11\/earthquakes_last7days.png","1536x1536-width":600,"1536x1536-height":305,"2048x2048":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/11\/earthquakes_last7days.png","2048x2048-width":600,"2048x2048-height":305,"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/11\/earthquakes_last7days.png","card_image-width":600,"card_image-height":305,"wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/11\/earthquakes_last7days.png","wide_image-width":600,"wide_image-height":305}},"image_position":"center","orientation":"horizontal","hyperlink":""},{"acf_fc_layout":"content","content":"<h2>Looking back in the past<\/h2>\n<p>Let&#8217;s make it a bit more interesting. The feature layer has data for the entire year. Because I have the &#8216;last 7 days&#8217; definition query set to the layer, I can&#8217;t view\/query any feature outside that filter. Of course, one option is to remove (or temporary <a href=\"https:\/\/pro.arcgis.com\/en\/pro-app\/latest\/help\/mapping\/layer-properties\/definition-query.htm#ESRI_SECTION1_097B7D85FAB84E35BE05249422077906\">turn off the definition query<\/a>), and apply another definition query for the time period that I need. But that won&#8217;t give good user experience, and when I will share, I might need to create multiple layers (<em>see the very last section below<\/em>).<\/p>\n<p>Good news is that there is a better option available now. Only gotcha is that you must have your data copied in an enterprise database. This will allow me to:<\/p>\n<ul>\n<li>View earthquakes from last 7 days by default, and<\/li>\n<li>Whenever I need to view\/query earthquakes from any other time window, I can simply enable the <a href=\"https:\/\/pro.arcgis.com\/en\/pro-app\/latest\/help\/mapping\/time\/visualize-temporal-data-using-the-time-slider.htm\">time slider<\/a> on the map and navigate to that time period.<\/li>\n<\/ul>\n<p>Let&#8217;s go over the steps:<\/p>\n<ol>\n<li>Choose <strong>Add Data<\/strong> | <a href=\"https:\/\/pro.arcgis.com\/en\/pro-app\/latest\/help\/mapping\/layer-properties\/creating-a-query-layer.htm\"><strong>Query Layer<\/strong><\/a> command from the <strong>Map<\/strong> ribbon.<\/li>\n<li>Select a database connection.<\/li>\n<li>Provide a <em>name<\/em>.<\/li>\n<li>Enter a SQL like below (<em>here the name of my table is<\/em> <em>earthquakes<\/em>).<br \/>\n<blockquote><p>select * from earthquakes where <strong>::r:TimeRange<\/strong><\/p><\/blockquote>\n<p><span style=\"text-decoration: underline\">Note<\/span>: the name after ::r: can be anything e.g. ::r:XYZ<\/li>\n<li>Click the <em>pencil<\/em> icon that appears next to <strong>::r:TimeRange<\/strong>.\n<ul>\n<li>a) enter the <em>date<\/em> field name in <strong>Field or Expression<\/strong> text box.<\/li>\n<li>b) choose <strong>Date<\/strong> from the <strong>Data Type <\/strong>drop down box.<\/li>\n<li>c) check <strong>Default Value<\/strong> on.<\/li>\n<li>d) copy\/paste the appropriate expression from the table above.<\/li>\n<li>e) enter <strong>current_timestamp<\/strong> in the textbox right after <strong>to<\/strong> label.<\/li>\n<li>f) click <strong>Done<\/strong>.<br \/>\n<img decoding=\"async\" class=\"alignnone wp-image-262222 \" src=\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/11\/queryLayer_rangeDefinition.png\" alt=\"\" width=\"400\" \/><\/li>\n<\/ul>\n<\/li>\n<li>Click <strong>Validate<\/strong>.<\/li>\n<li>Click <strong>Next<\/strong>.<\/li>\n<li>Pick <strong>Unique Identifier Field(s)<\/strong>, <strong>Geometry Type<\/strong> and <strong>Spatial Reference<\/strong> if not get chosen automatically on the next page.<\/li>\n<li>Click <strong>Finish<\/strong>.<\/li>\n<li>Now you should see your layer showing 7 day earthquakes (starting from <strong>now<\/strong>).<\/li>\n<li>This layer is a <a href=\"https:\/\/pro.arcgis.com\/en\/pro-app\/latest\/help\/mapping\/time\/temporal-data.htm\">time aware<\/a> query layer.<\/li>\n<li>The time slider should appear on the top of the map view.<\/li>\n<li>Enable the time slider and navigate to any time window to see the map showing earthquakes from that specific time window.\n<ul>\n<li>This data can be queried or used in a geoprocessing tool for further analysis with this subset of data.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-262222 \" src=\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/11\/earthquakes_october.png\" alt=\"\" width=\"600\" height=\"215\" \/><\/li>\n<li>Disable the time slider and the layer will only display earthquakes from the last 7 days.<br \/>\n<img decoding=\"async\" class=\"alignnone wp-image-262222 \" src=\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/11\/earthquakes_timeSliderDisabled.png\" alt=\"\" width=\"600\" \/><\/li>\n<\/ol>\n"},{"acf_fc_layout":"content","content":"<h2>Can this be shared as a service?<\/h2>\n<p>Yes, I can share this out as service with enterprise environment. This map can be shared out as as a <a href=\"https:\/\/pro.arcgis.com\/en\/pro-app\/latest\/help\/sharing\/overview\/publish-a-map-service.htm\">map service<\/a>\/<a href=\"https:\/\/pro.arcgis.com\/en\/pro-app\/latest\/help\/sharing\/overview\/map-image-layer.htm\">map image layer<\/a> on a standalone server or on an enterprise portal respectively. Then it can be consumed in a portal (or ArcGIS Online) map viewer, and the same user experience can be observed there too. You can add this as a map image layer, or a feature layer. When you need to use a feature layer on your web app, use the url of the sublayer off that map service (<em>the url ends with \/MapServer\/&lt;id&gt;<\/em>) instead of the map service root url (<em>that ends with \/MapServer<\/em>).<\/p>\n<p>&nbsp;<\/p>\n<h2>Any other benefits?<\/h2>\n<p>With traditional approach, I need to create multiple layers. See screenshot below for an existing map service where for each pre-authored time period, they needed to create one layer &#8211; one for last past week, another for past months and a third one for the entire time period.<\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-262222 \" src=\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/11\/multileLyrs_TOC.png\" alt=\"\" \/><\/p>\n<p>With this approach, all I need is one single layer and achieve what the traditional approach allows, and then some more.<br \/>\n<img decoding=\"async\" class=\"alignnone wp-image-262222 \" src=\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/11\/singleLyr_TOC.png\" alt=\"\" \/><\/p>\n"},{"acf_fc_layout":"content","content":"<h2>Important links:<\/h2>\n<ul>\n<li><a href=\"https:\/\/pro.arcgis.com\/en\/pro-app\/latest\/help\/mapping\/layer-properties\/define-parameters-in-a-query-layer.htm\">Define parameters in a query layer<\/a><\/li>\n<li><a href=\"https:\/\/pro.arcgis.com\/en\/pro-app\/latest\/help\/mapping\/layer-properties\/what-is-a-query-layer-.htm\">What is query layers<\/a><\/li>\n<\/ul>\n<hr \/>\n<p><em>Just a note, this blog is based on an Esri community<a href=\"https:\/\/community.esri.com\/t5\/arcgis-web-appbuilder-questions\/dynamic-date-value-in-filter-widget-using-arcgis\/m-p\/249299\/highlight\/true#M6726\"> forum discussion<\/a> we had sometime back. I had a similar discussion recently that prompted to write this as a blog for a wider audience.<\/em><\/p>\n"}],"authors":[{"ID":5971,"user_firstname":"Tanu","user_lastname":"Hoque","nickname":"Tanu Hoque","user_nicename":"mahoque","display_name":"Tanu Hoque","user_email":"ahoque@esri.com","user_url":"","user_registered":"2018-03-02 00:17:50","user_description":"Tanu is a product engineer on Esri Mapping Team focusing on map service, print service, and ArcGIS Pro. He also works on spatio-temporal analysis, spatial aggregation and real-time data. Tanu\u2019s background includes a masters in Urban Planning from University of Akron, Ohio, USA and a bachelor degree from Khulna University, Bangladesh, and worked as GIS Coordinator in City of West Springfield, and GIS Specialist in a hydrology modeling center in Bangladesh before joining Esri.","user_avatar":"<img data-del=\"avatar\" src='https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/12\/tanu-hoque2-e1609364913822-213x200.jpeg' class='avatar pp-user-avatar avatar-96 photo ' height='96' width='96'\/>"}],"related_articles":[{"ID":261312,"post_author":"5971","post_date":"2018-07-01 14:20:46","post_date_gmt":"2018-07-01 21:20:46","post_content":"","post_title":"Play back flight data using time slider and query layer in ArcGIS Pro","post_excerpt":"","post_status":"publish","comment_status":"open","ping_status":"closed","post_password":"","post_name":"play-back-flight-data-using-time-slider-and-query-layer-in-arcgis-pro","to_ping":"","pinged":"","post_modified":"2021-11-11 15:47:17","post_modified_gmt":"2021-11-11 23:47:17","post_content_filtered":"","post_parent":0,"guid":"http:\/\/www.esri.com\/arcgis-blog\/?post_type=blog&#038;p=261312","menu_order":0,"post_type":"blog","post_mime_type":"","comment_count":"0","filter":"raw"},{"ID":1392752,"post_author":"5971","post_date":"2021-11-10 13:32:53","post_date_gmt":"2021-11-10 21:32:53","post_content":"","post_title":"Generate trajectories\/paths for hurricanes on the fly from their point locations","post_excerpt":"","post_status":"publish","comment_status":"open","ping_status":"closed","post_password":"","post_name":"generate-trajectories-paths-for-hurricanes-on-the-fly-from-their-point-locations","to_ping":"","pinged":"","post_modified":"2021-11-10 13:32:53","post_modified_gmt":"2021-11-10 21:32:53","post_content_filtered":"","post_parent":0,"guid":"https:\/\/www.esri.com\/arcgis-blog\/?post_type=blog&#038;p=1392752","menu_order":0,"post_type":"blog","post_mime_type":"","comment_count":"0","filter":"raw"}],"card_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/11\/earthquakes_smallBanner.png","wide_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/11\/earthquakes_largeBanner.png"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.9 (Yoast SEO v25.9) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to author a feature layer to show current ( &#039;in last xx days&#039; ) or previous locations in ArcGIS Pro and share as a map service<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-enterprise\/mapping\/how-to-author-a-feature-layer-to-show-current-in-last-xx-days-or-previous-locations-in-arcgis-pro-and-share-as-a-map-service\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to author a feature layer to show current ( &#039;in last xx days&#039; ) or previous locations in ArcGIS Pro and share as a map service\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-enterprise\/mapping\/how-to-author-a-feature-layer-to-show-current-in-last-xx-days-or-previous-locations-in-arcgis-pro-and-share-as-a-map-service\" \/>\n<meta property=\"og:site_name\" content=\"ArcGIS Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/esrigis\/\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@ESRI\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":[\"Article\",\"BlogPosting\"],\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-enterprise\/mapping\/how-to-author-a-feature-layer-to-show-current-in-last-xx-days-or-previous-locations-in-arcgis-pro-and-share-as-a-map-service#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-enterprise\/mapping\/how-to-author-a-feature-layer-to-show-current-in-last-xx-days-or-previous-locations-in-arcgis-pro-and-share-as-a-map-service\"},\"author\":{\"name\":\"Tanu Hoque\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/9932dde4f8a6dae58fd1b485d1ddf017\"},\"headline\":\"How to author a feature layer to show current ( &#8216;in last xx days&#8217; ) or previous locations in ArcGIS Pro and share as a map service\",\"datePublished\":\"2021-11-11T17:52:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-enterprise\/mapping\/how-to-author-a-feature-layer-to-show-current-in-last-xx-days-or-previous-locations-in-arcgis-pro-and-share-as-a-map-service\"},\"wordCount\":25,\"publisher\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#organization\"},\"keywords\":[\"earthquakes\",\"historic\",\"in last query\",\"latest\",\"previous\"],\"articleSection\":[\"Mapping\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-enterprise\/mapping\/how-to-author-a-feature-layer-to-show-current-in-last-xx-days-or-previous-locations-in-arcgis-pro-and-share-as-a-map-service\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-enterprise\/mapping\/how-to-author-a-feature-layer-to-show-current-in-last-xx-days-or-previous-locations-in-arcgis-pro-and-share-as-a-map-service\",\"name\":\"How to author a feature layer to show current ( 'in last xx days' ) or previous locations in ArcGIS Pro and share as a map service\",\"isPartOf\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#website\"},\"datePublished\":\"2021-11-11T17:52:35+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-enterprise\/mapping\/how-to-author-a-feature-layer-to-show-current-in-last-xx-days-or-previous-locations-in-arcgis-pro-and-share-as-a-map-service#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-enterprise\/mapping\/how-to-author-a-feature-layer-to-show-current-in-last-xx-days-or-previous-locations-in-arcgis-pro-and-share-as-a-map-service\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-enterprise\/mapping\/how-to-author-a-feature-layer-to-show-current-in-last-xx-days-or-previous-locations-in-arcgis-pro-and-share-as-a-map-service#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.esri.com\/arcgis-blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to author a feature layer to show current ( &#8216;in last xx days&#8217; ) or previous locations in ArcGIS Pro and share as a map service\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#website\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/\",\"name\":\"ArcGIS Blog\",\"description\":\"Get insider info from Esri product teams\",\"publisher\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.esri.com\/arcgis-blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#organization\",\"name\":\"Esri\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png\",\"contentUrl\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png\",\"width\":400,\"height\":400,\"caption\":\"Esri\"},\"image\":{\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/esrigis\/\",\"https:\/\/x.com\/ESRI\",\"https:\/\/www.linkedin.com\/company\/5311\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/9932dde4f8a6dae58fd1b485d1ddf017\",\"name\":\"Tanu Hoque\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/12\/tanu-hoque2-e1609364913822-213x200.jpeg\",\"contentUrl\":\"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/12\/tanu-hoque2-e1609364913822-213x200.jpeg\",\"caption\":\"Tanu Hoque\"},\"description\":\"Tanu is a product engineer on Esri Mapping Team focusing on map service, print service, and ArcGIS Pro. He also works on spatio-temporal analysis, spatial aggregation and real-time data. Tanu\u2019s background includes a masters in Urban Planning from University of Akron, Ohio, USA and a bachelor degree from Khulna University, Bangladesh, and worked as GIS Coordinator in City of West Springfield, and GIS Specialist in a hydrology modeling center in Bangladesh before joining Esri.\",\"sameAs\":[\"https:\/\/x.com\/ArcGISPro\"],\"url\":\"https:\/\/www.esri.com\/arcgis-blog\/author\/mahoque\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to author a feature layer to show current ( 'in last xx days' ) or previous locations in ArcGIS Pro and share as a map service","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-enterprise\/mapping\/how-to-author-a-feature-layer-to-show-current-in-last-xx-days-or-previous-locations-in-arcgis-pro-and-share-as-a-map-service","og_locale":"en_US","og_type":"article","og_title":"How to author a feature layer to show current ( 'in last xx days' ) or previous locations in ArcGIS Pro and share as a map service","og_url":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-enterprise\/mapping\/how-to-author-a-feature-layer-to-show-current-in-last-xx-days-or-previous-locations-in-arcgis-pro-and-share-as-a-map-service","og_site_name":"ArcGIS Blog","article_publisher":"https:\/\/www.facebook.com\/esrigis\/","twitter_card":"summary_large_image","twitter_site":"@ESRI","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","BlogPosting"],"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-enterprise\/mapping\/how-to-author-a-feature-layer-to-show-current-in-last-xx-days-or-previous-locations-in-arcgis-pro-and-share-as-a-map-service#article","isPartOf":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-enterprise\/mapping\/how-to-author-a-feature-layer-to-show-current-in-last-xx-days-or-previous-locations-in-arcgis-pro-and-share-as-a-map-service"},"author":{"name":"Tanu Hoque","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/9932dde4f8a6dae58fd1b485d1ddf017"},"headline":"How to author a feature layer to show current ( &#8216;in last xx days&#8217; ) or previous locations in ArcGIS Pro and share as a map service","datePublished":"2021-11-11T17:52:35+00:00","mainEntityOfPage":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-enterprise\/mapping\/how-to-author-a-feature-layer-to-show-current-in-last-xx-days-or-previous-locations-in-arcgis-pro-and-share-as-a-map-service"},"wordCount":25,"publisher":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#organization"},"keywords":["earthquakes","historic","in last query","latest","previous"],"articleSection":["Mapping"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-enterprise\/mapping\/how-to-author-a-feature-layer-to-show-current-in-last-xx-days-or-previous-locations-in-arcgis-pro-and-share-as-a-map-service","url":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-enterprise\/mapping\/how-to-author-a-feature-layer-to-show-current-in-last-xx-days-or-previous-locations-in-arcgis-pro-and-share-as-a-map-service","name":"How to author a feature layer to show current ( 'in last xx days' ) or previous locations in ArcGIS Pro and share as a map service","isPartOf":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#website"},"datePublished":"2021-11-11T17:52:35+00:00","breadcrumb":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-enterprise\/mapping\/how-to-author-a-feature-layer-to-show-current-in-last-xx-days-or-previous-locations-in-arcgis-pro-and-share-as-a-map-service#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-enterprise\/mapping\/how-to-author-a-feature-layer-to-show-current-in-last-xx-days-or-previous-locations-in-arcgis-pro-and-share-as-a-map-service"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.esri.com\/arcgis-blog\/products\/arcgis-enterprise\/mapping\/how-to-author-a-feature-layer-to-show-current-in-last-xx-days-or-previous-locations-in-arcgis-pro-and-share-as-a-map-service#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.esri.com\/arcgis-blog\/"},{"@type":"ListItem","position":2,"name":"How to author a feature layer to show current ( &#8216;in last xx days&#8217; ) or previous locations in ArcGIS Pro and share as a map service"}]},{"@type":"WebSite","@id":"https:\/\/www.esri.com\/arcgis-blog\/#website","url":"https:\/\/www.esri.com\/arcgis-blog\/","name":"ArcGIS Blog","description":"Get insider info from Esri product teams","publisher":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.esri.com\/arcgis-blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.esri.com\/arcgis-blog\/#organization","name":"Esri","url":"https:\/\/www.esri.com\/arcgis-blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png","contentUrl":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2018\/04\/Esri.png","width":400,"height":400,"caption":"Esri"},"image":{"@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/esrigis\/","https:\/\/x.com\/ESRI","https:\/\/www.linkedin.com\/company\/5311\/"]},{"@type":"Person","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/9932dde4f8a6dae58fd1b485d1ddf017","name":"Tanu Hoque","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.esri.com\/arcgis-blog\/#\/schema\/person\/image\/","url":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/12\/tanu-hoque2-e1609364913822-213x200.jpeg","contentUrl":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2020\/12\/tanu-hoque2-e1609364913822-213x200.jpeg","caption":"Tanu Hoque"},"description":"Tanu is a product engineer on Esri Mapping Team focusing on map service, print service, and ArcGIS Pro. He also works on spatio-temporal analysis, spatial aggregation and real-time data. Tanu\u2019s background includes a masters in Urban Planning from University of Akron, Ohio, USA and a bachelor degree from Khulna University, Bangladesh, and worked as GIS Coordinator in City of West Springfield, and GIS Specialist in a hydrology modeling center in Bangladesh before joining Esri.","sameAs":["https:\/\/x.com\/ArcGISPro"],"url":"https:\/\/www.esri.com\/arcgis-blog\/author\/mahoque"}]}},"text_date":"November 11, 2021","author_name":"Tanu Hoque","author_page":"https:\/\/www.esri.com\/arcgis-blog\/author\/mahoque","custom_image":"https:\/\/www.esri.com\/arcgis-blog\/app\/uploads\/2021\/11\/earthquakes_largeBanner.png","primary_product":"ArcGIS Enterprise","tag_data":[{"term_id":525722,"name":"earthquakes","slug":"earthquakes","term_group":0,"term_taxonomy_id":525722,"taxonomy":"post_tag","description":"","parent":0,"count":3,"filter":"raw"},{"term_id":762772,"name":"historic","slug":"historic","term_group":0,"term_taxonomy_id":762772,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"},{"term_id":762742,"name":"in last query","slug":"in-last-query","term_group":0,"term_taxonomy_id":762742,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"},{"term_id":762752,"name":"latest","slug":"latest","term_group":0,"term_taxonomy_id":762752,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"},{"term_id":762762,"name":"previous","slug":"previous","term_group":0,"term_taxonomy_id":762762,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"}],"category_data":[{"term_id":22941,"name":"Mapping","slug":"mapping","term_group":0,"term_taxonomy_id":22941,"taxonomy":"category","description":"","parent":0,"count":2692,"filter":"raw"}],"product_data":[{"term_id":36571,"name":"ArcGIS Enterprise","slug":"arcgis-enterprise","term_group":0,"term_taxonomy_id":36571,"taxonomy":"product","description":"","parent":0,"count":977,"filter":"raw"}],"primary_product_link":"https:\/\/www.esri.com\/arcgis-blog\/?s=#&products=arcgis-enterprise","_links":{"self":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/blog\/276942","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/blog"}],"about":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/types\/blog"}],"author":[{"embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/users\/5971"}],"replies":[{"embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/comments?post=276942"}],"version-history":[{"count":0,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/blog\/276942\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/media?parent=276942"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/categories?post=276942"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/tags?post=276942"},{"taxonomy":"industry","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/industry?post=276942"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/www.esri.com\/arcgis-blog\/wp-json\/wp\/v2\/product?post=276942"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}