<?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: how to do do some means and other calculations for daily data in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-do-do-some-means-and-other-calculations-for-daily-data/m-p/312476#M21099</link>
    <description>&lt;P&gt;proc sql;&lt;BR /&gt;create table WANT as&lt;BR /&gt;select year(DATE) as YR,&lt;BR /&gt;count(ET) as RESULT&lt;BR /&gt;from HAVE&lt;BR /&gt;group by year(DATE);&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;does not work &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;in the result there are 19 rows and each rows has 2016 and 19 as YR and Result.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2016 19&lt;BR /&gt;2016 19&lt;BR /&gt;2016 19&lt;BR /&gt;2016 19&lt;BR /&gt;2016 19&lt;BR /&gt;. .&lt;BR /&gt;. .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
   CREATE TABLE HAVE01 AS 
   SELECT t1.*, t1.Date FORMAT=YEAR4. LABEL="Year" AS Year 
            FROM HAVE t1;
 QUIT;

PROC SQL;
   CREATE TABLE WANT AS 
   SELECT Year, (COUNT(ET)) AS COUNT_of_ET
      FROM HAVE01
      GROUP BY Year;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And expected somthing like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="lang-sql prettyprint prettyprinted"&gt;&lt;CODE&gt;&lt;SPAN class="pln"&gt;Year    Count_of_ET&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="lit"&gt;2015&lt;/SPAN&gt;    &lt;SPAN class="lit"&gt;4&lt;/SPAN&gt;
&lt;SPAN class="lit"&gt;2016&lt;/SPAN&gt;    &lt;SPAN class="lit"&gt;15&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But got like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="lang-sql prettyprint prettyprinted"&gt;&lt;CODE&gt;&lt;SPAN class="pln"&gt;Year    Count_of_ET&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="lit"&gt;2015&lt;/SPAN&gt;    &lt;SPAN class="lit"&gt;2&lt;/SPAN&gt;
&lt;SPAN class="lit"&gt;2015&lt;/SPAN&gt;    &lt;SPAN class="lit"&gt;1&lt;/SPAN&gt;
&lt;SPAN class="lit"&gt;2015&lt;/SPAN&gt;    &lt;SPAN class="lit"&gt;1&lt;/SPAN&gt;
&lt;SPAN class="lit"&gt;2016&lt;/SPAN&gt;    &lt;SPAN class="lit"&gt;1&lt;/SPAN&gt;
&lt;SPAN class="lit"&gt;2016&lt;/SPAN&gt;    &lt;SPAN class="lit"&gt;2&lt;/SPAN&gt;
&lt;SPAN class="lit"&gt;2016&lt;/SPAN&gt;    &lt;SPAN class="lit"&gt;1&lt;/SPAN&gt;
&lt;SPAN class="lit"&gt;2016&lt;/SPAN&gt;    &lt;SPAN class="lit"&gt;4&lt;/SPAN&gt;
&lt;SPAN class="lit"&gt;2016&lt;/SPAN&gt;    &lt;SPAN class="lit"&gt;2&lt;/SPAN&gt;
&lt;SPAN class="lit"&gt;2016&lt;/SPAN&gt;    &lt;SPAN class="lit"&gt;2&lt;/SPAN&gt;
&lt;SPAN class="lit"&gt;2016&lt;/SPAN&gt;    &lt;SPAN class="lit"&gt;3&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 17 Nov 2016 22:37:29 GMT</pubDate>
    <dc:creator>imanojkumar1</dc:creator>
    <dc:date>2016-11-17T22:37:29Z</dc:date>
    <item>
      <title>how to do do some means and other calculations for daily data</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-do-do-some-means-and-other-calculations-for-daily-data/m-p/312372#M21088</link>
      <description>&lt;P&gt;I have the following dataset and what I want to do is listed below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
 infile cards truncover expandtabs;
 input MC $ ET $ Date :date9. Time :time. PMC $ PXMC $ Site $ Dia MV SF;
 format date date8. Time HHMM.;
 cards;
