<?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 How to resolve 'unresolved reference to table/correlation name inf/'? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-resolve-unresolved-reference-to-table-correlation-name/m-p/699308#M25600</link>
    <description>&lt;P&gt;I am working on a proc sql code; it is giving me the error below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1.&amp;nbsp;ERROR: Summary functions nested in this way are not supported.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc sql;
create table A.TAT as select Month, MailerTurnAroundTime, 
Sum(count(distinct(Patient_id)))as Counts from 
(select case when mailerdays &amp;lt; 4 then "Less than 4 days"
when mailerdays &amp;gt;= 4 and mailerdays &amp;lt;= 7 then  "4 to 7 days"
when mailerdays &amp;gt; 7 then  "Greater than 7 days"
end 
as MailerTurnAroundTime
, *
from A.Mailertat)
group by Month, MailerTurnAroundTime;
quit;&lt;/PRE&gt;&lt;P&gt;I am sure the error is something simple that I haven't caught yet. Can anyone please help?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 16 Nov 2020 21:24:36 GMT</pubDate>
    <dc:creator>anucharbe</dc:creator>
    <dc:date>2020-11-16T21:24:36Z</dc:date>
    <item>
      <title>How to resolve 'unresolved reference to table/correlation name inf/'?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-resolve-unresolved-reference-to-table-correlation-name/m-p/699308#M25600</link>
      <description>&lt;P&gt;I am working on a proc sql code; it is giving me the error below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1.&amp;nbsp;ERROR: Summary functions nested in this way are not supported.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc sql;
create table A.TAT as select Month, MailerTurnAroundTime, 
Sum(count(distinct(Patient_id)))as Counts from 
(select case when mailerdays &amp;lt; 4 then "Less than 4 days"
when mailerdays &amp;gt;= 4 and mailerdays &amp;lt;= 7 then  "4 to 7 days"
when mailerdays &amp;gt; 7 then  "Greater than 7 days"
end 
as MailerTurnAroundTime
, *
from A.Mailertat)
group by Month, MailerTurnAroundTime;
quit;&lt;/PRE&gt;&lt;P&gt;I am sure the error is something simple that I haven't caught yet. Can anyone please help?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Nov 2020 21:24:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-resolve-unresolved-reference-to-table-correlation-name/m-p/699308#M25600</guid>
      <dc:creator>anucharbe</dc:creator>
      <dc:date>2020-11-16T21:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to resolve 'unresolved reference to table/correlation name inf/'?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-resolve-unresolved-reference-to-table-correlation-name/m-p/699310#M25601</link>
      <description>&lt;P&gt;Show us the actual LOG for this PROC SQL stepped, unedited, with nothing chopped out. Preserve the formatting of the LOG by copying it as text and pasting it into the window that appears when you click on the &amp;lt;/&amp;gt;. Please help us, this preserves the formatting, DO NOT SKIP THIS STEP.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Nov 2020 21:30:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-resolve-unresolved-reference-to-table-correlation-name/m-p/699310#M25601</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-11-16T21:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to resolve 'unresolved reference to table/correlation name inf/'?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-resolve-unresolved-reference-to-table-correlation-name/m-p/699312#M25602</link>
      <description>&lt;P&gt;Since you are selecting from a sub-query and not an actual dataset you need to give the sub-query and alias name, even if the sub-query is the only thing you are selecting from.&amp;nbsp; So XXX in this snippet is the alias.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;from (select ....) xxx
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Nov 2020 21:48:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-resolve-unresolved-reference-to-table-correlation-name/m-p/699312#M25602</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-11-16T21:48:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to resolve 'unresolved reference to table/correlation name inf/'?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-resolve-unresolved-reference-to-table-correlation-name/m-p/699327#M25603</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/76048"&gt;@anucharbe&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The "nested summary functions" are &lt;FONT face="courier new,courier"&gt;Sum(...)&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;count(...)&lt;/FONT&gt;. Within each combination of &lt;FONT face="courier new,courier"&gt;Month&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;MailerTurnAroundTime&lt;/FONT&gt; values you want to count the distinct &lt;FONT face="courier new,courier"&gt;Patient_id&lt;/FONT&gt;&amp;nbsp;values, which is fine. But then how does the SUM function&amp;nbsp;come into play? I suspect that you mean the sum of the counts&amp;nbsp;&lt;EM&gt;across&lt;/EM&gt;&amp;nbsp;&lt;FONT face="courier new,courier"&gt;Month&lt;/FONT&gt;-&lt;FONT face="courier new,courier"&gt;MailerTurnAroundTime&lt;/FONT&gt;&amp;nbsp;combinations, not &lt;EM&gt;within&lt;/EM&gt; these groups, i.e., the GROUP BY clause should not apply to the SUM function. This would require another (nested) inline view, for example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;select Month, MailerTurnAroundTime, sum(npat) as Counts
from (select Month, MailerTurnAroundTime, count(distinct Patient_id) as npat
      from (select case when ...)
      group by Month, MailerTurnAroundTime);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Nov 2020 22:37:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-resolve-unresolved-reference-to-table-correlation-name/m-p/699327#M25603</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-11-16T22:37:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to resolve 'unresolved reference to table/correlation name inf/'?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-resolve-unresolved-reference-to-table-correlation-name/m-p/699331#M25604</link>
      <description>&lt;P&gt;Thank you, that worked with my code. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Nov 2020 23:27:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-resolve-unresolved-reference-to-table-correlation-name/m-p/699331#M25604</guid>
      <dc:creator>anucharbe</dc:creator>
      <dc:date>2020-11-16T23:27:35Z</dc:date>
    </item>
  </channel>
</rss>

