<?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: Help with rolling data into one row in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Help-with-rolling-data-into-one-row/m-p/616348#M18899</link>
    <description>&lt;P&gt;It's a bit more complicated than that (at least in my head). I basically want to keep only one individual (say XX-1) for all time periods, using that as the basis for XX.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But there are multiple groups too, so I'd want to keep 1 of XX, one of AA, etc. Does that make sense?&lt;/P&gt;</description>
    <pubDate>Thu, 09 Jan 2020 23:28:13 GMT</pubDate>
    <dc:creator>corji</dc:creator>
    <dc:date>2020-01-09T23:28:13Z</dc:date>
    <item>
      <title>Help with rolling data into one row</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Help-with-rolling-data-into-one-row/m-p/616345#M18897</link>
      <description>&lt;P&gt;Hi, I'm having a little difficulty with the data below:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;datalines;&lt;BR /&gt;01OCT2017 XX-1 XX&amp;nbsp; 0&lt;BR /&gt;01JAN2018 XX-1 XX&amp;nbsp; 7320&lt;BR /&gt;01APR2018 XX-1 XX 30240&lt;BR /&gt;01JUL2018 XX-1 XX&amp;nbsp; 40600&lt;BR /&gt;01OCT2018 XX-1 XX&amp;nbsp; 45360&lt;BR /&gt;01JAN2019 XX-1 XX&amp;nbsp; 29302&lt;BR /&gt;01APR2019 XX-1 XX&amp;nbsp; 0&lt;BR /&gt;01OCT2017 XX-2 XX&amp;nbsp; 0&lt;BR /&gt;01JAN2018 XX-2 XX&amp;nbsp; 7320&lt;BR /&gt;01APR2018 XX-2 XX&amp;nbsp; 30240&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the above data each individual, signified with the -(number) is part of the overall group XX. Each individual was given a certain amount of money, denoted by the final column; however, the numbers shown are incorrect, as they signify the total for the group, not the individual (as in, for period 1 Jan 2018, 7320 was issued for XX in total, not just XX-1).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to find a way to report out the money given out per time period for XX without the duplicating of values in the money column. Ideally it should look something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Time Period&amp;nbsp; &amp;nbsp;Group&amp;nbsp; &amp;nbsp;Money Issued&lt;/P&gt;&lt;P&gt;01OCT2017&amp;nbsp; &amp;nbsp;XX&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;BR /&gt;01JAN2018&amp;nbsp; &amp;nbsp; XX&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 7320&lt;BR /&gt;01APR2018&amp;nbsp; &amp;nbsp;XX&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 30240&lt;BR /&gt;01JUL2018&amp;nbsp; &amp;nbsp; XX&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 40600&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and so on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could someone help with thinking this through?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 23:03:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Help-with-rolling-data-into-one-row/m-p/616345#M18897</guid>
      <dc:creator>corji</dc:creator>
      <dc:date>2020-01-09T23:03:14Z</dc:date>
    </item>
    <item>
      <title>Re: Help with rolling data into one row</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Help-with-rolling-data-into-one-row/m-p/616347#M18898</link>
      <description>&lt;P&gt;I don't understand the problem. From your output, it seems like you just want to remove XX-1 or XX-2 from each record. Is the logic really that simple, or are there other steps? What happened to the other lines in the input that are not represented in the output?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 23:14:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Help-with-rolling-data-into-one-row/m-p/616347#M18898</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-01-09T23:14:46Z</dc:date>
    </item>
    <item>
      <title>Re: Help with rolling data into one row</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Help-with-rolling-data-into-one-row/m-p/616348#M18899</link>
      <description>&lt;P&gt;It's a bit more complicated than that (at least in my head). I basically want to keep only one individual (say XX-1) for all time periods, using that as the basis for XX.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But there are multiple groups too, so I'd want to keep 1 of XX, one of AA, etc. Does that make sense?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 23:28:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Help-with-rolling-data-into-one-row/m-p/616348#M18899</guid>
      <dc:creator>corji</dc:creator>
      <dc:date>2020-01-09T23:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: Help with rolling data into one row</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Help-with-rolling-data-into-one-row/m-p/616376#M18902</link>
      <description>&lt;P&gt;I think you're looking for the unique entries by time period. nodupkey as it's used below will give you the desired output.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
	input time_period :date9. member $ group $ money_issued;
	format time_period date9.;
	datalines;
01OCT2017 XX-1 XX 0
01JAN2018 XX-1 XX 7320
01APR2018 XX-1 XX 30240
01JUL2018 XX-1 XX 40600
01OCT2018 XX-1 XX 45360
01JAN2019 XX-1 XX 29302
01APR2019 XX-1 XX 0
01OCT2017 XX-2 XX 0
01JAN2018 XX-2 XX 7320
01APR2018 XX-2 XX 30240
;
run;

data desired_output;
	input time_period :date9. group $ money_issued;
	format time_period date9.;
	datalines;
01OCT2017 XX 0
01JAN2018 XX 7320
01APR2018 XX 30240
01JUL2018 XX 40600
01OCT2018 XX 45360
01JAN2019 XX 29302
01APR2019 XX 0
;
run;

proc sort data=have(drop=member) nodupkey out=want;
	by time_period;
run;

proc compare base=desired_output compare=want;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Jan 2020 04:06:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Help-with-rolling-data-into-one-row/m-p/616376#M18902</guid>
      <dc:creator>unison</dc:creator>
      <dc:date>2020-01-10T04:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: Help with rolling data into one row</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Help-with-rolling-data-into-one-row/m-p/616548#M18928</link>
      <description>&lt;P&gt;I think the issue with this solution is that it de-dupes the time periods as well, which I want to keep as is: the periods need to remain as there are other unique groups (think YY to XX, ZZ etc.) that need to have that time period as an identifier. XX isn't the only group.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jan 2020 17:21:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Help-with-rolling-data-into-one-row/m-p/616548#M18928</guid>
      <dc:creator>corji</dc:creator>
      <dc:date>2020-01-10T17:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: Help with rolling data into one row</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Help-with-rolling-data-into-one-row/m-p/616581#M18936</link>
      <description>&lt;P&gt;If I understand what you're saying, try:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=have(drop=member) nodupkey out=want;
	by time_period group;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Jan 2020 19:21:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Help-with-rolling-data-into-one-row/m-p/616581#M18936</guid>
      <dc:creator>unison</dc:creator>
      <dc:date>2020-01-10T19:21:01Z</dc:date>
    </item>
    <item>
      <title>Re: Help with rolling data into one row</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Help-with-rolling-data-into-one-row/m-p/617022#M18994</link>
      <description>&lt;P&gt;This was the one that worked! Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 19:19:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Help-with-rolling-data-into-one-row/m-p/617022#M18994</guid>
      <dc:creator>corji</dc:creator>
      <dc:date>2020-01-13T19:19:54Z</dc:date>
    </item>
  </channel>
</rss>

