<?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: Creating MTD Filter (SAS EG) in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-MTD-Filter-SAS-EG/m-p/390269#M25229</link>
    <description>Thank you!!</description>
    <pubDate>Wed, 23 Aug 2017 14:30:30 GMT</pubDate>
    <dc:creator>Tihannah</dc:creator>
    <dc:date>2017-08-23T14:30:30Z</dc:date>
    <item>
      <title>Creating MTD Filter (SAS EG)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-MTD-Filter-SAS-EG/m-p/389963#M25204</link>
      <description>&lt;P&gt;Trying to create a month to date filter where all data is rolled up to the previous days date. Our data is updated hourly so it keeps pulling in the current days data, which I don't need.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The filter is written:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Case when YEAR(t1.Order_Dt)=YEAR(TODAY()-1) AND MONTH(t1.Order_Dt)=MONTH(TODAY()-1) then 'MTD' else 'NoMonth' end&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It still keep pulling in data from the current business day. What am I doing wrong???&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2017 18:19:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-MTD-Filter-SAS-EG/m-p/389963#M25204</guid>
      <dc:creator>Tihannah</dc:creator>
      <dc:date>2017-08-22T18:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: Creating MTD Filter (SAS EG)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-MTD-Filter-SAS-EG/m-p/389974#M25205</link>
      <description>&lt;P&gt;Wouldn't it just be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where t.order_dt &amp;lt; today()-1&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 22 Aug 2017 18:36:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-MTD-Filter-SAS-EG/m-p/389974#M25205</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-08-22T18:36:10Z</dc:date>
    </item>
    <item>
      <title>Re: Creating MTD Filter (SAS EG)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-MTD-Filter-SAS-EG/m-p/389987#M25207</link>
      <description>I need to roll up everything within the current month. t1.order_dt &amp;lt; today()-1 when just give me all previos data going back 2 years.</description>
      <pubDate>Tue, 22 Aug 2017 19:17:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-MTD-Filter-SAS-EG/m-p/389987#M25207</guid>
      <dc:creator>Tihannah</dc:creator>
      <dc:date>2017-08-22T19:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: Creating MTD Filter (SAS EG)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-MTD-Filter-SAS-EG/m-p/390032#M25208</link>
      <description>&lt;P&gt;Look at something like&lt;/P&gt;
&lt;P&gt;&lt;FONT face="SAS Monospace" size="2"&gt;t1.order_dt between intnx(&lt;/FONT&gt;&lt;FONT color="#800080" face="SAS Monospace" size="2"&gt;'month'&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt;,today()-&lt;/FONT&gt;&lt;FONT color="#008080" face="SAS Monospace" size="2"&gt;1&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt;,&lt;/FONT&gt;&lt;FONT color="#008080" face="SAS Monospace" size="2"&gt;0&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="SAS Monospace" size="2"&gt;'B'&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt;) and (today()-&lt;/FONT&gt;&lt;FONT color="#008080" face="SAS Monospace" size="2"&gt;1&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt; )&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="SAS Monospace" size="2"&gt;You are getting todays date most of the time because month(today()-1) is month(today()) unless you are running on the first day of the month. You would also have to extend the the logic to day(order_dt) le day(today()-1)&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2017 21:19:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-MTD-Filter-SAS-EG/m-p/390032#M25208</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-08-22T21:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: Creating MTD Filter (SAS EG)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-MTD-Filter-SAS-EG/m-p/390128#M25216</link>
      <description>data SAMPLE(where=(dates&amp;lt;=intnx('days',today(),-1)));&lt;BR /&gt;format dates date9.;&lt;BR /&gt;do dates '01Jan2017'd to '31Dec2017'd;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;Try this one.</description>
      <pubDate>Wed, 23 Aug 2017 07:08:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-MTD-Filter-SAS-EG/m-p/390128#M25216</guid>
      <dc:creator>ShiroAmada</dc:creator>
      <dc:date>2017-08-23T07:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: Creating MTD Filter (SAS EG)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-MTD-Filter-SAS-EG/m-p/390269#M25229</link>
      <description>Thank you!!</description>
      <pubDate>Wed, 23 Aug 2017 14:30:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Creating-MTD-Filter-SAS-EG/m-p/390269#M25229</guid>
      <dc:creator>Tihannah</dc:creator>
      <dc:date>2017-08-23T14:30:30Z</dc:date>
    </item>
  </channel>
</rss>

