<?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 Count the number of occurrences per week in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Count-the-number-of-occurrences-per-week/m-p/495152#M25663</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I easily produce a chart of the number of observations that occurred per week based on a date field on each observation over the previous 3 months from a parameter date?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Specifically, I am wondering if there is a proc which can do most of the work of this, where you give it a dataset with the dates and it then clusters the number of observations by week, going back a specified number of intervals (in this case 3 weeks) and then produces a table or chart.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;</description>
    <pubDate>Thu, 13 Sep 2018 23:26:47 GMT</pubDate>
    <dc:creator>markc</dc:creator>
    <dc:date>2018-09-13T23:26:47Z</dc:date>
    <item>
      <title>Count the number of occurrences per week</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Count-the-number-of-occurrences-per-week/m-p/495152#M25663</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I easily produce a chart of the number of observations that occurred per week based on a date field on each observation over the previous 3 months from a parameter date?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Specifically, I am wondering if there is a proc which can do most of the work of this, where you give it a dataset with the dates and it then clusters the number of observations by week, going back a specified number of intervals (in this case 3 weeks) and then produces a table or chart.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 23:26:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Count-the-number-of-occurrences-per-week/m-p/495152#M25663</guid>
      <dc:creator>markc</dc:creator>
      <dc:date>2018-09-13T23:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: Count the number of occurrences per week</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Count-the-number-of-occurrences-per-week/m-p/495155#M25664</link>
      <description>&lt;P&gt;If &lt;EM&gt;date&lt;/EM&gt; and &lt;EM&gt;parmdate&lt;/EM&gt; are SAS dates, you can use&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;weeks = intck("WEEK", date, parmDate, "Continuous")&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;to get the number of weeks between &lt;EM&gt;date&lt;/EM&gt; and &lt;EM&gt;parmDate&lt;/EM&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 04:48:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Count-the-number-of-occurrences-per-week/m-p/495155#M25664</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-09-13T04:48:25Z</dc:date>
    </item>
    <item>
      <title>Re: Count the number of occurrences per week</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Count-the-number-of-occurrences-per-week/m-p/495173#M25665</link>
      <description>&lt;P&gt;Please post example data, the expected result and a value the parameter date contains. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It seems that you need a where-statement to get the observations of the 3 month before param_data. Assuming that the parameter contains the string 9Sep2018 (value taken from EG prompt): &lt;FONT face="courier new,courier"&gt;where data_date &amp;gt;= intnx('month', "&amp;amp;promptDate."d, -3, 's')&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To get the number of observations per week, applying a format like weekv5 and using a proc like summary or freq could yield the required result. But without any data shown, this is pure guesswork.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 06:23:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Count-the-number-of-occurrences-per-week/m-p/495173#M25665</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2018-09-13T06:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: Count the number of occurrences per week</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Count-the-number-of-occurrences-per-week/m-p/495361#M25673</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/207566"&gt;@markc&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I easily produce a chart of the number of observations that occurred per week based on a date field on each observation over the previous 3 months from a parameter date?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards,&lt;/P&gt;
&lt;P&gt;Mark&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;How does the "parameter date" get involved? Is that used to filter data or indicate the first day of a "week" and calculate weeks based on seven day intervals from the parameter of something else? By previous 3 months do you mean from the first day of the month 3 previous or go back to the same day of the month 3 previous?&lt;/P&gt;
&lt;P&gt;And which day of the week starts your week?&lt;/P&gt;
&lt;P&gt;How do you want "week" interpreted if your period crosses year boundaries?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 15:29:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Count-the-number-of-occurrences-per-week/m-p/495361#M25673</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-09-13T15:29:05Z</dc:date>
    </item>
  </channel>
</rss>

