<?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: Losing Months When Aggregating in EG in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Losing-Months-When-Aggregating-in-EG/m-p/115826#M9811</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The bad news, I don't know of an easy way to do it in query builder, which is based on SQL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The good news, there's an easy way to do it in "Summary Statistics" (PROC MEANS):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Start a Summary Statistics task against your table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Use CL_ID and Month as your Classification variables, and your quantitative variables of interest as your Analysis variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. In Statistics, select whichever statistics are of interest. Don't select any plots, as you're not going to print anything.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. In Results, turn ON "Save statistics to dataset", and turn OFF "Show statistics". This is a great feature of this task that will give you a summary dataset, without a report. If you don't like the name SAS picks for the dataset, you can change it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5. You shouldn't need to change Titles or Properties.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the fun part! If you run it now, your result will have exactly the same problem. To fix it, we need to use a PROC MEANS feature that isn't built into EG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i) Click Preview Code&lt;/P&gt;&lt;P&gt;ii) On the preview screen, click Insert Code&lt;/P&gt;&lt;P&gt;iii) Find the line that begins "PROC MEANS DATA= blah, blah, blah". This should be the start of a number of lines ending with a semicolon. Double click the "&amp;lt;double-click to enter code&amp;gt;" item BEFORE the semicolon, and type COMPLETETYPES&lt;/P&gt;&lt;P&gt;This will tell PROC MEANS to give you the full set of CLASS crossings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hit OK to finish inserting code, close the preview window, and let 'er rip!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 Jan 2013 20:29:37 GMT</pubDate>
    <dc:creator>TomKari</dc:creator>
    <dc:date>2013-01-04T20:29:37Z</dc:date>
    <item>
      <title>Losing Months When Aggregating in EG</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Losing-Months-When-Aggregating-in-EG/m-p/115825#M9810</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to get totals by month, when I aggregate in the query builder by cl_id and month, if a claimant has no transactions in a month they do not show up in the data set for the month.&amp;nbsp; Let's say I am looking for the whole year of 2012, and a claimant has transactions in month 1-10, I want to see the lines for month 11 and 12, with values as zero.&amp;nbsp; Having a hard time figuring out a good case statement for this.&amp;nbsp; Let me know if you can help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jan 2013 18:50:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Losing-Months-When-Aggregating-in-EG/m-p/115825#M9810</guid>
      <dc:creator>sasspan</dc:creator>
      <dc:date>2013-01-04T18:50:16Z</dc:date>
    </item>
    <item>
      <title>Re: Losing Months When Aggregating in EG</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Losing-Months-When-Aggregating-in-EG/m-p/115826#M9811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The bad news, I don't know of an easy way to do it in query builder, which is based on SQL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The good news, there's an easy way to do it in "Summary Statistics" (PROC MEANS):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Start a Summary Statistics task against your table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Use CL_ID and Month as your Classification variables, and your quantitative variables of interest as your Analysis variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. In Statistics, select whichever statistics are of interest. Don't select any plots, as you're not going to print anything.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. In Results, turn ON "Save statistics to dataset", and turn OFF "Show statistics". This is a great feature of this task that will give you a summary dataset, without a report. If you don't like the name SAS picks for the dataset, you can change it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5. You shouldn't need to change Titles or Properties.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the fun part! If you run it now, your result will have exactly the same problem. To fix it, we need to use a PROC MEANS feature that isn't built into EG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i) Click Preview Code&lt;/P&gt;&lt;P&gt;ii) On the preview screen, click Insert Code&lt;/P&gt;&lt;P&gt;iii) Find the line that begins "PROC MEANS DATA= blah, blah, blah". This should be the start of a number of lines ending with a semicolon. Double click the "&amp;lt;double-click to enter code&amp;gt;" item BEFORE the semicolon, and type COMPLETETYPES&lt;/P&gt;&lt;P&gt;This will tell PROC MEANS to give you the full set of CLASS crossings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hit OK to finish inserting code, close the preview window, and let 'er rip!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jan 2013 20:29:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Losing-Months-When-Aggregating-in-EG/m-p/115826#M9811</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2013-01-04T20:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: Losing Months When Aggregating in EG</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Losing-Months-When-Aggregating-in-EG/m-p/115827#M9812</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Tom! I did brute force 20 case statements instead while waiting for a reply, but I will use this in the future, and really appreciate your time! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jan 2013 20:37:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Losing-Months-When-Aggregating-in-EG/m-p/115827#M9812</guid>
      <dc:creator>sasspan</dc:creator>
      <dc:date>2013-01-04T20:37:35Z</dc:date>
    </item>
  </channel>
</rss>

