<?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 Need help with what PROC to use group Items per Tranaction in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Need-help-with-what-PROC-to-use-group-Items-per-Tranaction/m-p/504429#M967</link>
    <description>&lt;P&gt;First time poster and a &lt;FONT color="#008000"&gt;&lt;STRONG&gt;bright green&lt;/STRONG&gt;&lt;/FONT&gt; SAS programmer.&amp;nbsp; I have a data set I'm using for a class assignment.&amp;nbsp;&amp;nbsp; Variables are Date, Time, Transaction ID and Item.&amp;nbsp;&amp;nbsp; I need to identify how many Items were purchased in a single Transaction.&amp;nbsp; As you can see, some Transactions only contain one Item, while others have multiple.&amp;nbsp; I need the following variables:&amp;nbsp; Date, Time, Items Per Transaction.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated!&amp;nbsp; I am using EG 7.1&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="Bakery2.PNG" style="width: 458px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/24026i47C3EE715F9FD063/image-size/large?v=v2&amp;amp;px=999" role="button" title="Bakery2.PNG" alt="Bakery2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 15 Oct 2018 18:42:40 GMT</pubDate>
    <dc:creator>AMMAN</dc:creator>
    <dc:date>2018-10-15T18:42:40Z</dc:date>
    <item>
      <title>Need help with what PROC to use group Items per Tranaction</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-help-with-what-PROC-to-use-group-Items-per-Tranaction/m-p/504429#M967</link>
      <description>&lt;P&gt;First time poster and a &lt;FONT color="#008000"&gt;&lt;STRONG&gt;bright green&lt;/STRONG&gt;&lt;/FONT&gt; SAS programmer.&amp;nbsp; I have a data set I'm using for a class assignment.&amp;nbsp;&amp;nbsp; Variables are Date, Time, Transaction ID and Item.&amp;nbsp;&amp;nbsp; I need to identify how many Items were purchased in a single Transaction.&amp;nbsp; As you can see, some Transactions only contain one Item, while others have multiple.&amp;nbsp; I need the following variables:&amp;nbsp; Date, Time, Items Per Transaction.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated!&amp;nbsp; I am using EG 7.1&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="Bakery2.PNG" style="width: 458px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/24026i47C3EE715F9FD063/image-size/large?v=v2&amp;amp;px=999" role="button" title="Bakery2.PNG" alt="Bakery2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 18:42:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-help-with-what-PROC-to-use-group-Items-per-Tranaction/m-p/504429#M967</guid>
      <dc:creator>AMMAN</dc:creator>
      <dc:date>2018-10-15T18:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with what PROC to use group Items per Tranaction</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-help-with-what-PROC-to-use-group-Items-per-Tranaction/m-p/504437#M970</link>
      <description>&lt;P&gt;Items or Unique Items? In your example transaction 2 it appears that 2 of the same item may have been purchased. So would you want a count of 1 or 2 for that transaction?&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 19:06:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-help-with-what-PROC-to-use-group-Items-per-Tranaction/m-p/504437#M970</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-10-15T19:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with what PROC to use group Items per Tranaction</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-help-with-what-PROC-to-use-group-Items-per-Tranaction/m-p/504439#M972</link>
      <description>&lt;P&gt;Hi - total items per transaction please.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;A&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 19:15:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-help-with-what-PROC-to-use-group-Items-per-Tranaction/m-p/504439#M972</guid>
      <dc:creator>AMMAN</dc:creator>
      <dc:date>2018-10-15T19:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with what PROC to use group Items per Tranaction</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-help-with-what-PROC-to-use-group-Items-per-Tranaction/m-p/504445#M976</link>
      <description>&lt;P&gt;Unable to test since you didn't provide sample in as plain text&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;/P&gt;
&lt;P&gt;create table want as&lt;/P&gt;
&lt;P&gt;select trans,count(distinct items) as tot&lt;/P&gt;
&lt;P&gt;from have&lt;/P&gt;
&lt;P&gt;group by trans&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or just&amp;nbsp;&lt;/P&gt;
&lt;P&gt;count(items)&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 19:28:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-help-with-what-PROC-to-use-group-Items-per-Tranaction/m-p/504445#M976</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-10-15T19:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with what PROC to use group Items per Tranaction</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-help-with-what-PROC-to-use-group-Items-per-Tranaction/m-p/504469#M979</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/221595"&gt;@AMMAN&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not understanding what exactly you are&amp;nbsp;looking for but here is an attempt.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have(drop=Items);
by Transaction;
if first.Transaction then count=0;
count+1;
if last.Transaction then output;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 15 Oct 2018 20:18:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-help-with-what-PROC-to-use-group-Items-per-Tranaction/m-p/504469#M979</guid>
      <dc:creator>V_27</dc:creator>
      <dc:date>2018-10-15T20:18:54Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with what PROC to use group Items per Tranaction</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-help-with-what-PROC-to-use-group-Items-per-Tranaction/m-p/504478#M981</link>
      <description>&lt;P&gt;Here's a simple way, but its relevance depends on what the results should be (see below).&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 transaction * date * time / noprint out=want (keep=transaction date time count);&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It gives you a data set WANT that contains a new variable COUNT.&amp;nbsp; Note that COUNT will be 2 (not 1) for transaction #2.&amp;nbsp; There were two items in the data, but they are the same.&amp;nbsp; While this solution can be adapted, as it stands it counts both of the identical items.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 20:13:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-help-with-what-PROC-to-use-group-Items-per-Tranaction/m-p/504478#M981</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-10-15T20:13:37Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with what PROC to use group Items per Tranaction</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-help-with-what-PROC-to-use-group-Items-per-Tranaction/m-p/504490#M983</link>
      <description>&lt;P&gt;I forgot the data set!&amp;nbsp; Here it is.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2018 20:42:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-help-with-what-PROC-to-use-group-Items-per-Tranaction/m-p/504490#M983</guid>
      <dc:creator>AMMAN</dc:creator>
      <dc:date>2018-10-15T20:42:48Z</dc:date>
    </item>
  </channel>
</rss>