US000409 Meas 12Nov2016 17:26 7101 Et1 1 . 2780462.00000 1
US000409 Meas 12Nov2016 17:33 7101 Et1 1 861.26 2780462.00000 1
US000409 Lath 12Nov2016 17:33 7102 Et1 1 861.6 2780462.00000 1
US01036 Meas 12Nov2016 17:26 7101 Et1 2 . 522860.00000 1
US01036 Lath 13Nov2016 17:33 7202 Et1 2 866.68 522860.00000 1
US01036 Meas 13Nov2016 17:33 7101 Et1 2 867.36 522860.00000 1
US02044 Meas 13Nov2016 17:26 7202 Et1 1 . 569298.00000 1
US02044 Lath 13Nov2016 17:33 7202 Et1 1 865.32 569298.00000 1
US02044 Meas 14Nov2016 17:33 7202 Et1 2 865.68 569298.00000 1
US318 Lath 14Nov2016 17:26 7101 Et2 2 . 2630856.00000 1
US318 Meas 14Nov2016 17:33 7202 Et2 3 863.26 2630856.00000 1
US318 Lath 14Nov2016 17:33 7202 Et2 3 863.94 2630856.00000 1
US000409 Meas 15Nov2016 21:56 7202 Et2 3 860.98 2780462.00000 1
US000409 Meas 15Nov2016 21:56 7203 Et2 4 861.5 2780462.00000 1
US01036 Lath 16Nov2016 21:56 7101 Et2 4 866.64 522860.00000 1
US01036 Meas 16Nov2016 21:56 7202 Et2 4 867.34 522860.00000 1
US02044 Lath 17Nov2016 21:56 7203 Et2 1 865.3 569298.00000 1
US02044 Meas 17Nov2016 21:56 7204 Et2 3 865.68 569298.00000 1
US318 Lath 17Nov2016 21:56 7204 Et2 2 863.24 2630856.00000 1
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to compuet:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. &lt;STRONG&gt;Daily Mean&lt;/STRONG&gt; of '&lt;STRONG&gt;Dia&lt;/STRONG&gt;' for each '&lt;STRONG&gt;MC'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;2. For each '&lt;STRONG&gt;PMC&lt;/STRONG&gt;', step 1 above&lt;/P&gt;&lt;P&gt;3. For each '&lt;STRONG&gt;MC&lt;/STRONG&gt;', what is the difference between '&lt;STRONG&gt;MV&lt;/STRONG&gt;'&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;4. &lt;/STRONG&gt;For each &lt;STRONG&gt;Year&lt;/STRONG&gt; in&lt;STRONG&gt; 'Date', &lt;/STRONG&gt;how many conts&lt;STRONG&gt; 'Lath' &lt;/STRONG&gt;are there for each&lt;STRONG&gt; 'MC'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me learning SAS. Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2016 16:37:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-do-do-some-means-and-other-calculations-for-daily-data/m-p/312372#M21088</guid>
      <dc:creator>imanojkumar1</dc:creator>
      <dc:date>2016-11-17T16:37:40Z</dc:date>
    </item>
    <item>
      <title>Re: how to do do some means and other calculations for daily data</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-do-do-some-means-and-other-calculations-for-daily-data/m-p/312382#M21090</link>
      <description>&lt;P&gt;Well (note, make sure dataset is sorted)&lt;/P&gt;
