<?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: Taking average in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Taking-average/m-p/205698#M51216</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The dataset is huge, more that 20m observations and 44 vars. Because of that I can't uploaded here. The variables' formats are character, except date',which is date format, and sale's, which is numeric. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Jul 2015 20:10:38 GMT</pubDate>
    <dc:creator>m1986MM</dc:creator>
    <dc:date>2015-07-17T20:10:38Z</dc:date>
    <item>
      <title>Taking average</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Taking-average/m-p/205693#M51211</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;My dataset has 40 variables, for simplicity I show 7 of&amp;nbsp; them below:&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;branch&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;state&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;city&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;product&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;model&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;date&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;sale&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;I need to find the average sale of each product and model at any date, which is in the weekly manner.&lt;/P&gt;&lt;P&gt;I tries the following code:&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table average as&lt;/P&gt;&lt;P&gt;select product, model, date, mean(sale) as sale_ave &lt;/P&gt;&lt;P&gt;from original&lt;/P&gt;&lt;P&gt;group by product, &lt;SPAN style="font-size: 13.3333330154419px;"&gt;model, date;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;However, I found that this code gives me multiple values as sale_ave for each group of product, model, date.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;How can I fix this problem to have the real average value of the sale?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2015 18:01:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Taking-average/m-p/205693#M51211</guid>
      <dc:creator>m1986MM</dc:creator>
      <dc:date>2015-07-17T18:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: Taking average</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Taking-average/m-p/205694#M51212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The code you have is correct for what you are describing.&amp;nbsp; Try giving an example of what you have as input and what you want as output.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2015 18:36:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Taking-average/m-p/205694#M51212</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-07-17T18:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: Taking average</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Taking-average/m-p/205695#M51213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is part of the output I got:&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" height="150" style="width: 318px; height: 153px;" width="318"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="15" width="65"&gt;product &lt;/TD&gt;&lt;TD width="65"&gt;model&lt;/TD&gt;&lt;TD width="65"&gt;date&lt;/TD&gt;&lt;TD width="65"&gt;sale_ave&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="15"&gt;MCD100&lt;/TD&gt;&lt;TD&gt;MCD100-06&lt;/TD&gt;&lt;TD&gt;08W01&lt;/TD&gt;&lt;TD align="right"&gt;0.12&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="15"&gt;MCD100&lt;/TD&gt;&lt;TD&gt;MCD100-06&lt;/TD&gt;&lt;TD&gt;08W01&lt;/TD&gt;&lt;TD align="right"&gt;0.88&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="15"&gt;MCD100&lt;/TD&gt;&lt;TD&gt;MCD100-06&lt;/TD&gt;&lt;TD&gt;08W01&lt;/TD&gt;&lt;TD align="right"&gt;-0.08&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="15"&gt;MCD100&lt;/TD&gt;&lt;TD&gt;MCD100-06&lt;/TD&gt;&lt;TD&gt;08W02&lt;/TD&gt;&lt;TD align="right"&gt;0.22&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="15"&gt;MCD100&lt;/TD&gt;&lt;TD&gt;MCD100-06&lt;/TD&gt;&lt;TD&gt;08W02&lt;/TD&gt;&lt;TD align="right"&gt;0.45&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;As you see for the same amount of product, model, and date I have multiple value as average.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2015 18:45:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Taking-average/m-p/205695#M51213</guid>
      <dc:creator>m1986MM</dc:creator>
      <dc:date>2015-07-17T18:45:35Z</dc:date>
    </item>
    <item>
      <title>Re: Taking average</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Taking-average/m-p/205696#M51214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you provide some input as well?&amp;nbsp; How big is the dataset and how it sit inputted?&amp;nbsp; It's possible that there are spaces or other characters entered at some point.&amp;nbsp; Try a step like the 'prep' table below and see if this helps. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;infile cards dsd;&lt;/P&gt;&lt;P&gt;informat date mmddyy10.;&lt;/P&gt;&lt;P&gt;format date mmddyy10.;&lt;/P&gt;&lt;P&gt;input product$ model$ date sales;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;1,001,01/01/1990,300&lt;/P&gt;&lt;P&gt;1,001,01/01/1990,100&lt;/P&gt;&lt;P&gt;1,001,01/01/1990,100&lt;/P&gt;&lt;P&gt;1,001,01/02/1990,200&lt;/P&gt;&lt;P&gt;1,001,01/02/1990,300&lt;/P&gt;&lt;P&gt;1,001,01/02/1990,100&lt;/P&gt;&lt;P&gt;2,001,01/01/1990,222&lt;/P&gt;&lt;P&gt;2,001,01/01/1990,333&lt;/P&gt;&lt;P&gt;2,002,01/01/1990,555&lt;/P&gt;&lt;P&gt;2,002,01/01/1990,444&lt;/P&gt;&lt;P&gt;2,003,01/01/1990,999&lt;/P&gt;&lt;P&gt;2,003,01/01/1990,444&lt;/P&gt;&lt;P&gt;3,001,01/01/1990,222&lt;/P&gt;&lt;P&gt;3,002,01/01/1990,777&lt;/P&gt;&lt;P&gt;3,003,01/01/1990,300&lt;/P&gt;&lt;P&gt;3,004,01/01/1990,800&lt;/P&gt;&lt;P&gt;3,005,01/01/1990,500&lt;/P&gt;&lt;P&gt;3,006,01/01/1990,666&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data prep;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;product = strip(product);&lt;/P&gt;&lt;P&gt;model = strip(model);&lt;/P&gt;&lt;P&gt;date = strip(date);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table want as&lt;/P&gt;&lt;P&gt;select *,avg(sales) as average&lt;/P&gt;&lt;P&gt;from prep&lt;/P&gt;&lt;P&gt;group by product,model,date;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2015 19:16:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Taking-average/m-p/205696#M51214</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-07-17T19:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: Taking average</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Taking-average/m-p/205697#M51215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lost in translation. What you really want maybe the average on each date for ALL products and models instead of EACH product and models? otherwise, it hardly makes any sense to me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2015 19:34:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Taking-average/m-p/205697#M51215</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2015-07-17T19:34:52Z</dc:date>
    </item>
    <item>
      <title>Re: Taking average</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Taking-average/m-p/205698#M51216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The dataset is huge, more that 20m observations and 44 vars. Because of that I can't uploaded here. The variables' formats are character, except date',which is date format, and sale's, which is numeric. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2015 20:10:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Taking-average/m-p/205698#M51216</guid>
      <dc:creator>m1986MM</dc:creator>
      <dc:date>2015-07-17T20:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: Taking average</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Taking-average/m-p/205699#M51217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;no for each product. As I wrote in that code, I want the data to be grouped by product, model, and date. So I can have the average of sales for a specific product and model at a specific date.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2015 20:12:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Taking-average/m-p/205699#M51217</guid>
      <dc:creator>m1986MM</dc:creator>
      <dc:date>2015-07-17T20:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: Taking average</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Taking-average/m-p/205700#M51218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Proc SQL does not use formats when calculating GROUP BY. Either create a Week variable or use a proc such as proc means or summary. &lt;/P&gt;&lt;P&gt;You can see this by removing the format from the date variable in your output data set. It will show different days. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2015 21:31:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Taking-average/m-p/205700#M51218</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-07-17T21:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: Taking average</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Taking-average/m-p/205701#M51219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried to create a week variable. I tried these ways:&lt;/P&gt;&lt;P&gt;data new; set old;&lt;/P&gt;&lt;P&gt;format date weekv5.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;Does the above code change the value of date into weekly intervals?&lt;/P&gt;&lt;P&gt;I also used this:&lt;/P&gt;&lt;P&gt;date_week=put(date, weekv5.);&lt;/P&gt;&lt;P&gt;but the output is in the character format but I need it to be numeric.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2015 21:55:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Taking-average/m-p/205701#M51219</guid>
      <dc:creator>m1986MM</dc:creator>
      <dc:date>2015-07-17T21:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: Taking average</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Taking-average/m-p/205702#M51220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try instead:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc sql;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;create table average as&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; product, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; model, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; intnx("WEEK.2",date,0) as week format=weekv5., &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mean(sale) as sale_ave&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;from original&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;group by product, model, calculated week;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WEEK.2 weeks start on Mondays, like the WEEKV. format&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2015 22:07:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Taking-average/m-p/205702#M51220</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-07-17T22:07:37Z</dc:date>
    </item>
    <item>
      <title>Re: Taking average</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Taking-average/m-p/205703#M51221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The date is the same no matter what the format, I didn't catch that your date is in a date format before.&amp;nbsp; The date is always the same to SAS, so any difference in days won't be displayed in your format but it's still a different date.&amp;nbsp; I would recommend adding an extra variable that has date as a character.&amp;nbsp; You can use this column to group by but keep your date column as a date for any other purposes. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2015 22:08:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Taking-average/m-p/205703#M51221</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-07-17T22:08:06Z</dc:date>
    </item>
    <item>
      <title>Re: Taking average</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Taking-average/m-p/205704#M51222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's your solution, not ideal because of the size of the dataset but this will work.&amp;nbsp; As far as I know you can't do this in one step, you'll have to break it down like this. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;infile cards dsd;&lt;/P&gt;&lt;P&gt;informat date mmddyy10.;&lt;/P&gt;&lt;P&gt;format date weekv5.;&lt;/P&gt;&lt;P&gt;input product$ model$ date sales;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;1,001,01/01/1990,300&lt;/P&gt;&lt;P&gt;1,001,01/02/1990,100&lt;/P&gt;&lt;P&gt;1,001,01/03/1990,100&lt;/P&gt;&lt;P&gt;1,001,01/04/1990,200&lt;/P&gt;&lt;P&gt;1,001,01/05/1990,300&lt;/P&gt;&lt;P&gt;1,001,01/06/1990,100&lt;/P&gt;&lt;P&gt;2,001,01/05/1990,222&lt;/P&gt;&lt;P&gt;2,001,01/06/1990,333&lt;/P&gt;&lt;P&gt;2,002,01/07/1990,555&lt;/P&gt;&lt;P&gt;2,002,01/08/1990,444&lt;/P&gt;&lt;P&gt;2,003,01/09/1990,999&lt;/P&gt;&lt;P&gt;2,003,01/10/1990,444&lt;/P&gt;&lt;P&gt;3,001,01/05/1990,222&lt;/P&gt;&lt;P&gt;3,002,01/06/1990,777&lt;/P&gt;&lt;P&gt;3,003,01/06/1990,300&lt;/P&gt;&lt;P&gt;3,004,01/07/1990,800&lt;/P&gt;&lt;P&gt;3,005,01/08/1990,500&lt;/P&gt;&lt;P&gt;3,006,01/09/1990,666&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data prep;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;date_c = input(put(date,weekv5.),$5.);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table want as&lt;/P&gt;&lt;P&gt;select distinct product,model,date,sales,avg(sales) as average&lt;/P&gt;&lt;P&gt;from prep&lt;/P&gt;&lt;P&gt;group by product,model,date_c;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2015 22:30:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Taking-average/m-p/205704#M51222</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-07-17T22:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: Taking average</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Taking-average/m-p/205705#M51223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the output of &lt;SPAN style="font-size: 13px; background-color: #ffffff; text-decoration: underline; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;date_c = input(put(date,weekv5.),$5.);&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt; is character, but I need it to be numeric to do date functions. Do you know how I can make it?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jul 2015 22:44:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Taking-average/m-p/205705#M51223</guid>
      <dc:creator>m1986MM</dc:creator>
      <dc:date>2015-07-17T22:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: Taking average</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Taking-average/m-p/205706#M51224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Keep both the variable you formatted and the created variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or as I initially suggested, use a proc means or proc summary and avoid the extra step entirely.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc means data=original mean nway;&lt;/P&gt;&lt;P&gt;class product model date;&lt;/P&gt;&lt;P&gt;var sale;&lt;/P&gt;&lt;P&gt;ods output summarytable=want;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Jul 2015 01:52:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Taking-average/m-p/205706#M51224</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-07-18T01:52:48Z</dc:date>
    </item>
    <item>
      <title>Re: Taking average</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Taking-average/m-p/205707#M51225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It seems that with this code the value of 'calculated week' is still in date format but not week, right?&lt;/P&gt;&lt;P&gt;If so, do you know how I can make it to be weekly, since I need to group my observation and find the average in weekly intervals.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Jul 2015 17:19:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Taking-average/m-p/205707#M51225</guid>
      <dc:creator>m1986MM</dc:creator>
      <dc:date>2015-07-18T17:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: Taking average</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Taking-average/m-p/205708#M51226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Apply a week format to the date variable within the proc means.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 20px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;proc means data=original mean nway;&lt;/P&gt;&lt;P style="font-size: 20px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;class product model date;&lt;/P&gt;&lt;P style="font-size: 20px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;var sale;&lt;/P&gt;&lt;P style="font-size: 20px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;ods output summarytable=want;&lt;/P&gt;&lt;P style="font-size: 20px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;format date weekv5.;&lt;/P&gt;&lt;P style="font-size: 20px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Jul 2015 17:44:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Taking-average/m-p/205708#M51226</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-07-18T17:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: Taking average</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Taking-average/m-p/205709#M51227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Variable WEEK is a SAS date. It is the date of the first day of the week which is set to start on a Monday. That's what function INTNX returns. By associating variable WEEK to format WEEKV5., the date is formatted as a week number. You can group on variable WEEK since all days belonging to the same week (starting on Monday) will have the same value for WEEK. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Jul 2015 18:54:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Taking-average/m-p/205709#M51227</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-07-18T18:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: Taking average</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Taking-average/m-p/205710#M51228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Jul 2015 22:55:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Taking-average/m-p/205710#M51228</guid>
      <dc:creator>m1986MM</dc:creator>
      <dc:date>2015-07-18T22:55:52Z</dc:date>
    </item>
  </channel>
</rss>

