<?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: active activity counts by month in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/active-activity-counts-by-month/m-p/352878#M23292</link>
    <description>&lt;P&gt;Hi again&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can see, that the programming is restricted to the table i maid. It is an example of the data set i have.&amp;nbsp;&lt;/P&gt;&lt;P&gt;To be more specific, i have 30 activities and each activity has 30 or more observations, that I wish to count.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The end_date has '.' and is not missing, when it is still active. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you sooo much for your time and help - it is appreciated &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 24 Apr 2017 14:36:06 GMT</pubDate>
    <dc:creator>miss_vang</dc:creator>
    <dc:date>2017-04-24T14:36:06Z</dc:date>
    <item>
      <title>active activity counts by month</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/active-activity-counts-by-month/m-p/352631#M23269</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have Enterprise guide 7.1&lt;/P&gt;&lt;P&gt;I have a table, which looks like this:&lt;/P&gt;&lt;P&gt;activity&amp;nbsp;&amp;nbsp;startdate&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; enddate&lt;/P&gt;&lt;P&gt;act 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01-10-2016&amp;nbsp;&amp;nbsp; 15-01-2017&lt;/P&gt;&lt;P&gt;act 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 24-02-2015&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;act 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 06-05-2014&amp;nbsp;&amp;nbsp;&amp;nbsp; 23-06-2016&lt;/P&gt;&lt;P&gt;act 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;20-10-2016&amp;nbsp;&amp;nbsp;&amp;nbsp;23-04-2017&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and I want a table, which looks like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;activity&amp;nbsp;01-2016&amp;nbsp; 02-2016&amp;nbsp;&amp;nbsp;03-2016&amp;nbsp; 04-2016&amp;nbsp; 05-2016 ....&amp;nbsp; 03-2017&lt;/P&gt;&lt;P&gt;act&amp;nbsp;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6&lt;/P&gt;&lt;P&gt;act&amp;nbsp;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;1&lt;/P&gt;&lt;P&gt;act&amp;nbsp;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can transform first table to the second table? I would really like to make it, so it continues 'forever'?&lt;/P&gt;&lt;P&gt;Thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Apr 2017 19:20:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/active-activity-counts-by-month/m-p/352631#M23269</guid>
      <dc:creator>miss_vang</dc:creator>
      <dc:date>2017-04-23T19:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: active activity counts by month</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/active-activity-counts-by-month/m-p/352638#M23270</link>
      <description>&lt;P&gt;A couple of questions:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. What do the numbers under the various date columns represet?&lt;/P&gt;
&lt;P&gt;2, Do you want the columns to represent month-year?&lt;/P&gt;
&lt;P&gt;3. What do you want to show when there is a start date, but no end date?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;</description>
      <pubDate>Sun, 23 Apr 2017 19:53:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/active-activity-counts-by-month/m-p/352638#M23270</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-04-23T19:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: active activity counts by month</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/active-activity-counts-by-month/m-p/352642#M23271</link>
      <description>1. It counts how many observations of that activity has been active that specific month represented in the table. -&lt;BR /&gt;2. Columbs should represent á specific month in a specific year&lt;BR /&gt;3. My first table continously update, so I need the activity to count, when there is no enddate (still active) I need my table to take future periods in to account when they occur. When we go into May, then May will appear in table&lt;BR /&gt;Is it possible to make such a table?</description>
      <pubDate>Sun, 23 Apr 2017 20:24:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/active-activity-counts-by-month/m-p/352642#M23271</guid>
      <dc:creator>miss_vang</dc:creator>
      <dc:date>2017-04-23T20:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: active activity counts by month</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/active-activity-counts-by-month/m-p/352644#M23272</link>
      <description>The table should look like this:&lt;BR /&gt;Activity 01-2016 02-2016 ... 04-2017&lt;BR /&gt;Act 1 3 2 ... 3&lt;BR /&gt;Act 2. 2 3 .... 4&lt;BR /&gt;Act 3 1 2 ... 6&lt;BR /&gt;&lt;BR /&gt;01-2016 represent january in 2016, 02-2017 february in 2016and so forth. The dots represent the months inbetween.</description>
      <pubDate>Sun, 23 Apr 2017 20:30:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/active-activity-counts-by-month/m-p/352644#M23272</guid>
      <dc:creator>miss_vang</dc:creator>
      <dc:date>2017-04-23T20:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: active activity counts by month</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/active-activity-counts-by-month/m-p/352645#M23273</link>
      <description>&lt;P&gt;Not exhaustively tested:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Inter1(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;keep&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=activity IntervalDate);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Have;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; missing(enddate) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;enddate = startdate;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt; startdate = intnx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'month'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;, startdate, &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;, &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'b'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt; enddate = intnx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'month'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;, enddate, &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;, &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'b'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; IntervalDate &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;date9.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;IntervalDate = startdate;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt; StopFlag = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;do&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;while&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;(^StopFlag);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; IntervalDate = enddate &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt; StopFlag = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt; IntervalDate = intnx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'month'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;, IntervalDate, &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;, &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'b'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;means&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=Inter1 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;nway&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;noprint&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;class&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; activity IntervalDate;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;var&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; IntervalDate;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;output&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;out&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=Inter2(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;drop&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=_TYPE_ _FREQ_) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;n&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=Count;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;/* Get a list of unique activity names */&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;noprint&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;create&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Names &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;select&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;distinct&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; i.activity &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Inter2 i;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;/* Generate every first of the month from Jan 1 2014 to Dec 31 2017 */&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; AllMonths;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Year = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;2014&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;to&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;2017&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Month = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;to&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;12&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt; DateToCheck = mdy(Month, &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;, Year);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; DateToCheck &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;date9.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;keep&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; DateToCheck;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;output&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;/* Cartesian join to get a list of months and company names */&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;noprint&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;create&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; AllMonthsNames &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; n.activity, a.DAteToCheck &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Names n &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;cross&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;join&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; AllMonths a;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;/* Join the two, to get a full list of months with Type */&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;noprint&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;create&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Inter3 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;select&lt;/FONT&gt; &lt;FONT color="#008080" face="Courier New" size="2"&gt;i.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;*, a.DateToCheck &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Inter2 i &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;right&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;join&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; AllMonthsNames a &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;on&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;(i.IntervalDate = a.DateToCheck &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;and&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; i.activity = a.activity)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;order&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;by&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; a.activity, a.DateToCheck;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;/* Ripple the company names and fill in the zero counts both before and after the actual data */&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Inter3(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;drop&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=_:);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Inter3(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;drop&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=IntervalDate);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;length&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; _OldActivity $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;5&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;retain&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; _OldActivity _OldDate;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; _n_ = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;_OldActivity = activity;&lt;/P&gt;
