<?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 Create Identifiers (based on certain assumptions) and summarize them - BY GROUPS in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Create-Identifiers-based-on-certain-assumptions-and-summarize/m-p/95538#M27043</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the attached data file that shows monthly transactions grouped by the variable KEY_V.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variables POS , NEG and QST are not included in my original dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to create them based on the following assumptions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.- When AMT_1 = 0 across ALL records of the BY Group Vat KEY_V then var QST = 1 (by groups 1,2 &amp;amp; 3)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.-&amp;nbsp; When AMT_1 = 0 and ANY of the other AMT_2, AMT_3, AMT_4 has a value &lt;SPAN style="text-decoration: underline;"&gt;different&lt;/SPAN&gt; from zero then var QST = 2&amp;nbsp; (by groups&amp;nbsp; 4,7,8,9)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3.-&amp;nbsp; a) When AMT_1 not equal to zero at the first record of the By Group then POS=1 and NEG=0&amp;nbsp; (and QST=0). The same pattern is followed until it hits the first record with AMT_1 = 0 then POS=0 and NEG=1 (and QST=0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b) Extending a) If right after we have more subsequent records with AMT_1 =0 then POS=0 and NEG=0 and&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; QST =2 if &lt;SPAN style="text-decoration: underline;"&gt;ANY&lt;/SPAN&gt; of the other AMT_2, AMT_3, AMT_4 has a value &lt;SPAN style="text-decoration: underline;"&gt;different&lt;/SPAN&gt; from zero &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; or&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; QST =3 if &lt;SPAN style="text-decoration: underline;"&gt;ALL&lt;/SPAN&gt; of the other AMT_2, AMT_3, AMT_4 &lt;SPAN style="text-decoration: underline;"&gt;equal&lt;/SPAN&gt; 0 (by groups&amp;nbsp; 7,9)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally I would like to to summarize the counts for POS, NEG and QST both simple counts and CUMULATIVE By ORG_YEAR&amp;nbsp; (as a column ) and TRNS_QTR (as a row).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions or hints will be more than welcome.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Jun 2012 20:15:31 GMT</pubDate>
    <dc:creator>Nikos</dc:creator>
    <dc:date>2012-06-28T20:15:31Z</dc:date>
    <item>
      <title>Create Identifiers (based on certain assumptions) and summarize them - BY GROUPS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Create-Identifiers-based-on-certain-assumptions-and-summarize/m-p/95538#M27043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the attached data file that shows monthly transactions grouped by the variable KEY_V.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variables POS , NEG and QST are not included in my original dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to create them based on the following assumptions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.- When AMT_1 = 0 across ALL records of the BY Group Vat KEY_V then var QST = 1 (by groups 1,2 &amp;amp; 3)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.-&amp;nbsp; When AMT_1 = 0 and ANY of the other AMT_2, AMT_3, AMT_4 has a value &lt;SPAN style="text-decoration: underline;"&gt;different&lt;/SPAN&gt; from zero then var QST = 2&amp;nbsp; (by groups&amp;nbsp; 4,7,8,9)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3.-&amp;nbsp; a) When AMT_1 not equal to zero at the first record of the By Group then POS=1 and NEG=0&amp;nbsp; (and QST=0). The same pattern is followed until it hits the first record with AMT_1 = 0 then POS=0 and NEG=1 (and QST=0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b) Extending a) If right after we have more subsequent records with AMT_1 =0 then POS=0 and NEG=0 and&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; QST =2 if &lt;SPAN style="text-decoration: underline;"&gt;ANY&lt;/SPAN&gt; of the other AMT_2, AMT_3, AMT_4 has a value &lt;SPAN style="text-decoration: underline;"&gt;different&lt;/SPAN&gt; from zero &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; or&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; QST =3 if &lt;SPAN style="text-decoration: underline;"&gt;ALL&lt;/SPAN&gt; of the other AMT_2, AMT_3, AMT_4 &lt;SPAN style="text-decoration: underline;"&gt;equal&lt;/SPAN&gt; 0 (by groups&amp;nbsp; 7,9)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally I would like to to summarize the counts for POS, NEG and QST both simple counts and CUMULATIVE By ORG_YEAR&amp;nbsp; (as a column ) and TRNS_QTR (as a row).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions or hints will be more than welcome.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2012 20:15:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Create-Identifiers-based-on-certain-assumptions-and-summarize/m-p/95538#M27043</guid>
      <dc:creator>Nikos</dc:creator>
      <dc:date>2012-06-28T20:15:31Z</dc:date>
    </item>
    <item>
      <title>Re: Create Identifiers (based on certain assumptions) and summarize them - BY GROUPS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Create-Identifiers-based-on-certain-assumptions-and-summarize/m-p/95539#M27044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Isn't by group 4 in pattern 3? The first value for AMT_1 is not 0. If not your descriptions for pattern 2 needs more clarification.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2012 22:39:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Create-Identifiers-based-on-certain-assumptions-and-summarize/m-p/95539#M27044</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2012-06-28T22:39:40Z</dc:date>
    </item>
    <item>
      <title>Re: Create Identifiers (based on certain assumptions) and summarize them - BY GROUPS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Create-Identifiers-based-on-certain-assumptions-and-summarize/m-p/95540#M27045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;QST takes the value 2 under more than one assumption&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Jun 2012 23:16:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Create-Identifiers-based-on-certain-assumptions-and-summarize/m-p/95540#M27045</guid>
      <dc:creator>Nikos</dc:creator>
      <dc:date>2012-06-28T23:16:05Z</dc:date>
    </item>
  </channel>
</rss>

