<?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 ID Statement - additional columns - entries appear against summary rows in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/ID-Statement-additional-columns-entries-appear-against-summary/m-p/48031#M12947</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Steve,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It sounds like the ID statement is working like it should.&amp;nbsp; Here's what it does.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For every record in the summarized output, the ID variables should be copied from a single observation that went into computing that summary record.&amp;nbsp; Which observation's ID statements get used?&amp;nbsp; As you noted, there is an element of "maximum value" in making the selection.&amp;nbsp; With a single ID variable, it is the maximum value.&amp;nbsp; With 2 ID variables, it is the maximum value of the first variable, but not necessarily the maximum value of the second variable.&amp;nbsp; Since the rule is to take both ID variables from a single observation, "maximum" means take the maximum value of the first ID variable.&amp;nbsp; For all those observations having the maximum value of the first ID variable, take the maximum value of the second ID variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only choice you have is that you are allowed to switch to "minimum" instead of "maximum".&amp;nbsp; But the basic rule stays in place:&amp;nbsp; all ID variables come from a single observation that went into computing statistics for the summary row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Mar 2012 13:35:44 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2012-03-29T13:35:44Z</dc:date>
    <item>
      <title>ID Statement - additional columns - entries appear against summary rows</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/ID-Statement-additional-columns-entries-appear-against-summary/m-p/48030#M12946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Newbie to the SAS DI world and working with Summary Statistics to return sums, mean and median for a given group of data. I need to calculate the summary stats which works fine and group by two separate variables - FYear and DIAG but then also include 2 additional columns against the DIAG code for description and gender - I have put these into the ID statement to return as additional columns in the output table but the summary stats table that is returned puts a description against the total row - _WAY&amp;nbsp; = 0 and _TYPE&amp;nbsp; = 0 that has nothing to do with that row. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example - the _WAY&amp;nbsp; = 0 and _TYPE = 0 total row should have no entry in the DIAG column or the Description column as this contains the totals for the rest of the variables but when I run the query in SAS DI - it returns a description into the top total row that has nothing to do with the total. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Interestingly, the value that it returns is the description that is the last alphabetical one from the main list of DIAG description. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any advice would be helpful. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Mar 2012 08:58:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/ID-Statement-additional-columns-entries-appear-against-summary/m-p/48030#M12946</guid>
      <dc:creator>shudsoo</dc:creator>
      <dc:date>2012-03-29T08:58:39Z</dc:date>
    </item>
    <item>
      <title>ID Statement - additional columns - entries appear against summary rows</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/ID-Statement-additional-columns-entries-appear-against-summary/m-p/48031#M12947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Steve,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It sounds like the ID statement is working like it should.&amp;nbsp; Here's what it does.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For every record in the summarized output, the ID variables should be copied from a single observation that went into computing that summary record.&amp;nbsp; Which observation's ID statements get used?&amp;nbsp; As you noted, there is an element of "maximum value" in making the selection.&amp;nbsp; With a single ID variable, it is the maximum value.&amp;nbsp; With 2 ID variables, it is the maximum value of the first variable, but not necessarily the maximum value of the second variable.&amp;nbsp; Since the rule is to take both ID variables from a single observation, "maximum" means take the maximum value of the first ID variable.&amp;nbsp; For all those observations having the maximum value of the first ID variable, take the maximum value of the second ID variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only choice you have is that you are allowed to switch to "minimum" instead of "maximum".&amp;nbsp; But the basic rule stays in place:&amp;nbsp; all ID variables come from a single observation that went into computing statistics for the summary row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Mar 2012 13:35:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/ID-Statement-additional-columns-entries-appear-against-summary/m-p/48031#M12947</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2012-03-29T13:35:44Z</dc:date>
    </item>
  </channel>
</rss>

