<?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 count for each id_number satisfying certain conditions in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/count-for-each-id-number-satisfying-certain-conditions/m-p/48357#M13073</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;dear exeprts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need your help with the following&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data new;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SET old;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if first.household_id then large_spending_count = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if total_spent&amp;gt;100 then large_spending_count+1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;basically, I want to count how many purchases with total_spent &amp;gt; 100 dollars were made for each household.&lt;/P&gt;&lt;P&gt;so, i want to make large_spending_count = 0 for each new household. it should increase by 1 each time a purchase (&amp;gt;$100) is made.&lt;/P&gt;&lt;P&gt;somehow, it's not working... (it's my first time using first function but I think I need to use it; if not, let me know as well)&lt;/P&gt;&lt;P&gt;can someone please tell me how this may be done?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;many thanks,&lt;/P&gt;&lt;P&gt;c&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Aug 2011 16:21:26 GMT</pubDate>
    <dc:creator>jkf91</dc:creator>
    <dc:date>2011-08-15T16:21:26Z</dc:date>
    <item>
      <title>count for each id_number satisfying certain conditions</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/count-for-each-id-number-satisfying-certain-conditions/m-p/48357#M13073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;dear exeprts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need your help with the following&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data new;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SET old;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if first.household_id then large_spending_count = 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if total_spent&amp;gt;100 then large_spending_count+1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;basically, I want to count how many purchases with total_spent &amp;gt; 100 dollars were made for each household.&lt;/P&gt;&lt;P&gt;so, i want to make large_spending_count = 0 for each new household. it should increase by 1 each time a purchase (&amp;gt;$100) is made.&lt;/P&gt;&lt;P&gt;somehow, it's not working... (it's my first time using first function but I think I need to use it; if not, let me know as well)&lt;/P&gt;&lt;P&gt;can someone please tell me how this may be done?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;many thanks,&lt;/P&gt;&lt;P&gt;c&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Aug 2011 16:21:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/count-for-each-id-number-satisfying-certain-conditions/m-p/48357#M13073</guid>
      <dc:creator>jkf91</dc:creator>
      <dc:date>2011-08-15T16:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: count for each id_number satisfying certain conditions</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/count-for-each-id-number-satisfying-certain-conditions/m-p/48358#M13074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to add another statement after your set statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;by household_id;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Aug 2011 16:23:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/count-for-each-id-number-satisfying-certain-conditions/m-p/48358#M13074</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-08-15T16:23:52Z</dc:date>
    </item>
  </channel>
</rss>

