<?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: Rolling 90-day average by site/date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/351811#M81928</link>
    <description>&lt;P&gt;A couple of questions before any programming can begin:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;What formulas do you want to use?&amp;nbsp; (a) sum/n for each day, then average that for 90 days, vs. (b) 90-day-total-sum / 90-day-total-n&lt;/LI&gt;
&lt;LI&gt;Do you want any calculations made for the first 89 days for each site?&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Apr 2017 17:30:14 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2017-04-20T17:30:14Z</dc:date>
    <item>
      <title>Rolling 90-day average by site/date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/351796#M81922</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I have a dataset with site, date, n and sum, and am trying to calculate a rolling 90-day mean for each site &amp;amp; date (sample data attached). I can't use proc expand and am not great with SQL. I've created the interval begin and end dates for each site/date and want the mean&amp;nbsp;across the entire interval per line. The entire dataset contains records for 30+ sites, each with a record for every day between 2011 and 2015.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried separating the file into two...one with site/date/n/sum and the other with site/int_begin/int_end. I'm not sure if that would be easier.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would appreciate any guidance..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2017 16:54:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/351796#M81922</guid>
      <dc:creator>JWH1</dc:creator>
      <dc:date>2017-04-20T16:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 90-day average by site/date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/351797#M81923</link>
      <description>&lt;P&gt;Many users here don't want to download Excel files because of virus potential, others have such things blocked by security software. Also if you give us Excel we have to create a SAS data set and due to the non-existent constraints on Excel data cells the result we end up with may not have variables of the same type (numeric or character) and even values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2017 16:57:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/351797#M81923</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-04-20T16:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 90-day average by site/date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/351811#M81928</link>
      <description>&lt;P&gt;A couple of questions before any programming can begin:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;What formulas do you want to use?&amp;nbsp; (a) sum/n for each day, then average that for 90 days, vs. (b) 90-day-total-sum / 90-day-total-n&lt;/LI&gt;