&lt;P&gt;1) &amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc means ...;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; by mc date;&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2)&lt;/P&gt;
&lt;P&gt;proc means ...;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; by pmc date;&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3)&lt;/P&gt;
&lt;P&gt;Not sure what you mean, do you mean difference between largest, and smallest, first/last, sum them all - first?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;4)&lt;/P&gt;
&lt;P&gt;proc sql;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; create table WANT as&lt;/P&gt;
&lt;P&gt;&amp;nbsp; select &amp;nbsp;yearpart(DATE) as YR,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; count(ET) as RESULT&lt;/P&gt;
&lt;P&gt;&amp;nbsp; from &amp;nbsp; HAVE &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; group by yearpart(DATE);&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The above have many examples in the SAS documentation, and on here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do also note, you could do all of the given problems in one datastep, use retain variables, and set your by groups, but maybe best to learn to do each bit before jumping in.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2016 16:43:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-do-do-some-means-and-other-calculations-for-daily-data/m-p/312382#M21090</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-11-17T16:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: how to do do some means and other calculations for daily data</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-do-do-some-means-and-other-calculations-for-daily-data/m-p/312458#M21095</link>
      <description>&lt;P&gt;Thank you so much.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in 3). &amp;nbsp;I means MV2 - MV1 i.e. current - lag value (but datewise)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in 2). &amp;nbsp;&lt;STRONG&gt;Daily Mean&lt;/STRONG&gt;&lt;SPAN&gt; of '&lt;/SPAN&gt;&lt;STRONG&gt;Dia&lt;/STRONG&gt;&lt;SPAN&gt;' for each '&lt;/SPAN&gt;&lt;STRONG&gt;MC' grouped by&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I appreciate your advice. I just started learning SAS and miles to go. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2016 20:58:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-do-do-some-means-and-other-calculations-for-daily-data/m-p/312458#M21095</guid>
      <dc:creator>imanojkumar1</dc:creator>
      <dc:date>2016-11-17T20:58:24Z</dc:date>
    </item>
    <item>
      <title>Re: how to do do some means and other calculations for daily data</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-do-do-some-means-and-other-calculations-for-daily-data/m-p/312469#M21096</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/102075"&gt;@imanojkumar1&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thank you so much.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in 3). &amp;nbsp;I means MV2 - MV1 i.e. current - lag value (but datewise)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you want to calculate the current record difference from the previous record for the same variable SAS provides a function DIF to do that.&lt;/P&gt;
&lt;P&gt;However do you want that different only with the same date (from your datewise comment) or the max difference between two days, the range for a given date (maximum - minimum)&amp;nbsp;&amp;nbsp;or something else? And do you what that comparison to go across ET? Is the data allowed to be sorted so that all of MC are together?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another fundamental question is also do you expect a data set as the result or a report for people to read? It may help a bit to show what you would expect to see from your given example data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2016 23:09:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-do-do-some-means-and-other-calculations-for-daily-data/m-p/312469#M21096</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-11-17T23:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: how to do do some means and other calculations for daily data</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-do-do-some-means-and-other-calculations-for-daily-data/m-p/312473#M21097</link>
      <description>&lt;P&gt;yes Sorting is possible on all the variable except for SF. Thanks for the advice.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please let me know how DIF can be used here?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2016 21:56:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-do-do-some-means-and-other-calculations-for-daily-data/m-p/312473#M21097</guid>
      <dc:creator>imanojkumar1</dc:creator>
      <dc:date>2016-11-17T21:56:28Z</dc:date>
    </item>
    <item>
      <title>Re: how to do do some means and other calculations for daily data</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-do-do-some-means-and-other-calculations-for-daily-data/m-p/312475#M21098</link>
      <description>&lt;P&gt;I think is it...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
  create table WANT as
  select  year(DATE) as YR,
            count(ET) as RESULT
  from   HAVE  
  group by year(DATE);
quit;


*For timestamp it will be year(datepart(datetimestamp));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Nov 2016 22:07:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-do-do-some-means-and-other-calculations-for-daily-data/m-p/312475#M21098</guid>
      <dc:creator>imanojkumar1</dc:creator>
      <dc:date>2016-11-17T22:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: how to do do some means and other calculations for daily data</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-do-do-some-means-and-other-calculations-for-daily-data/m-p/312476#M21099</link>
      <description>&lt;P&gt;proc sql;&lt;BR /&gt;create table WANT as&lt;BR /&gt;select year(DATE) as YR,&lt;BR /&gt;count(ET) as RESULT&lt;BR /&gt;from HAVE&lt;BR /&gt;group by year(DATE);&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;does not work &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;in the result there are 19 rows and each rows has 2016 and 19 as YR and Result.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2016 19&lt;BR /&gt;2016 19&lt;BR /&gt;2016 19&lt;BR /&gt;2016 19&lt;BR /&gt;2016 19&lt;BR /&gt;. .&lt;BR /&gt;. .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
   CREATE TABLE HAVE01 AS 
   SELECT t1.*, t1.Date FORMAT=YEAR4. LABEL="Year" AS Year 
            FROM HAVE t1;
 QUIT;

