<?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 Aggregate to show results for the current year only in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Aggregate-to-show-results-for-the-current-year-only/m-p/786897#M251302</link>
    <description>&lt;P&gt;I have a table where I compare the results week to week.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Gieorgie_0-1640075482958.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/66911i6D166AD42247B24C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Gieorgie_0-1640075482958.png" alt="Gieorgie_0-1640075482958.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have aggregations of old dates using these functions.&lt;/P&gt;
&lt;PRE&gt;%let date_old=%sysfunc(intnx(year,%sysfunc(Today()),-1,s));
%put &amp;amp;=date_old;
proc format;
    value vintf low-&amp;amp;date_old = 'OLD' other=[yymmd7.];
run;
/*agregujemy wyniki do daty vintf jako old*/
proc summary data=tablea_new nway;
    class policy_vintage;
    format policy_vintage vintf.;
    var AKTYWNE WYGASLE;
    output out=newtabe sum=;&lt;/PRE&gt;
&lt;P&gt;And I would like to do exactly the same, only to aggregate the dates to show the yearly range, i.e. 2021-01-2022-01. Or the current year 2021-01-2021-12. Is the following sample okay? What's the best way to do this?&lt;/P&gt;
&lt;PRE&gt;%let date_future=%sysfunc(intnx(year,%sysfunc(Today()),+12,s));
%put &amp;amp;=date_future;
proc format;
    value vintfutr +&amp;amp;date_future= 'FUTURE' other=[yymmd7.];
run;
&lt;/PRE&gt;</description>
    <pubDate>Tue, 21 Dec 2021 08:36:06 GMT</pubDate>
    <dc:creator>Gieorgie</dc:creator>
    <dc:date>2021-12-21T08:36:06Z</dc:date>
    <item>
      <title>Aggregate to show results for the current year only</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Aggregate-to-show-results-for-the-current-year-only/m-p/786897#M251302</link>
      <description>&lt;P&gt;I have a table where I compare the results week to week.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Gieorgie_0-1640075482958.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/66911i6D166AD42247B24C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Gieorgie_0-1640075482958.png" alt="Gieorgie_0-1640075482958.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have aggregations of old dates using these functions.&lt;/P&gt;
&lt;PRE&gt;%let date_old=%sysfunc(intnx(year,%sysfunc(Today()),-1,s));
%put &amp;amp;=date_old;
proc format;
    value vintf low-&amp;amp;date_old = 'OLD' other=[yymmd7.];
run;
/*agregujemy wyniki do daty vintf jako old*/
proc summary data=tablea_new nway;
    class policy_vintage;
    format policy_vintage vintf.;
    var AKTYWNE WYGASLE;
    output out=newtabe sum=;&lt;/PRE&gt;
&lt;P&gt;And I would like to do exactly the same, only to aggregate the dates to show the yearly range, i.e. 2021-01-2022-01. Or the current year 2021-01-2021-12. Is the following sample okay? What's the best way to do this?&lt;/P&gt;
&lt;PRE&gt;%let date_future=%sysfunc(intnx(year,%sysfunc(Today()),+12,s));
%put &amp;amp;=date_future;
proc format;
    value vintfutr +&amp;amp;date_future= 'FUTURE' other=[yymmd7.];
run;
&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Dec 2021 08:36:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Aggregate-to-show-results-for-the-current-year-only/m-p/786897#M251302</guid>
      <dc:creator>Gieorgie</dc:creator>
      <dc:date>2021-12-21T08:36:06Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate to show results for the current year only</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Aggregate-to-show-results-for-the-current-year-only/m-p/786898#M251303</link>
      <description>&lt;P&gt;How many (and which) formatted values do you expect for your CLASS variable in the end?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 08:49:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Aggregate-to-show-results-for-the-current-year-only/m-p/786898#M251303</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-12-21T08:49:47Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate to show results for the current year only</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Aggregate-to-show-results-for-the-current-year-only/m-p/786899#M251304</link>
      <description>I don't know if I understood you correctly. I would like aggregated OLD, i.e. all until the date of the current year as it is then each month in the current year, and then aggregation of FUTURE from the end of the year to the last date</description>
      <pubDate>Tue, 21 Dec 2021 08:56:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Aggregate-to-show-results-for-the-current-year-only/m-p/786899#M251304</guid>
      <dc:creator>Gieorgie</dc:creator>
      <dc:date>2021-12-21T08:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate to show results for the current year only</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Aggregate-to-show-results-for-the-current-year-only/m-p/786901#M251306</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let date_old=%sysfunc(intnx(year,%sysfunc(Today()),-1,s));
%let date_future=%sysfunc(intnx(year,%sysfunc(Today()),+1,s));
proc format;
value vintf
  low-&amp;amp;date_old = 'OLD'
  &amp;amp;date_future-high = 'FUTURE'
  other=[yymmd7.]
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Dec 2021 09:50:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Aggregate-to-show-results-for-the-current-year-only/m-p/786901#M251306</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-12-21T09:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate to show results for the current year only</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Aggregate-to-show-results-for-the-current-year-only/m-p/786919#M251315</link>
      <description>Thanks Kurt very much ! Happy xmass &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Tue, 21 Dec 2021 11:49:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Aggregate-to-show-results-for-the-current-year-only/m-p/786919#M251315</guid>
      <dc:creator>Gieorgie</dc:creator>
      <dc:date>2021-12-21T11:49:16Z</dc:date>
    </item>
  </channel>
</rss>

