<?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 Re: Symbology based on current year? in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/symbology-based-on-current-year/m-p/1633998#M97329</link>
    <description>&lt;P&gt;This Arcade script is one way to do that, assuming your Yes/No field is called Binary and the date field called Date. This will return values that you can symbolize with the correct colors&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var theYear = Year($feature.Date);
var currentYear = Year(Now());

if ($feature.Binary == "Yes") return "black";
When(
  theYear &amp;lt;= currentYear, "green",
  theYear == currentYear + 1, "yellow",
  "red"
);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Line 1 gets the year of the point's date.&lt;/P&gt;&lt;P&gt;Line 2 gets the current year.&lt;/P&gt;&lt;P&gt;Line 4 returns "black" if the Binary field is Yes&lt;/P&gt;&lt;P&gt;Line 5 uses the When function (and uses an &lt;A href="https://developers.arcgis.com/arcade/guide/return/#implicit-returns" target="_self"&gt;implicit return&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;Line 6 returns "green" if the point's year is equal to or prior to the current year.&lt;/P&gt;&lt;P&gt;Line 7 returns "yellow" if the point's year is the next year.&lt;/P&gt;&lt;P&gt;Line 8 returns "red" if the point's year is after the next year.&lt;/P&gt;</description>
    <pubDate>Thu, 17 Jul 2025 18:54:06 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2025-07-17T18:54:06Z</dc:date>
    <item>
      <title>Symbology based on current year?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/symbology-based-on-current-year/m-p/1633992#M97324</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have a point layer for which I would like the symbology to reflect two attributes of a feature. The first would be a binary yes/no, and the second would be based on the current year. The way I would like it to work is:&lt;/P&gt;&lt;P&gt;1. If yes, then color = black.&lt;/P&gt;&lt;P&gt;2. If no, then reference "Year".&lt;/P&gt;&lt;P&gt;3. If "Year" = current year or prior to current year, then color =&amp;nbsp; green&lt;/P&gt;&lt;P&gt;4. If "Year" = current year + 1, then color = yellow&lt;/P&gt;&lt;P&gt;5. If "Year" = current year + 2 or longer, then color = red&lt;/P&gt;&lt;P&gt;The issues I am running into are with the "Year" field. The first issue is creating a Date field which only requires YYYY. I do not need a day or month for this data. A text or integer field solves this, but then the number is not seen as a year to be compared to the current year.&lt;/P&gt;&lt;P&gt;I would prefer not to, but if I use 1/1/YYYY as a placeholder date, I am not seeing a way to compare the date field to "current date" to inform the symbology.&lt;/P&gt;&lt;P&gt;Thank you all in advance for any assistance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jul 2025 18:30:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/symbology-based-on-current-year/m-p/1633992#M97324</guid>
      <dc:creator>ATeitelb</dc:creator>
      <dc:date>2025-07-17T18:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: Symbology based on current year?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/symbology-based-on-current-year/m-p/1633997#M97328</link>
      <description>&lt;P&gt;you could use the field calculator to just get the year&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import datetime

n = datetime.datetime.now()  # substitute 'n' for with !YourFieldName!
# datetime.datetime(2025, 7, 17, 14, 48, 24, 69857)
# as a string
n.strftime("%Y")
'2025'
# as an integer
int(n.strftime("%Y"))
2025&lt;/LI-CODE&gt;&lt;P&gt;.&amp;nbsp; The datetime functions are available in the field calculator, python parser&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jul 2025 18:51:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/symbology-based-on-current-year/m-p/1633997#M97328</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2025-07-17T18:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: Symbology based on current year?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/symbology-based-on-current-year/m-p/1633998#M97329</link>
      <description>&lt;P&gt;This Arcade script is one way to do that, assuming your Yes/No field is called Binary and the date field called Date. This will return values that you can symbolize with the correct colors&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var theYear = Year($feature.Date);
var currentYear = Year(Now());

if ($feature.Binary == "Yes") return "black";
When(
  theYear &amp;lt;= currentYear, "green",
  theYear == currentYear + 1, "yellow",
  "red"
);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Line 1 gets the year of the point's date.&lt;/P&gt;&lt;P&gt;Line 2 gets the current year.&lt;/P&gt;&lt;P&gt;Line 4 returns "black" if the Binary field is Yes&lt;/P&gt;&lt;P&gt;Line 5 uses the When function (and uses an &lt;A href="https://developers.arcgis.com/arcade/guide/return/#implicit-returns" target="_self"&gt;implicit return&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;Line 6 returns "green" if the point's year is equal to or prior to the current year.&lt;/P&gt;&lt;P&gt;Line 7 returns "yellow" if the point's year is the next year.&lt;/P&gt;&lt;P&gt;Line 8 returns "red" if the point's year is after the next year.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jul 2025 18:54:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/symbology-based-on-current-year/m-p/1633998#M97329</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2025-07-17T18:54:06Z</dc:date>
    </item>
  </channel>
</rss>

