<?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 Di Studio - Previous Row in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Di-Studio-Previous-Row/m-p/182625#M3700</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is possible, using only transformations in DI Studio (without using programming), get the previous record of a data set and implement the logic below?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Input:&lt;/P&gt;&lt;P&gt;1 a&lt;/P&gt;&lt;P&gt;1 b&lt;/P&gt;&lt;P&gt;1 c&lt;/P&gt;&lt;P&gt;2 d&lt;/P&gt;&lt;P&gt;3 e&lt;/P&gt;&lt;P&gt;3 f&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output:&lt;/P&gt;&lt;P&gt;I need to calculate a new column that uses the value from the previous record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1 a&amp;nbsp;&amp;nbsp; a&lt;/P&gt;&lt;P&gt;1 b&amp;nbsp;&amp;nbsp; a-b&lt;/P&gt;&lt;P&gt;1 c&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #ff0000;"&gt;a-b-c&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2 d&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #ff0000;"&gt;d&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;3 e&amp;nbsp;&amp;nbsp; e&lt;/P&gt;&lt;P&gt;3 f&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #ff0000;"&gt;e-f&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Dec 2013 02:28:44 GMT</pubDate>
    <dc:creator>DavidCaliman</dc:creator>
    <dc:date>2013-12-27T02:28:44Z</dc:date>
    <item>
      <title>Di Studio - Previous Row</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Di-Studio-Previous-Row/m-p/182625#M3700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is possible, using only transformations in DI Studio (without using programming), get the previous record of a data set and implement the logic below?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Input:&lt;/P&gt;&lt;P&gt;1 a&lt;/P&gt;&lt;P&gt;1 b&lt;/P&gt;&lt;P&gt;1 c&lt;/P&gt;&lt;P&gt;2 d&lt;/P&gt;&lt;P&gt;3 e&lt;/P&gt;&lt;P&gt;3 f&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output:&lt;/P&gt;&lt;P&gt;I need to calculate a new column that uses the value from the previous record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1 a&amp;nbsp;&amp;nbsp; a&lt;/P&gt;&lt;P&gt;1 b&amp;nbsp;&amp;nbsp; a-b&lt;/P&gt;&lt;P&gt;1 c&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #ff0000;"&gt;a-b-c&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2 d&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #ff0000;"&gt;d&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;3 e&amp;nbsp;&amp;nbsp; e&lt;/P&gt;&lt;P&gt;3 f&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #ff0000;"&gt;e-f&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Dec 2013 02:28:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Di-Studio-Previous-Row/m-p/182625#M3700</guid>
      <dc:creator>DavidCaliman</dc:creator>
      <dc:date>2013-12-27T02:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: Di Studio - Previous Row</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Di-Studio-Previous-Row/m-p/182626#M3701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From your sample (which seems&amp;nbsp; abit inconsistent), I would say no.&lt;/P&gt;&lt;P&gt;If this is a common task, you could package your logic in a&amp;nbsp; User Written Transformation so it could be reused.&lt;/P&gt;&lt;P&gt;But can I question the purpose for this logic? From the little information you give, the calculation doesn't look like anything that needs to be stored in a Data Warehouse process, rather a customized report. Please tell us more about the business requirement for this calculation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Dec 2013 17:01:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Di-Studio-Previous-Row/m-p/182626#M3701</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2013-12-28T17:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: Di Studio - Previous Row</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Di-Studio-Previous-Row/m-p/182627#M3702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN class="hps"&gt;I need the&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;following&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;final result&lt;/SPAN&gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Input:&lt;/P&gt;&lt;P&gt;cd dsc&lt;/P&gt;&lt;P&gt;1 a&lt;/P&gt;&lt;P&gt;1 b&lt;/P&gt;&lt;P&gt;1 c&lt;/P&gt;&lt;P&gt;2 d&lt;/P&gt;&lt;P&gt;3 e&lt;/P&gt;&lt;P&gt;3 f&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="hps"&gt;I need to&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;group by&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;code and&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;do&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;a concatenation&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;descriptions&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cd concat &lt;/P&gt;&lt;P&gt;1 &lt;SPAN style="color: #ff0000;"&gt;a-b-c&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2 &lt;SPAN style="color: #ff0000;"&gt;d&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;3 &lt;SPAN style="color: #ff0000;"&gt;e-f&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Dec 2013 17:02:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Di-Studio-Previous-Row/m-p/182627#M3702</guid>
      <dc:creator>DavidCaliman</dc:creator>
      <dc:date>2013-12-30T17:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: Di Studio - Previous Row</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Di-Studio-Previous-Row/m-p/182628#M3703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, but I still miss the business requirement, and how do you define the rule which values you need to concatenate?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Dec 2013 11:27:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Di-Studio-Previous-Row/m-p/182628#M3703</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2013-12-31T11:27:06Z</dc:date>
    </item>
    <item>
      <title>Re: Di Studio - Previous Row</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Di-Studio-Previous-Row/m-p/182629#M3704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found the answer to this problem on the link below.&lt;/P&gt;&lt;P&gt;I added code in the user written code transformation and it worked.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://communities.sas.com/message/53141#53141"&gt;https://communities.sas.com/message/53141&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Dec 2013 19:36:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Di-Studio-Previous-Row/m-p/182629#M3704</guid>
      <dc:creator>DavidCaliman</dc:creator>
      <dc:date>2013-12-31T19:36:06Z</dc:date>
    </item>
  </channel>
</rss>

