<?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 Calculating Average Number of Employees per month in All Things Community</title>
    <link>https://communities.sas.com/t5/All-Things-Community/Calculating-Average-Number-of-Employees-per-month/m-p/246443#M1348</link>
    <description>&lt;P&gt;Hello everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm a new user of SAS and I'm learning how to use it more and more each day so please&amp;nbsp;I apologize if this is a basic question.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have built a process using SAS EG to help me identify turnover for our organization. In this process I need to calculate the total number of employees on average for a month. Below is a recap on what I have in the table:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;BR /&gt;CREATE TABLE WORK.QUERY_FOR_HISTAPPT AS&lt;BR /&gt;SELECT t1.DATECRED,&lt;BR /&gt;t1.DATECRED_DC,&lt;BR /&gt;t1.DATE_EFF,&lt;BR /&gt;t1.DATE_EFF_DC,&lt;BR /&gt;t1.LEGISTCD,&lt;BR /&gt;t1.OCC_CD,&lt;BR /&gt;t1.OCCTITLE,&lt;BR /&gt;t1.EMP_ID,&lt;BR /&gt;t1.EMPNAME,&lt;BR /&gt;t1.BUNITNO,&lt;BR /&gt;t1.BUNITCD,&lt;BR /&gt;t1.APPLOCCD,&lt;BR /&gt;t1.SUBLOCCD,&lt;BR /&gt;t1.POS_TYPE,&lt;BR /&gt;t1.STUDTITL,&lt;BR /&gt;t1.OCCGRADE,&lt;BR /&gt;t1.position&lt;BR /&gt;FROM HRMS.HISTAPPT t1&lt;BR /&gt;WHERE t1.DATECRED BETWEEN '20110630' AND '20110731' AND t1.EMP_ID NOT = '000000' AND t1.STUDTITL NOT = 'Y' AND&lt;BR /&gt;t1.OCC_CD NOT IN&lt;BR /&gt;(&lt;BR /&gt;'2903',&lt;BR /&gt;'2472',&lt;BR /&gt;'2902',&lt;BR /&gt;'2460',&lt;BR /&gt;'2441',&lt;BR /&gt;'2442',&lt;BR /&gt;'2476',&lt;BR /&gt;'2443',&lt;BR /&gt;'2478',&lt;BR /&gt;'2950',&lt;BR /&gt;'2901',&lt;BR /&gt;'2487',&lt;BR /&gt;'2907',&lt;BR /&gt;'2471',&lt;BR /&gt;'2479',&lt;BR /&gt;'2464',&lt;BR /&gt;'2465',&lt;BR /&gt;'2473',&lt;BR /&gt;'2440',&lt;BR /&gt;'2463',&lt;BR /&gt;'2445',&lt;BR /&gt;'2448',&lt;BR /&gt;'2908',&lt;BR /&gt;'2906',&lt;BR /&gt;'2475',&lt;BR /&gt;'2904',&lt;BR /&gt;'2474',&lt;BR /&gt;'2461',&lt;BR /&gt;'2462'&lt;BR /&gt;) AND t1.SUBLOCCD NOT = 'ACAD';&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ok, So I am pulling in all employees in an appointed positions at the end of two months, so all records are in this one table. Now I want to see if I can get the average number of employees by position type for that timeframe. I can get the actual numbers in a summary table; however, the average is really what I need. Any help would be greatly appreciated!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Shannon&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 27 Jan 2016 20:09:20 GMT</pubDate>
    <dc:creator>slolive</dc:creator>
    <dc:date>2016-01-27T20:09:20Z</dc:date>
    <item>
      <title>Calculating Average Number of Employees per month</title>
      <link>https://communities.sas.com/t5/All-Things-Community/Calculating-Average-Number-of-Employees-per-month/m-p/246443#M1348</link>
      <description>&lt;P&gt;Hello everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm a new user of SAS and I'm learning how to use it more and more each day so please&amp;nbsp;I apologize if this is a basic question.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have built a process using SAS EG to help me identify turnover for our organization. In this process I need to calculate the total number of employees on average for a month. Below is a recap on what I have in the table:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;BR /&gt;CREATE TABLE WORK.QUERY_FOR_HISTAPPT AS&lt;BR /&gt;SELECT t1.DATECRED,&lt;BR /&gt;t1.DATECRED_DC,&lt;BR /&gt;t1.DATE_EFF,&lt;BR /&gt;t1.DATE_EFF_DC,&lt;BR /&gt;t1.LEGISTCD,&lt;BR /&gt;t1.OCC_CD,&lt;BR /&gt;t1.OCCTITLE,&lt;BR /&gt;t1.EMP_ID,&lt;BR /&gt;t1.EMPNAME,&lt;BR /&gt;t1.BUNITNO,&lt;BR /&gt;t1.BUNITCD,&lt;BR /&gt;t1.APPLOCCD,&lt;BR /&gt;t1.SUBLOCCD,&lt;BR /&gt;t1.POS_TYPE,&lt;BR /&gt;t1.STUDTITL,&lt;BR /&gt;t1.OCCGRADE,&lt;BR /&gt;t1.position&lt;BR /&gt;FROM HRMS.HISTAPPT t1&lt;BR /&gt;WHERE t1.DATECRED BETWEEN '20110630' AND '20110731' AND t1.EMP_ID NOT = '000000' AND t1.STUDTITL NOT = 'Y' AND&lt;BR /&gt;t1.OCC_CD NOT IN&lt;BR /&gt;(&lt;BR /&gt;'2903',&lt;BR /&gt;'2472',&lt;BR /&gt;'2902',&lt;BR /&gt;'2460',&lt;BR /&gt;'2441',&lt;BR /&gt;'2442',&lt;BR /&gt;'2476',&lt;BR /&gt;'2443',&lt;BR /&gt;'2478',&lt;BR /&gt;'2950',&lt;BR /&gt;'2901',&lt;BR /&gt;'2487',&lt;BR /&gt;'2907',&lt;BR /&gt;'2471',&lt;BR /&gt;'2479',&lt;BR /&gt;'2464',&lt;BR /&gt;'2465',&lt;BR /&gt;'2473',&lt;BR /&gt;'2440',&lt;BR /&gt;'2463',&lt;BR /&gt;'2445',&lt;BR /&gt;'2448',&lt;BR /&gt;'2908',&lt;BR /&gt;'2906',&lt;BR /&gt;'2475',&lt;BR /&gt;'2904',&lt;BR /&gt;'2474',&lt;BR /&gt;'2461',&lt;BR /&gt;'2462'&lt;BR /&gt;) AND t1.SUBLOCCD NOT = 'ACAD';&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ok, So I am pulling in all employees in an appointed positions at the end of two months, so all records are in this one table. Now I want to see if I can get the average number of employees by position type for that timeframe. I can get the actual numbers in a summary table; however, the average is really what I need. Any help would be greatly appreciated!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Shannon&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2016 20:09:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/Calculating-Average-Number-of-Employees-per-month/m-p/246443#M1348</guid>
      <dc:creator>slolive</dc:creator>
      <dc:date>2016-01-27T20:09:20Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Average Number of Employees per month</title>
      <link>https://communities.sas.com/t5/All-Things-Community/Calculating-Average-Number-of-Employees-per-month/m-p/246452#M1349</link>
      <description>&lt;P&gt;What are you defining as average? Over the two months?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please post some sample data and expected output.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2016 20:32:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/Calculating-Average-Number-of-Employees-per-month/m-p/246452#M1349</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-27T20:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Average Number of Employees per month</title>
      <link>https://communities.sas.com/t5/All-Things-Community/Calculating-Average-Number-of-Employees-per-month/m-p/246455#M1350</link>
      <description>&lt;P&gt;Here's what I'm doing currently, I'm taking the summary table and dumping it into excel and then calculating the average by taking the total number of employees at the end of the two months, adding them together then dividing the total by 2.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=(total employees on 20110731) + (total employees on 20110831))/2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached an image of the summary table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Shannon&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12241i029520FAAAB08756/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="SAS Summary Table.png" title="SAS Summary Table.png" /&gt;</description>
      <pubDate>Wed, 27 Jan 2016 20:42:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/Calculating-Average-Number-of-Employees-per-month/m-p/246455#M1350</guid>
      <dc:creator>slolive</dc:creator>
      <dc:date>2016-01-27T20:42:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Average Number of Employees per month</title>
      <link>https://communities.sas.com/t5/All-Things-Community/Calculating-Average-Number-of-Employees-per-month/m-p/246461#M1351</link>
      <description>&lt;P&gt;But how are you generating that table? Is it through proc tabulate?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We need to see a sample of the data structure that you'd be working with in SAS.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2016 20:47:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/Calculating-Average-Number-of-Employees-per-month/m-p/246461#M1351</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-27T20:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Average Number of Employees per month</title>
      <link>https://communities.sas.com/t5/All-Things-Community/Calculating-Average-Number-of-Employees-per-month/m-p/246465#M1352</link>
      <description>&lt;P&gt;Okay, so when I look at the code for the summary table is does say Proc Tabulate. I am attaching a screenshot.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12243i83136222A298DB72/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Log.png" title="Log.png" /&gt;</description>
      <pubDate>Wed, 27 Jan 2016 20:53:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/Calculating-Average-Number-of-Employees-per-month/m-p/246465#M1352</guid>
      <dc:creator>slolive</dc:creator>
      <dc:date>2016-01-27T20:53:58Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Average Number of Employees per month</title>
      <link>https://communities.sas.com/t5/All-Things-Community/Calculating-Average-Number-of-Employees-per-month/m-p/246468#M1353</link>
      <description>&lt;P&gt;Ok&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try changing the statistics requested - I'm assuming you're using a table builder of sorts.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Where it has N, you can add Mean&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(N={Label="Frequency"} Mean{Label="Mean"})&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can play around with it to see if generates what you need.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2016 20:59:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/Calculating-Average-Number-of-Employees-per-month/m-p/246468#M1353</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-27T20:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Average Number of Employees per month</title>
      <link>https://communities.sas.com/t5/All-Things-Community/Calculating-Average-Number-of-Employees-per-month/m-p/246471#M1354</link>
      <description>Thanks Reeza.</description>
      <pubDate>Wed, 27 Jan 2016 21:06:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/Calculating-Average-Number-of-Employees-per-month/m-p/246471#M1354</guid>
      <dc:creator>slolive</dc:creator>
      <dc:date>2016-01-27T21:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Average Number of Employees per month</title>
      <link>https://communities.sas.com/t5/All-Things-Community/Calculating-Average-Number-of-Employees-per-month/m-p/246491#M1355</link>
      <description>&lt;P&gt;After thinking about it, I don't think it will generate your answer. In fact, I'm not sure it's possible within proc tabulate &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2016 22:00:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/Calculating-Average-Number-of-Employees-per-month/m-p/246491#M1355</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-27T22:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Average Number of Employees per month</title>
      <link>https://communities.sas.com/t5/All-Things-Community/Calculating-Average-Number-of-Employees-per-month/m-p/246500#M1356</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/67398"&gt;@slolive&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Okay, so when I look at the code for the summary table is does say Proc Tabulate. I am attaching a screenshot.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Run the Tabulate code with an Out=SummaryData on the proc statement. This will create a data set with the monthly totals.&lt;/P&gt;
&lt;P&gt;Use that data to calculate the mean. Note that the summary variables in the dataset will have suffixes such as _sum added to them, so you can't just use the exact same tabulate code. But it shouldn't be horrific.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If we had an actual input data set example we could provide more exact code example.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2016 23:36:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/Calculating-Average-Number-of-Employees-per-month/m-p/246500#M1356</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-01-27T23:36:25Z</dc:date>
    </item>
  </channel>
</rss>