PROC SQL;
   CREATE TABLE WANT AS 
   SELECT Year, (COUNT(ET)) AS COUNT_of_ET
      FROM HAVE01
      GROUP BY Year;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And expected somthing like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="lang-sql prettyprint prettyprinted"&gt;&lt;CODE&gt;&lt;SPAN class="pln"&gt;Year    Count_of_ET&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="lit"&gt;2015&lt;/SPAN&gt;    &lt;SPAN class="lit"&gt;4&lt;/SPAN&gt;
&lt;SPAN class="lit"&gt;2016&lt;/SPAN&gt;    &lt;SPAN class="lit"&gt;15&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But got like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="lang-sql prettyprint prettyprinted"&gt;&lt;CODE&gt;&lt;SPAN class="pln"&gt;Year    Count_of_ET&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="lit"&gt;2015&lt;/SPAN&gt;    &lt;SPAN class="lit"&gt;2&lt;/SPAN&gt;
&lt;SPAN class="lit"&gt;2015&lt;/SPAN&gt;    &lt;SPAN class="lit"&gt;1&lt;/SPAN&gt;
&lt;SPAN class="lit"&gt;2015&lt;/SPAN&gt;    &lt;SPAN class="lit"&gt;1&lt;/SPAN&gt;
&lt;SPAN class="lit"&gt;2016&lt;/SPAN&gt;    &lt;SPAN class="lit"&gt;1&lt;/SPAN&gt;
&lt;SPAN class="lit"&gt;2016&lt;/SPAN&gt;    &lt;SPAN class="lit"&gt;2&lt;/SPAN&gt;
&lt;SPAN class="lit"&gt;2016&lt;/SPAN&gt;    &lt;SPAN class="lit"&gt;1&lt;/SPAN&gt;
&lt;SPAN class="lit"&gt;2016&lt;/SPAN&gt;    &lt;SPAN class="lit"&gt;4&lt;/SPAN&gt;
&lt;SPAN class="lit"&gt;2016&lt;/SPAN&gt;    &lt;SPAN class="lit"&gt;2&lt;/SPAN&gt;
&lt;SPAN class="lit"&gt;2016&lt;/SPAN&gt;    &lt;SPAN class="lit"&gt;2&lt;/SPAN&gt;
&lt;SPAN class="lit"&gt;2016&lt;/SPAN&gt;    &lt;SPAN class="lit"&gt;3&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2016 22:37:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-do-do-some-means-and-other-calculations-for-daily-data/m-p/312476#M21099</guid>
      <dc:creator>imanojkumar1</dc:creator>
      <dc:date>2016-11-17T22:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: how to do do some means and other calculations for daily data</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-do-do-some-means-and-other-calculations-for-daily-data/m-p/312554#M21100</link>
      <description>&lt;P&gt;Well, look at the code you have written versus the code I provided. &amp;nbsp;You will note that you both select, and group by a variable called year, which is in fact a date, applying a format does&amp;nbsp;&lt;STRONG&gt;not&lt;/STRONG&gt; change the underlying data, only how it is displayed. &amp;nbsp;So behind the scenes you are grouping your data based on the full data. &amp;nbsp;Why did you not use the year() function as I provided above?&lt;/P&gt;
&lt;P&gt;Oh, and&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/102075"&gt;@imanojkumar1﻿&lt;/a&gt;&amp;nbsp;is correct, the functions are year() not yearpart():&lt;/P&gt;
&lt;PRE&gt;proc sql;
  create table WANT as
  select  year(DATE) as YR,
          count(ET) as RESULT
  from    HAVE  
  group by year(DATE);
quit;&lt;/PRE&gt;</description>
      <pubDate>Fri, 18 Nov 2016 09:13:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-do-do-some-means-and-other-calculations-for-daily-data/m-p/312554#M21100</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-11-18T09:13:45Z</dc:date>
    </item>
  </channel>
</rss>

