<?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 Aggregate by Week in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Aggregate-by-Week/m-p/726374#M225694</link>
    <description>&lt;P&gt;I have a date field that was formatted as DATE9. and then I changed it to YYWEEKU7. I am now trying to aggregate by that new weekly formatted date but it is not aggregating properly. I think the day is still stored in the background so when I sum my values it is summing down to the daily level, instead of weekly level. Is there a way to work around this other than changing the field to a character field and summing by that?&lt;/P&gt;</description>
    <pubDate>Mon, 15 Mar 2021 13:53:49 GMT</pubDate>
    <dc:creator>sefcikm</dc:creator>
    <dc:date>2021-03-15T13:53:49Z</dc:date>
    <item>
      <title>Aggregate by Week</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Aggregate-by-Week/m-p/726374#M225694</link>
      <description>&lt;P&gt;I have a date field that was formatted as DATE9. and then I changed it to YYWEEKU7. I am now trying to aggregate by that new weekly formatted date but it is not aggregating properly. I think the day is still stored in the background so when I sum my values it is summing down to the daily level, instead of weekly level. Is there a way to work around this other than changing the field to a character field and summing by that?&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 13:53:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Aggregate-by-Week/m-p/726374#M225694</guid>
      <dc:creator>sefcikm</dc:creator>
      <dc:date>2021-03-15T13:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate by Week</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Aggregate-by-Week/m-p/726398#M225699</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/267270"&gt;@sefcikm&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have a date field that was formatted as DATE9. and then I changed it to YYWEEKU7. I am now trying to aggregate by that new weekly formatted date but it is not aggregating properly. I think the day is still stored in the background so when I sum my values it is summing down to the daily level, instead of weekly level. Is there a way to work around this other than changing the field to a character field and summing by that?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Please show EXACTLY how you are "summing down". And example of some starting data and what you expect for a result is helpful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I strongly suspect you are doing something manually in a data step that is trivial with one of the procedures like Means, Tabulate or Report.&lt;/P&gt;
&lt;P&gt;Do you need a data set (for further manipulation) or a report that people read?&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>Mon, 15 Mar 2021 14:34:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Aggregate-by-Week/m-p/726398#M225699</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-03-15T14:34:46Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate by Week</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Aggregate-by-Week/m-p/726419#M225705</link>
      <description>&lt;P&gt;Below is a simplified version of what I am working with. The date field is a date9. format. I then took that date field and used it to make the week field by changing the format to yyweek07. I am using SAS Enterprise Guide for this and just changed the format in the query builder using 'Date' as my source column. I am now trying to sum the revenue across the week field to get something like the second table I shared below. When I got to sum though, it isn't summing to the week level. The output of this is just a dataset that I will then be working with further.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Date&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Week&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Revenue&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;01JAN2020&lt;/TD&gt;&lt;TD&gt;2020W01&lt;/TD&gt;&lt;TD&gt;500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;02JAN2020&lt;/TD&gt;&lt;TD&gt;2020W01&lt;/TD&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;01FEB2020&lt;/TD&gt;&lt;TD&gt;2020W04&lt;/TD&gt;&lt;TD&gt;300&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;02FEB2020&lt;/TD&gt;&lt;TD&gt;2020W04&lt;/TD&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Week&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Revenue&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020W01&lt;/TD&gt;&lt;TD&gt;700&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2020W04&lt;/TD&gt;&lt;TD&gt;500&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Mon, 15 Mar 2021 15:02:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Aggregate-by-Week/m-p/726419#M225705</guid>
      <dc:creator>sefcikm</dc:creator>
      <dc:date>2021-03-15T15:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate by Week</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Aggregate-by-Week/m-p/726443#M225717</link>
      <description>&lt;P&gt;Can you show the code generated by the query builder?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And instead of "query builder" you might be looking for a "summarize" task&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 16:13:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Aggregate-by-Week/m-p/726443#M225717</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-03-15T16:13:50Z</dc:date>
    </item>
  </channel>
</rss>

