<?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: Conditional Having Clause in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Conditional-Having-Clause/m-p/619676#M19417</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/268031"&gt;@MaggieFM&lt;/a&gt;&amp;nbsp; Not sure if i thoroughly understand you, but guessing whether you are meaning something like this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Having 
		count&amp;lt;=(.9*max_count) and count&amp;gt;1 or count=1;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;to account or single count entry?&lt;/P&gt;</description>
    <pubDate>Thu, 23 Jan 2020 21:11:10 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2020-01-23T21:11:10Z</dc:date>
    <item>
      <title>Conditional Having Clause</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Conditional-Having-Clause/m-p/619673#M19416</link>
      <description>&lt;P&gt;Hi all - my office does performance metrics on employees where they report on the fastest 90% of cases complete.&amp;nbsp; I get the fastest 90% by creating a series of tables:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data New;
	set PSS.CSBadj;
	count+1;
	by Adj;

	if first.Adj then
		count=1;
run;

Proc sql;
	Create table PSS.CSBAdj90 as Select Adj, PWPTimeliness, Branch, Team, 
		max(count) as max_count From work.New Group by Adj Having 
		count&amp;lt;=(.9*max_count);
Quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I then use proc tabulate to create a table showing the number of cases and the average timeliness for the fastest 90% per employee.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My issue is that if someone only has 1 case, then that Timeliness needs to be reported.&amp;nbsp; Is there any way for me to make the having clause conditional? So that it only applies if max_count&amp;gt;1?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also if there is a better way to go about calculating the fastest 90% or anywhere else I am all ears! Thanks for your help.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 20:59:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Conditional-Having-Clause/m-p/619673#M19416</guid>
      <dc:creator>MaggieFM</dc:creator>
      <dc:date>2020-01-23T20:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Having Clause</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Conditional-Having-Clause/m-p/619676#M19417</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/268031"&gt;@MaggieFM&lt;/a&gt;&amp;nbsp; Not sure if i thoroughly understand you, but guessing whether you are meaning something like this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Having 
		count&amp;lt;=(.9*max_count) and count&amp;gt;1 or count=1;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;to account or single count entry?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 21:11:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Conditional-Having-Clause/m-p/619676#M19417</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-01-23T21:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Having Clause</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Conditional-Having-Clause/m-p/619678#M19419</link>
      <description>&lt;P&gt;Are you just asking for this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;having count&amp;lt;=(.9*max_count)
   and count&amp;gt;1&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Jan 2020 21:14:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Conditional-Having-Clause/m-p/619678#M19419</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-01-23T21:14:19Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Having Clause</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Conditional-Having-Clause/m-p/619683#M19420</link>
      <description>&lt;P&gt;Yes! That was exactly what I meant... thank you for solving that so quickly!!!&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 21:24:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Conditional-Having-Clause/m-p/619683#M19420</guid>
      <dc:creator>MaggieFM</dc:creator>
      <dc:date>2020-01-23T21:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Having Clause</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Conditional-Having-Clause/m-p/619685#M19421</link>
      <description>&lt;P&gt;I'm not sure why but this solution didn't work for me - the one above did though. Thanks so much for your help!&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 21:24:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Conditional-Having-Clause/m-p/619685#M19421</guid>
      <dc:creator>MaggieFM</dc:creator>
      <dc:date>2020-01-23T21:24:44Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Having Clause</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Conditional-Having-Clause/m-p/619686#M19422</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/268031"&gt;@MaggieFM&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I'm not sure why but this solution didn't work for me - the one above did though. Thanks so much for your help!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I depends on whether you want the cases where COUNT=1 to be included or not included.&lt;/P&gt;
&lt;P&gt;Also on what MAX_COUNT is.&amp;nbsp; If COUNT=1 and MAX_COUNT=1 is that to be included or not?&amp;nbsp; What about if COUNT=1 and MAX_COUNT &amp;gt; 1 ?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2020 21:31:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Conditional-Having-Clause/m-p/619686#M19422</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-01-23T21:31:36Z</dc:date>
    </item>
  </channel>
</rss>

