<?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: How to count the frequency of a value by unique ID's in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-count-the-frequency-of-a-value-by-unique-ID-s/m-p/343989#M22767</link>
    <description>&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table want as&lt;/P&gt;&lt;P&gt;select count(distinct id) as&amp;nbsp;&lt;SPAN&gt;Count_A,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;count(distinct&amp;nbsp; Variable) as&amp;nbsp;Count_B&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;from have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Mar 2017 09:16:03 GMT</pubDate>
    <dc:creator>Madansas7b</dc:creator>
    <dc:date>2017-03-24T09:16:03Z</dc:date>
    <item>
      <title>How to count the frequency of a value by unique ID's</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-count-the-frequency-of-a-value-by-unique-ID-s/m-p/343988#M22766</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset where I would like to count the number of times&amp;nbsp;different values of a variable occurs but only once for every Id.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ID &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Variable&lt;/P&gt;&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A&lt;/P&gt;&lt;P&gt;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; B&lt;/P&gt;&lt;P&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; B&lt;/P&gt;&lt;P&gt;4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A&lt;/P&gt;&lt;P&gt;5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A&lt;/P&gt;&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A&lt;/P&gt;&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; B&lt;/P&gt;&lt;P&gt;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; B&lt;/P&gt;&lt;P&gt;4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; B&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want this as a result:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Count_A &amp;nbsp; &amp;nbsp; &amp;nbsp;Count_B&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If ID 1 have A twice I only want it to count as one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 09:07:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-count-the-frequency-of-a-value-by-unique-ID-s/m-p/343988#M22766</guid>
      <dc:creator>SLK</dc:creator>
      <dc:date>2017-03-24T09:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the frequency of a value by unique ID's</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-count-the-frequency-of-a-value-by-unique-ID-s/m-p/343989#M22767</link>
      <description>&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table want as&lt;/P&gt;&lt;P&gt;select count(distinct id) as&amp;nbsp;&lt;SPAN&gt;Count_A,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;count(distinct&amp;nbsp; Variable) as&amp;nbsp;Count_B&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;from have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 09:16:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-count-the-frequency-of-a-value-by-unique-ID-s/m-p/343989#M22767</guid>
      <dc:creator>Madansas7b</dc:creator>
      <dc:date>2017-03-24T09:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the frequency of a value by unique ID's</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-count-the-frequency-of-a-value-by-unique-ID-s/m-p/344002#M22768</link>
      <description>&lt;P&gt;Thanks! I didn't quite work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used the following code (as I also had to group by other variable)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table want&amp;nbsp;as&lt;BR /&gt;select&lt;BR /&gt;year, variable, count(distinct ID)&lt;BR /&gt;from&amp;nbsp;data&lt;BR /&gt;group by&lt;BR /&gt;year, variable&lt;BR /&gt;;&lt;BR /&gt;quit;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 09:57:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-count-the-frequency-of-a-value-by-unique-ID-s/m-p/344002#M22768</guid>
      <dc:creator>SLK</dc:creator>
      <dc:date>2017-03-24T09:57:18Z</dc:date>
    </item>
  </channel>
</rss>

