<?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 Summary table of group and categories belong to the group with comma between values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Summary-table-of-group-and-categories-belong-to-the-group-with/m-p/637650#M189543</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I have a table that show for each category the group name.&lt;/P&gt;
&lt;P&gt;I want to create another table that will contain for each group one row (so in this case 3 rows).&lt;/P&gt;
&lt;P&gt;and for each group there will be information for categories that belong to this group with comma between the value&lt;/P&gt;
&lt;P&gt;So the expected table is&lt;/P&gt;
&lt;P&gt;USA&amp;nbsp; 200,100,300,400&lt;/P&gt;
&lt;P&gt;EU 500,600,150&lt;/P&gt;
&lt;P&gt;Asia 250,700&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another challenge is to order the value from low to high so the expected table will be&lt;/P&gt;
&lt;P&gt;USA&amp;nbsp; 100,200,300,400&lt;/P&gt;
&lt;P&gt;EU 150,500,600&lt;/P&gt;
&lt;P&gt;Asia 250,700&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data tbl1;
Input category group $;
cards;
200 USA
100 USA
300 USA
400 USA
500 EU
600 EU
150 EU
250 Asia
700 Asia
;
run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 05 Apr 2020 06:11:52 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2020-04-05T06:11:52Z</dc:date>
    <item>
      <title>Summary table of group and categories belong to the group with comma between values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summary-table-of-group-and-categories-belong-to-the-group-with/m-p/637650#M189543</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I have a table that show for each category the group name.&lt;/P&gt;
&lt;P&gt;I want to create another table that will contain for each group one row (so in this case 3 rows).&lt;/P&gt;
&lt;P&gt;and for each group there will be information for categories that belong to this group with comma between the value&lt;/P&gt;
&lt;P&gt;So the expected table is&lt;/P&gt;
&lt;P&gt;USA&amp;nbsp; 200,100,300,400&lt;/P&gt;
&lt;P&gt;EU 500,600,150&lt;/P&gt;
&lt;P&gt;Asia 250,700&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another challenge is to order the value from low to high so the expected table will be&lt;/P&gt;
&lt;P&gt;USA&amp;nbsp; 100,200,300,400&lt;/P&gt;
&lt;P&gt;EU 150,500,600&lt;/P&gt;
&lt;P&gt;Asia 250,700&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data tbl1;
Input category group $;
cards;
200 USA
100 USA
300 USA
400 USA
500 EU
600 EU
150 EU
250 Asia
700 Asia
;
run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 05 Apr 2020 06:11:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summary-table-of-group-and-categories-belong-to-the-group-with/m-p/637650#M189543</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-04-05T06:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: Summary table of group and categories belong to the group with comma between values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Summary-table-of-group-and-categories-belong-to-the-group-with/m-p/637653#M189544</link>
      <description>&lt;P&gt;Sort&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;by descending group category;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then, in a data step with&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;by descending group;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;create your new variable with sufficient length, set it to blank at first.group, then do&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;new_var = catx(',',new_var,category);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and then use a subsetting if for last.group.&lt;/P&gt;</description>
      <pubDate>Sun, 05 Apr 2020 06:54:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Summary-table-of-group-and-categories-belong-to-the-group-with/m-p/637653#M189544</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-04-05T06:54:18Z</dc:date>
    </item>
  </channel>
</rss>

