<?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: count distinct with conditions in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/count-distinct-with-conditions/m-p/547926#M151886</link>
    <description>&lt;P&gt;What tools are you willing to consider as part of the solution?&amp;nbsp; SAS contains a variety of tools that can count.&amp;nbsp; The solution might be as easy as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc freq data=have;&lt;/P&gt;
&lt;P&gt;tables product;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need a data set holding the results, you can use a slight variation:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc freq data=have;&lt;/P&gt;
&lt;P&gt;tables product / out=want;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Examine the data set WANT to see how close it comes to meeting your objective.&lt;/P&gt;</description>
    <pubDate>Tue, 02 Apr 2019 15:29:42 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2019-04-02T15:29:42Z</dc:date>
    <item>
      <title>count distinct with conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/count-distinct-with-conditions/m-p/547908#M151878</link>
      <description>&lt;P&gt;Hi -&lt;/P&gt;&lt;P&gt;I am trying to do distinct counts. I have a detailed level dataset with other variables than that is shown below. My dataset is already filtered for the sub_channel. But I have different products..only one shown below. I would like to get the distinct counts based on the product. So if I have 100 different products, I will need to create 100 rows with distinct counts by product.&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;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pty.png" style="width: 281px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/28397i0CD65E1BDD16E7EA/image-size/large?v=v2&amp;amp;px=999" role="button" title="pty.png" alt="pty.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2019 14:20:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/count-distinct-with-conditions/m-p/547908#M151878</guid>
      <dc:creator>Tanvi99</dc:creator>
      <dc:date>2019-04-02T14:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: count distinct with conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/count-distinct-with-conditions/m-p/547909#M151879</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/262838"&gt;@Tanvi99&lt;/a&gt;&amp;nbsp; &amp;nbsp;Can you post a better sample(that one can copy paste, test) and your expected output for the sample&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A good sample should ideally be a comprehensive one that shows a few records of your &lt;STRONG&gt;different products .&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2019 14:24:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/count-distinct-with-conditions/m-p/547909#M151879</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-04-02T14:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: count distinct with conditions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/count-distinct-with-conditions/m-p/547926#M151886</link>
      <description>&lt;P&gt;What tools are you willing to consider as part of the solution?&amp;nbsp; SAS contains a variety of tools that can count.&amp;nbsp; The solution might be as easy as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc freq data=have;&lt;/P&gt;
&lt;P&gt;tables product;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need a data set holding the results, you can use a slight variation:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc freq data=have;&lt;/P&gt;
&lt;P&gt;tables product / out=want;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Examine the data set WANT to see how close it comes to meeting your objective.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2019 15:29:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/count-distinct-with-conditions/m-p/547926#M151886</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-04-02T15:29:42Z</dc:date>
    </item>
  </channel>
</rss>

