<?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: Summing values in a column dependent on dates and conditions in other columns in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Summing-values-in-a-column-dependent-on-dates-and-conditions-in/m-p/525081#M142853</link>
    <description>You didn't mention EG so there was no way to know that. You've posted in the 'programming' forum, but there is an EG specific forum as well. If you're looking for an EG GUI solution, that would be in the Summary task.</description>
    <pubDate>Mon, 07 Jan 2019 15:53:11 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2019-01-07T15:53:11Z</dc:date>
    <item>
      <title>Summing values in a column dependent on dates and conditions in other columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summing-values-in-a-column-dependent-on-dates-and-conditions-in/m-p/524949#M142799</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new to SAS, and think in Excel terms. I have three columns: (1) a reference; (2) a score; and (3) a date. The task I am trying to perform is equivalent to a sumifs function in excel.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to sum the total score of all entries in the score column for each reference, whose dates fall within defined ranges. I intend to create columns for each month so that I know what the total scores are for each reference for each month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ie I have list of thousands of scores with a reference and a date, and I want to know the total score of all entries for each reference that falls within each particular month.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Help needed!&lt;/P&gt;&lt;P&gt;Thanks in advance all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Barney&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 00:09:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summing-values-in-a-column-dependent-on-dates-and-conditions-in/m-p/524949#M142799</guid>
      <dc:creator>BarneyC77</dc:creator>
      <dc:date>2019-01-07T00:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: Summing values in a column dependent on dates and conditions in other columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summing-values-in-a-column-dependent-on-dates-and-conditions-in/m-p/524953#M142801</link>
      <description>&lt;P&gt;All you likely need is proc means.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The date ranges is your biggest issue, if you're using calendar months it becomes a trivial exercise, for going from 15 to the 14th of a month it's a bit more complicated but still doable.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's a quick tutorial on PROC MEANS:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/statgeek/SAS-Tutorials/blob/master/proc_means_basic.sas" target="_blank"&gt;https://github.com/statgeek/SAS-Tutorials/blob/master/proc_means_basic.sas&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And an example of using a format with a date within PROC MEANS.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://gist.github.com/statgeek/0cae5568752959b035516d6ac07a20fb" target="_blank"&gt;https://gist.github.com/statgeek/0cae5568752959b035516d6ac07a20fb&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This would be easier if you could provide sample data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instructions on providing data is available here:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/tac-p/436960" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/tac-p/436960&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/253726"&gt;@BarneyC77&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am new to SAS, and think in Excel terms. I have three columns: (1) a reference; (2) a score; and (3) a date. The task I am trying to perform is equivalent to a sumifs function in excel.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to sum the total score of all entries in the score column for each reference, whose dates fall within defined ranges. I intend to create columns for each month so that I know what the total scores are for each reference for each month.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ie I have list of thousands of scores with a reference and a date, and I want to know the total score of all entries for each reference that falls within each particular month.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Help needed!&lt;/P&gt;
&lt;P&gt;Thanks in advance all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Barney&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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 00:45:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summing-values-in-a-column-dependent-on-dates-and-conditions-in/m-p/524953#M142801</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-01-07T00:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: Summing values in a column dependent on dates and conditions in other columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summing-values-in-a-column-dependent-on-dates-and-conditions-in/m-p/524957#M142803</link>
      <description>&lt;P&gt;For calendar months, it's pretty simple&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=have;
    class reference date;
    Var score;
    output out=want sum=sum_score;
    format date monyy.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Jan 2019 01:45:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summing-values-in-a-column-dependent-on-dates-and-conditions-in/m-p/524957#M142803</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-01-07T01:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: Summing values in a column dependent on dates and conditions in other columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summing-values-in-a-column-dependent-on-dates-and-conditions-in/m-p/524996#M142812</link>
      <description>&lt;P&gt;Great - thank you. Is this through SAS Enterprise Guide? I am very new to SAS EG and even the tutorial seems to assume knowledge/experience I don't have. Sorry&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 10:25:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summing-values-in-a-column-dependent-on-dates-and-conditions-in/m-p/524996#M142812</guid>
      <dc:creator>BarneyC77</dc:creator>
      <dc:date>2019-01-07T10:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: Summing values in a column dependent on dates and conditions in other columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summing-values-in-a-column-dependent-on-dates-and-conditions-in/m-p/525053#M142843</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/253726"&gt;@BarneyC77&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Great - thank you. Is this through SAS Enterprise Guide? I am very new to SAS EG and even the tutorial seems to assume knowledge/experience I don't have. Sorry&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Enterprise Guide can be used in two different ways. There is a point and click graphical user interface to generate analyses, and then you can also write and execute your own SAS code. Both the reply by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;and myself are to be used as code you can execute in EG. I don't know how to accomplish what you want via the point-and-click&amp;nbsp;&lt;SPAN&gt;graphical user interface.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 15:03:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summing-values-in-a-column-dependent-on-dates-and-conditions-in/m-p/525053#M142843</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-01-07T15:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: Summing values in a column dependent on dates and conditions in other columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summing-values-in-a-column-dependent-on-dates-and-conditions-in/m-p/525081#M142853</link>
      <description>You didn't mention EG so there was no way to know that. You've posted in the 'programming' forum, but there is an EG specific forum as well. If you're looking for an EG GUI solution, that would be in the Summary task.</description>
      <pubDate>Mon, 07 Jan 2019 15:53:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summing-values-in-a-column-dependent-on-dates-and-conditions-in/m-p/525081#M142853</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-01-07T15:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: Summing values in a column dependent on dates and conditions in other columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summing-values-in-a-column-dependent-on-dates-and-conditions-in/m-p/525089#M142856</link>
      <description>Hi,&lt;BR /&gt;Thanks for your help with my SAS query. I'm happy with using either point and click or programming, whatever works. Are you able to help with some code?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Barney&lt;BR /&gt;</description>
      <pubDate>Mon, 07 Jan 2019 16:07:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summing-values-in-a-column-dependent-on-dates-and-conditions-in/m-p/525089#M142856</guid>
      <dc:creator>BarneyC77</dc:creator>
      <dc:date>2019-01-07T16:07:02Z</dc:date>
    </item>
    <item>
      <title>Re: Summing values in a column dependent on dates and conditions in other columns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summing-values-in-a-column-dependent-on-dates-and-conditions-in/m-p/525095#M142861</link>
      <description>&lt;P&gt;If you want code that works with your data, you need to share your data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise, the tutorials above should be sufficient. Just paste them in your editor, run and see how the output and input match up.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need a more step by step tutorial the following are some suggestions:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.lexjansen.com/nesug/nesug08/ff/ff06.pdf" target="_blank"&gt;https://www.lexjansen.com/nesug/nesug08/ff/ff06.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Video walkthrough of PROC MEANS - SAS Studio but may help&lt;/P&gt;
&lt;P&gt;&lt;A href="https://video.sas.com/detail/video/3306906230001/summary-statistics-using-sas-studio?autoStart=true&amp;amp;q=summary%20statistics" target="_blank"&gt;https://video.sas.com/detail/video/3306906230001/summary-statistics-using-sas-studio?autoStart=true&amp;amp;q=summary%20statistics&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 16:17:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summing-values-in-a-column-dependent-on-dates-and-conditions-in/m-p/525095#M142861</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-01-07T16:17:34Z</dc:date>
    </item>
  </channel>
</rss>