&lt;LI&gt;Do you want any calculations made for the first 89 days for each site?&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2017 17:30:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/351811#M81928</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-04-20T17:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 90-day average by site/date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/351820#M81930</link>
      <description>&lt;P&gt;I need 90-day-total-sum / 90-day-total-n, with the 90 days for each line defined defined as int_begin to int_end&lt;/P&gt;&lt;P&gt;I don't need anything less than the 90 days, although will want to be able to extend the code to apply to 180-day averaging period, etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I couldn't get the macro to work to provide the data step lines. If it helps, i've listed the data in&amp;nbsp;csv format&amp;nbsp;below..sorry about that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Site,date,n,sum,int_begin,int_end&lt;/P&gt;&lt;P&gt;Site1,1/1/2012,12,750.1,10/3/2011,1/1/2012&lt;/P&gt;&lt;P&gt;Site1,1/2/2012,12,180.6,10/4/2011,1/2/2012&lt;/P&gt;&lt;P&gt;Site1,1/3/2012,10,160.2,10/5/2011,1/3/2012&lt;/P&gt;&lt;P&gt;Site2,1/1/2012,11,230.2,10/3/2011,1/1/2012&lt;/P&gt;&lt;P&gt;Site2,1/2/2012,11,280.4,10/4/2011,1/2/2012&lt;/P&gt;&lt;P&gt;Site2,1/3/2012,11,250.2,10/5/2011,1/3/2012&lt;/P&gt;&lt;P&gt;Site3,1/1/2012,12,448.2,10/3/2011,1/1/2012&lt;/P&gt;&lt;P&gt;Site3,1/2/2012,12,315.5,10/4/2011,1/2/2012&lt;/P&gt;&lt;P&gt;Site3,1/3/2012,12,175.3,10/5/2011,1/3/2012&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2017 17:38:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/351820#M81930</guid>
      <dc:creator>JWH1</dc:creator>
      <dc:date>2017-04-20T17:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 90-day average by site/date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/351821#M81931</link>
      <description>&lt;P&gt;As the problem becomes clearer, I think I should leave this to the SQL programmers out there.&amp;nbsp; Although I would eventually find the right combination of statements, they will get it done much faster.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2017 17:44:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/351821#M81931</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-04-20T17:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 90-day average by site/date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/351837#M81934</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/140126"&gt;@JWH1&lt;/a&gt;&amp;nbsp;May i ask you a favor to please post me an output sample for a couple of sites. I would appreciate if could. Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2017 18:12:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/351837#M81934</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2017-04-20T18:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 90-day average by site/date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/351844#M81938</link>
      <description>&lt;P&gt;Since you want 90-day-sum / 90-day-n, you can use PROC EXPAND (the MOVAVG option) to create the numerator and denominator, and then of course you can do the division thereafter.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2017 18:38:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/351844#M81938</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-04-20T18:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 90-day average by site/date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/351855#M81943</link>
      <description>&lt;P&gt;I don't have SAS/ETS...am unable to use Proc Expand unfortunately..&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2017 18:59:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/351855#M81943</guid>
      <dc:creator>JWH1</dc:creator>
      <dc:date>2017-04-20T18:59:39Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 90-day average by site/date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/351856#M81944</link>
      <description>I'm sorry I'm not sure what you're asking for..are you asking for a data file of a complete set of records (365 days*5) for a few sites?</description>
      <pubDate>Thu, 20 Apr 2017 19:01:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/351856#M81944</guid>
      <dc:creator>JWH1</dc:creator>
      <dc:date>2017-04-20T19:01:24Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 90-day average by site/date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/351859#M81946</link>
      <description>&lt;P&gt;just a one site, a partial one will do if you can. Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2017 19:04:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/351859#M81946</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2017-04-20T19:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 90-day average by site/date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/351877#M81960</link>
      <description>&lt;P&gt;Normally when one says something like '90 day rolling average' the data is one record per day and the result includes the current record plus the previous 89 within a given group such as site, company or what have you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you only show 3 days of example data per the DATE value for the three sites, what would the result be for that data for your concept of a 90 day rolling average?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2017 19:32:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/351877#M81960</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-04-20T19:32:36Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 90-day average by site/date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/351883#M81964</link>
      <description>&lt;P&gt;ballardw,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think if you look at the sample data shown, this a much easier problem.&amp;nbsp; Each record includes a beginning and ending date, as well as a current date.&amp;nbsp; The idea is to find all DATE values that fall in the range of beginning through ending date, get total amount and total N, and divide.&amp;nbsp; Just add that one new field to the end of each existing record.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Easy for SQL, so easy that I could program it in about 30 minutes.&amp;nbsp; But somebody who knows SQL could program it in about 1 minute.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2017 19:45:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/351883#M81964</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-04-20T19:45:36Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 90-day average by site/date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/351891#M81968</link>
      <description>&lt;P&gt;ok, I've attached a file below for the entire 5-year period for one site. these are air quality measurements and since i needed a 90-day rolling average, and didn't want to take the mean of means, i have the number ('ConcN') of hourly measurements for each day, and the sum ('ConcSum') of the hourly measurements. i wanted to ultimately calculate the 90-day average (including date_PM and the 89 days prior), so was trying to sum concN and concSum for the rolling 90-day period, then could easily calculate the mean..does that make sense?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2017 19:51:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/351891#M81968</guid>
      <dc:creator>JWH1</dc:creator>
      <dc:date>2017-04-20T19:51:09Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 90-day average by site/date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/351960#M82008</link>
      <description>&lt;P&gt;Unexpectedly (at least to me), nobody has tried this. &amp;nbsp;Here's at least the approach based on this set of data:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Site,date,n,sum,int_begin,int_end&lt;/P&gt;