&lt;P&gt;_OldDate = DateToCheck;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;else&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; DateToCheck &amp;lt; _OldDate &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; _OldActivity = activity;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; missing(activity) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;activity = _OldActivity;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;else&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; _OldActivity = activity;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; missing(Count) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt; Count = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;_OldDate = DateToCheck;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt; SeqNum = _n_; &lt;/FONT&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;/* We need this to turn the dataset upside down */&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;/* Sort descsending to ripple early records */&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;sort&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=Inter3;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;by&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;descending&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; SeqNum;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Inter3(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;drop&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=_:);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Inter3;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;length&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; _OldActivity $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;5&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;retain&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; _OldActivity _OldDate;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; _n_ = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;do&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;_OldActivity = activity;&lt;/P&gt;
&lt;P&gt;_OldDate = DateToCheck;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;else&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; DateToCheck &amp;gt; _OldDate &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; _OldActivity = activity;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; missing(activity) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;activity = _OldActivity;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;else&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; _OldActivity = activity;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;_OldDate = DateToCheck;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; DateToCheck &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;yymm5.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;sort&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=Inter3 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;out&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=Inter3(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;drop&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=SeqNum);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;by&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; SeqNum;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;transpose&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=Inter3 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;out&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=Want(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;drop&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=_NAME_) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;prefix&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=D;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;by&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; activity;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;id&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; DateToCheck;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;var&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Count;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Apr 2017 20:33:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/active-activity-counts-by-month/m-p/352645#M23273</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2017-04-23T20:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: active activity counts by month</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/active-activity-counts-by-month/m-p/352647#M23274</link>
      <description>Sorry, i cannot make the table better. Act 1 represent the first activity, where 3 observations were maid in 01-2016 and 2 observations were maid in 02-2016, and so fourth</description>
      <pubDate>Sun, 23 Apr 2017 20:33:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/active-activity-counts-by-month/m-p/352647#M23274</guid>
      <dc:creator>miss_vang</dc:creator>
      <dc:date>2017-04-23T20:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: active activity counts by month</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/active-activity-counts-by-month/m-p/352648#M23275</link>
      <description>Thank you so much &lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;</description>
      <pubDate>Sun, 23 Apr 2017 20:36:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/active-activity-counts-by-month/m-p/352648#M23275</guid>
      <dc:creator>miss_vang</dc:creator>
      <dc:date>2017-04-23T20:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: active activity counts by month</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/active-activity-counts-by-month/m-p/352656#M23276</link>
      <description>&lt;P&gt;I think something like this may work as well, not sure how much control you need but I suspect PROC TABULATE will generate the table you desire.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*create sample data;

data have;
    infile cards truncover;
    informat activity $8. date_start date_end ddmmyy10.;
    format date_: date9.;
    input activity $  date_start date_end;
    cards;
act1     01-10-2016   15-01-2017
act2     24-02-2015   
act1     06-05-2014    23-06-2016
act3     20-10-2016   23-04-2017
act1     20-01-2016   01-04-2017
;
run;

data long;
    set have;
    *calculate the end date, use today if no end date;
    date_end=coalesce(date_end, date());
    *calculate the number of months of 'activity';
    nmonths=intck('month', date_start, date_end, 'D');
    *create  record for every month;

    do i=0 to nmonths;
        Month=intnx('month', date_start, i, 'b');
        output;
    end;
    format month yymon7.;
    drop nmonths date_start date_end;
