<?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: Concatenate through group but ignoring duplicates in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Concatenate-through-group-but-ignoring-duplicates/m-p/479442#M71458</link>
    <description>&lt;P&gt;No, that&amp;nbsp;has worked a charm. Perfect! Thank you.&lt;/P&gt;</description>
    <pubDate>Thu, 19 Jul 2018 10:12:49 GMT</pubDate>
    <dc:creator>CharlesFowler72</dc:creator>
    <dc:date>2018-07-19T10:12:49Z</dc:date>
    <item>
      <title>Concatenate through group but ignoring duplicates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Concatenate-through-group-but-ignoring-duplicates/m-p/479428#M71455</link>
      <description>&lt;P&gt;Starting from a really good post called "concatenate through group by using SAS or PROC SQL, urgent help needed" where there are some great solutions. But I wanted to add in 1 more complication.&lt;/P&gt;&lt;P&gt;Link: &lt;A href="https://communities.sas.com/t5/SAS-Procedures/concatenate-through-group-by-using-SAS-or-PROC-SQL-urgent-help/td-p/111702?nobounce" target="_blank"&gt;https://communities.sas.com/t5/SAS-Procedures/concatenate-through-group-by-using-SAS-or-PROC-SQL-urgent-help/td-p/111702?nobounce&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the original post, the aim is to create a variable which concatenates the groups which a customer is in. For example if Customer A was in Groups 1, 2 and 3 then the variable would read 1/2/3 however it assumed only 1 row per customer per group. What I need is for a customer which has multiple rows in multiple groups with a variable that only reads which groups it is in an not double concatenating any of the groups.&lt;/P&gt;&lt;P&gt;Using table below...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&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just A.The previous post with the link above, which might be a great starting point, returns A/B/B/C for customer 2. A great solution and really quite close to what I am looking for, but some of my customer have a lot of rows in each group and looks a little silly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for the help in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 09:20:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Concatenate-through-group-but-ignoring-duplicates/m-p/479428#M71455</guid>
      <dc:creator>CharlesFowler72</dc:creator>
      <dc:date>2018-07-19T09:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate through group but ignoring duplicates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Concatenate-through-group-but-ignoring-duplicates/m-p/479438#M71456</link>
      <description>&lt;P&gt;if you remove duplicates using proc sort and using the solution given in the link should solve the problem&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 10:03:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Concatenate-through-group-but-ignoring-duplicates/m-p/479438#M71456</guid>
      <dc:creator>kiranv_</dc:creator>
      <dc:date>2018-07-19T10:03:51Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate through group but ignoring duplicates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Concatenate-through-group-but-ignoring-duplicates/m-p/479439#M71457</link>
      <description>&lt;P&gt;You could create an intermediate table or better a view which contains the unique customer-group pairs and then continue from there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input Customer Group $;
cards;
1 A
1 B
2 A
2 B
2 B
2 C
3 A
3 A
;

proc sql;
create view cust_grp as
select distinct customer, group
from have;
quit;

data want;
length grps $30;
do until(last.customer);
  set cust_grp;
  by customer;
  grps=catx('/',grps, group);
end;
drop group;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or would you like to distinguish between grps='A/B' and grps='B/A' ?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 10:04:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Concatenate-through-group-but-ignoring-duplicates/m-p/479439#M71457</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-07-19T10:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate through group but ignoring duplicates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Concatenate-through-group-but-ignoring-duplicates/m-p/479442#M71458</link>
      <description>&lt;P&gt;No, that&amp;nbsp;has worked a charm. Perfect! Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 10:12:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Concatenate-through-group-but-ignoring-duplicates/m-p/479442#M71458</guid>
      <dc:creator>CharlesFowler72</dc:creator>
      <dc:date>2018-07-19T10:12:49Z</dc:date>
    </item>
  </channel>
</rss>