&lt;P&gt;Site1,1/1/2012,12,750.1,10/3/2011,1/1/2012&lt;/P&gt;
&lt;P&gt;Site1,1/2/2012,12,180.6,10/4/2011,1/2/2012&lt;/P&gt;
&lt;P&gt;Site1,1/3/2012,10,160.2,10/5/2011,1/3/2012&lt;/P&gt;
&lt;P&gt;Site2,1/1/2012,11,230.2,10/3/2011,1/1/2012&lt;/P&gt;
&lt;P&gt;Site2,1/2/2012,11,280.4,10/4/2011,1/2/2012&lt;/P&gt;
&lt;P&gt;Site2,1/3/2012,11,250.2,10/5/2011,1/3/2012&lt;/P&gt;
&lt;P&gt;Site3,1/1/2012,12,448.2,10/3/2011,1/1/2012&lt;/P&gt;
&lt;P&gt;Site3,1/2/2012,12,315.5,10/4/2011,1/2/2012&lt;/P&gt;
&lt;P&gt;Site3,1/3/2012,12,175.3,10/5/2011,1/3/2012&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's SQL, so you'll probably have to fix my code a little.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;/P&gt;
&lt;P&gt;create table want as select a.*, sum(b.sum)/sum(b.n) as mean from&lt;/P&gt;
&lt;P&gt;have a, have b&lt;/P&gt;
&lt;P&gt;where a.site=b.site and b.date between a.int_begin and a.int_end;&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;While I'm shaky on the syntax, the approach sounds like it's exactly what you asked for.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2017 00:23:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/351960#M82008</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-04-21T00:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 90-day average by site/date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/351972#M82010</link>
      <description>&lt;P&gt;thanks so much for the reply..&lt;/P&gt;&lt;P&gt;this didn't quite work...the dataset went from 36,250 records to 3,017,928 records, all with the same mean. I wanted to end up with the same # of records i started with, just with the mean of the interval added to the record..&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2017 02:04:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/351972#M82010</guid>
      <dc:creator>JWH1</dc:creator>
      <dc:date>2017-04-21T02:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 90-day average by site/date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/352101#M82041</link>
      <description>&lt;P&gt;That's why I was hoping a real SQL programmer would step up. &amp;nbsp;It's not that far, but I'm not sure what to tweak. &amp;nbsp;If I had to guess, it would be the need to add GROUP BY Site Date&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2017 10:44:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/352101#M82041</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-04-21T10:44:12Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 90-day average by site/date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/352247#M82080</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/140126"&gt;@JWH1&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;thanks so much for the reply..&lt;/P&gt;
&lt;P&gt;this didn't quite work...the dataset went from 36,250 records to 3,017,928 records, all with the same mean. I wanted to end up with the same # of records i started with, just with the mean of the interval added to the record..&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Have you shown what the expected output result is for a few of those records yet?&lt;/P&gt;
&lt;P&gt;I at least do not understand what you want for output.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2017 17:13:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/352247#M82080</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-04-21T17:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 90-day average by site/date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/352248#M82081</link>
      <description>&lt;P&gt;lol neither do i, I was feeling embarrassed to admit that as I assumed everbody else understood.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2017 17:15:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/352248#M82081</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2017-04-21T17:15:52Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 90-day average by site/date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/352261#M82084</link>
      <description>&lt;P&gt;Sorry i'm not explaining this very well..it's perfectly clear in my head &lt;span class="lia-unicode-emoji" title=":neutral_face:"&gt;😐&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've attached an updated csv file...column G is what i am trying to add to each record.Note that it is not calculated until the first&amp;nbsp;observation with int_begin&amp;gt;=1/1/2011 because that's the earliest date_PM i have&amp;nbsp;in the file. But it can calculate the 90-day average for every record after that. The calculation in excel for date_PM=4/18/2011 (the first record with a calcuated mean in my attached sample) was sum(F19:F82)/n(F19:F82)=40.9044278; for date_PM=4/19/2011 was sum(F20:F83)/n(F20:F83)=84.40560404, etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know if that's still not clear. I have no idea how to do this in SQL..&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2017 17:42:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/352261#M82084</guid>
      <dc:creator>JWH1</dc:creator>
      <dc:date>2017-04-21T17:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 90-day average by site/date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/352281#M82088</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/140126"&gt;@JWH1&lt;/a&gt;: just checking to see if i understand what you're trying to do.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your example you are: (1) finding the first int_begin&amp;nbsp;where int_begin&amp;nbsp;is GE 1/1/2011 (i.e., the earliest date_PM in your dataset); (2) you are then taking the sum of all values for ConcSum that are within 90 days of the record found in step1; (3) you are dividing that by the ConcSum value of the earliest record used to calculate that sum; then (4) you are doing that same calculation for all remaining records in the file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please let us know if that is what you want to accomplish or if I misunderstood something.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2017 18:28:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Rolling-90-day-average-by-site-date/m-p/352281#M82088</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-04-21T18:28:46Z</dc:date>
    </item>
  </channel>
</rss>