run;

proc tabulate data=long;
    where year(month)=2016;
    *limit to specific year for demo;
    class activity month;
    table activity, month*n / misstext='0';
    
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 23 Apr 2017 21:04:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/active-activity-counts-by-month/m-p/352656#M23276</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-04-23T21:04:49Z</dc:date>
    </item>
    <item>
      <title>Re: active activity counts by month</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/active-activity-counts-by-month/m-p/352855#M23290</link>
      <description>&lt;PRE&gt;

data have;
    infile cards truncover;
    informat activity $8. date_start date_end ddmmyy10.;
    format date_: date9.;
    input activity $  date_start date_end;
    cards;
act1     01-10-2016   15-01-2017
act2     24-02-2015   
act1     06-05-2014    23-06-2016
act3     20-10-2016   23-04-2017
act1     20-01-2016   01-04-2017
;
run;
data temp;
 set have;
 if not missing(date_start) and not missing(date_end) then do;
  do i=date_start to date_end;
    month=month(i);
    if month ne lag(month) then output;
  end;
 end;
 else if not missing(date_start) then do;i=date_start;output;end;
  else if not missing(date_end) then do;i=date_end;output;end;

format i date9.;
keep activity i ;
run;
proc freq data=temp noprint;
table activity*i/out=temp1 list;
format i monyy7.;
run;
proc transpose data=temp1 out=want(drop=_:);
by activity;
var count;
id i;
run;


&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Apr 2017 13:51:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/active-activity-counts-by-month/m-p/352855#M23290</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-04-24T13:51:05Z</dc:date>
    </item>
    <item>
      <title>Re: active activity counts by month</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/active-activity-counts-by-month/m-p/352860#M23291</link>
      <description>&lt;PRE&gt;
Fix it for the missing end_date.



data have;
    infile cards truncover;
    informat activity $8. date_start date_end ddmmyy10.;
    format date_: date9.;
    input activity $  date_start date_end;
    cards;
act1     01-10-2016   15-01-2017
act2     24-02-2015   
act1     06-05-2014    23-06-2016
act3     20-10-2016   23-04-2017
act1     20-01-2016   01-04-2017
;
run;
data temp;
 set have;
 if not missing(date_start) and not missing(date_end) then do;
  do i=date_start to date_end;
    month=month(i);
    if month ne lag(month) then output;
  end;
 end;
  else if  missing(date_end) then do;
   do i=date_start to today();
    month=month(i);
    if month ne lag(month) then output;
   end;
  end;

format i date9.;
keep activity i ;
run;
proc freq data=temp noprint;
table activity*i/out=temp1 list;
format i monyy7.;
run;
proc transpose data=temp1 out=want(drop=_:);
by activity;
var count;
id i;
run;

&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Apr 2017 13:56:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/active-activity-counts-by-month/m-p/352860#M23291</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-04-24T13:56:27Z</dc:date>
    </item>
    <item>
      <title>Re: active activity counts by month</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/active-activity-counts-by-month/m-p/352878#M23292</link>
      <description>&lt;P&gt;Hi again&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can see, that the programming is restricted to the table i maid. It is an example of the data set i have.&amp;nbsp;&lt;/P&gt;&lt;P&gt;To be more specific, i have 30 activities and each activity has 30 or more observations, that I wish to count.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The end_date has '.' and is not missing, when it is still active. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you sooo much for your time and help - it is appreciated &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2017 14:36:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/active-activity-counts-by-month/m-p/352878#M23292</guid>
      <dc:creator>miss_vang</dc:creator>
      <dc:date>2017-04-24T14:36:06Z</dc:date>
    </item>
    <item>
      <title>Re: active activity counts by month</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/active-activity-counts-by-month/m-p/352880#M23293</link>
      <description>&lt;P&gt;My code should work fine under the conditions you specify, you just need to adjust the start and end years to accomodate your range of dates.&lt;/P&gt;
&lt;P&gt;Please be a little more clear on what it means when end date is missing.&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2017 14:40:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/active-activity-counts-by-month/m-p/352880#M23293</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2017-04-24T14:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: active activity counts by month</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/active-activity-counts-by-month/m-p/352884#M23294</link>
      <description>when the activity is still active, the end_date is specified with at dot ( . ) in the dataset.</description>
      <pubDate>Mon, 24 Apr 2017 14:42:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/active-activity-counts-by-month/m-p/352884#M23294</guid>
      <dc:creator>miss_vang</dc:creator>
      <dc:date>2017-04-24T14:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: active activity counts by month</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/active-activity-counts-by-month/m-p/352916#M23295</link>
      <description>&lt;P&gt;I had assumed that a missing enddate implied it was a one-day activity.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;In my code, replace&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if missing(enddate) then enddate = startdate;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;with&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if missing(enddate) then enddate = today();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2017 15:20:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/active-activity-counts-by-month/m-p/352916#M23295</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2017-04-24T15:20:59Z</dc:date>
    </item>
  </channel>
</rss>

