<?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 Return Days of Year from Now() in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Return-Days-of-Year-from-Now/m-p/857923#M16942</link>
    <description>&lt;P&gt;I am getting a nonsense value for:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DayOfYear(TreatAs(_Date_, DatePart(Now())))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The result I get is 31,501,320&lt;/P&gt;&lt;P&gt;Should be 40.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anybody no what I am doing wrong.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tim&lt;/P&gt;</description>
    <pubDate>Thu, 09 Feb 2023 03:24:19 GMT</pubDate>
    <dc:creator>Bubson</dc:creator>
    <dc:date>2023-02-09T03:24:19Z</dc:date>
    <item>
      <title>Return Days of Year from Now()</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Return-Days-of-Year-from-Now/m-p/857923#M16942</link>
      <description>&lt;P&gt;I am getting a nonsense value for:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DayOfYear(TreatAs(_Date_, DatePart(Now())))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The result I get is 31,501,320&lt;/P&gt;&lt;P&gt;Should be 40.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anybody no what I am doing wrong.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tim&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2023 03:24:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Return-Days-of-Year-from-Now/m-p/857923#M16942</guid>
      <dc:creator>Bubson</dc:creator>
      <dc:date>2023-02-09T03:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: Return Days of Year from Now()</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Return-Days-of-Year-from-Now/m-p/857972#M16943</link>
      <description>&lt;P&gt;There are couple of ways you can achieve this.&lt;/P&gt;&lt;P&gt;Here is the simplest one:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example 1&lt;/STRONG&gt;: Simple and straightforward&lt;/P&gt;&lt;P&gt;You can remove +1 if you don't want to count todays date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data _null_;&lt;BR /&gt;	nrOfDays=intck('day', '01JAN2023'd, today()) + 1;&lt;BR /&gt;	put nrOfDays=;&lt;BR /&gt;run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example 2&lt;/STRONG&gt;: Dynamic start date&lt;/P&gt;&lt;P&gt;In case if you don't want to hard code date 01JAN2023 then you can use following code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data _null_;
	format beginning date9.;
	beginning=intnx('year ', today() , 0, 'b');
	nrOfDays=intck('day', beginning, today()) + 1;
	put beginning=;
	put nrOfDays=;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Feb 2023 09:51:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Return-Days-of-Year-from-Now/m-p/857972#M16943</guid>
      <dc:creator>MayurJadhav</dc:creator>
      <dc:date>2023-02-09T09:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: Return Days of Year from Now()</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Return-Days-of-Year-from-Now/m-p/857982#M16944</link>
      <description>&lt;P&gt;If you check the properties of your calculated item you'll probably find that the Aggregation is set to "Sum", so that it's effectively multiplying the number of days in the year by the number of records. in the table. Change it to "Average", "Minimum" or "Maximum" and it should display the correct value.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2023 10:43:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Return-Days-of-Year-from-Now/m-p/857982#M16944</guid>
      <dc:creator>Nigel_Pain</dc:creator>
      <dc:date>2023-02-09T10:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: Return Days of Year from Now()</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Return-Days-of-Year-from-Now/m-p/857996#M16945</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
DayOfYear=put(date(),julday.);
put DayOfYear=;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Feb 2023 11:47:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Return-Days-of-Year-from-Now/m-p/857996#M16945</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-02-09T11:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: Return Days of Year from Now()</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Return-Days-of-Year-from-Now/m-p/858118#M16946</link>
      <description>&lt;P&gt;Thanks for your response. As you guessed, I had the aggregation set to sum. Changed it to minimum and it calculates as expected.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2023 18:52:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Return-Days-of-Year-from-Now/m-p/858118#M16946</guid>
      <dc:creator>Bubson</dc:creator>
      <dc:date>2023-02-09T18:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: Return Days of Year from Now()</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Return-Days-of-Year-from-Now/m-p/858119#M16947</link>
      <description>&lt;P&gt;Thank you to everybody that replied. The problem was that I had aggregation set to 'Sum'. When set to 'Minimum' it calculates as expected.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2023 18:54:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Return-Days-of-Year-from-Now/m-p/858119#M16947</guid>
      <dc:creator>Bubson</dc:creator>
      <dc:date>2023-02-09T18:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: Return Days of Year from Now()</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Return-Days-of-Year-from-Now/m-p/858123#M16948</link>
      <description>&lt;P&gt;Please update your post as answered in that case.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2023 19:02:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Return-Days-of-Year-from-Now/m-p/858123#M16948</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2023-02-09T19:02:57Z</dc:date>
    </item>
  </channel>
</rss>

