<?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: Dynamic filtering of data till last month of the fiscal year in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Dynamic-filtering-of-data-till-last-month-of-the-fiscal-year/m-p/463788#M118210</link>
    <description>&lt;P&gt;It helps to show the desired result. Since your desired result is date of execution dependent it would be a very good idea to explicitly state the date of the program execution for future reference when a search leads someone to this thread.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have to say I am not quite understanding what all your April references are getting to.&lt;/P&gt;
&lt;P&gt;I suppose it has something to do with why 05Jan2018, 28Feb2018 and 09Feb2017&amp;nbsp;is excluded but the reasoning is not quite clear.&lt;/P&gt;</description>
    <pubDate>Mon, 21 May 2018 14:46:58 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2018-05-21T14:46:58Z</dc:date>
    <item>
      <title>Dynamic filtering of data till last month of the fiscal year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dynamic-filtering-of-data-till-last-month-of-the-fiscal-year/m-p/463565#M118118</link>
      <description>&lt;P&gt;Here is what my data situation and what I want.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My fiscal year goes from March 1 to end of February. At any given day (let's say today) I have my current fiscal year data until today (Mar 01 2018 - May 19 2018) and data from last 2 full fiscal year.&lt;/P&gt;
&lt;P&gt;For example today I have:&lt;BR /&gt;FiscalYear 2018-2019: Mar 01 2018 - May 19 2019&lt;BR /&gt;Fiscal Year 2017-2018: Mar 01 2017 - Feb 28 2018&lt;BR /&gt;Fiscal Year 2016-2017: Mar 01 2016 - Feb 28 2017&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;WHAT I WANT:&lt;BR /&gt;-------------------&lt;/P&gt;
&lt;P&gt;Filter the data until the end of last month (in my case April of 2018-2019 Fiscal Year) and I want the code to determine that from system date.&lt;BR /&gt;Filter the data from each last 2 fiscal year until the end of April of each year. In my example it will be April 2017 &amp;amp; April 2016.&lt;BR /&gt;Every month when I will run my code, I don't want to change my Year/Fiscal year manually on my code.&lt;/P&gt;
&lt;P&gt;My output table should look like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;16Mar2016 Bio2&lt;/P&gt;
&lt;P&gt;01Mar2018 Eng1&lt;BR /&gt;15Mar2018 Bio1&lt;BR /&gt;27Apr2018 Bio1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HERE IS MY Example DATA&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;DATA have;&lt;BR /&gt;INPUT Date Course_ID $4.;&lt;BR /&gt;INFORMAT Date Date9.;&lt;BR /&gt;FORMAT Date Date9.;&lt;BR /&gt;DATALINES;&lt;BR /&gt;05Jan2018 ENG1&lt;BR /&gt;16Aug2017 Bio2&lt;BR /&gt;11MAY2015 Eng2&lt;BR /&gt;28Feb2018 Geo2&lt;/P&gt;
&lt;P&gt;16Mar2016 Bio2&lt;/P&gt;
&lt;P&gt;01Mar2018 Eng1&lt;BR /&gt;09Feb2017 Che1&lt;BR /&gt;19Jan2015 Phy2&lt;BR /&gt;15Mar2018 Bio1&lt;BR /&gt;12Mar2015 Phy2&lt;BR /&gt;19May2018 Che1&lt;BR /&gt;27Apr2018 Bio1&lt;BR /&gt;;&lt;BR /&gt;PROC PRINT NOOBS;&lt;BR /&gt;RUN;&lt;/P&gt;</description>
      <pubDate>Sat, 19 May 2018 19:20:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dynamic-filtering-of-data-till-last-month-of-the-fiscal-year/m-p/463565#M118118</guid>
      <dc:creator>mlogan</dc:creator>
      <dc:date>2018-05-19T19:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic filtering of data till last month of the fiscal year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dynamic-filtering-of-data-till-last-month-of-the-fiscal-year/m-p/463584#M118132</link>
      <description>&lt;P&gt;Translate each filtering condition&amp;nbsp;with SAS date interval functions:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
if 
    /* Before the end of last month */
    date &amp;lt;= intnx("month", today(), -1, "end") and
    /* During last two fiscal years */
    intck("year.3", date, today()) &amp;lt;= 2 and
    /* Within the first two months of the fiscal year */
    intck("month", intnx("year.3", date, 0), date) &amp;lt; 2;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 19 May 2018 22:15:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dynamic-filtering-of-data-till-last-month-of-the-fiscal-year/m-p/463584#M118132</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-05-19T22:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic filtering of data till last month of the fiscal year</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Dynamic-filtering-of-data-till-last-month-of-the-fiscal-year/m-p/463788#M118210</link>
      <description>&lt;P&gt;It helps to show the desired result. Since your desired result is date of execution dependent it would be a very good idea to explicitly state the date of the program execution for future reference when a search leads someone to this thread.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have to say I am not quite understanding what all your April references are getting to.&lt;/P&gt;
&lt;P&gt;I suppose it has something to do with why 05Jan2018, 28Feb2018 and 09Feb2017&amp;nbsp;is excluded but the reasoning is not quite clear.&lt;/P&gt;</description>
      <pubDate>Mon, 21 May 2018 14:46:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Dynamic-filtering-of-data-till-last-month-of-the-fiscal-year/m-p/463788#M118210</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-05-21T14:46:58Z</dc:date>
    </item>
  </channel>
</rss>

