<?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 Value from a precedent row in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Value-from-a-precedent-row/m-p/919690#M362258</link>
    <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm wondering how to take the value from a precedent raw. The lag function doesn't work.&lt;/P&gt;
&lt;P&gt;I have joined the data.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SASdevAnneMarie_0-1710096753921.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/94543i7578AB947AFFC88F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SASdevAnneMarie_0-1710096753921.png" alt="SASdevAnneMarie_0-1710096753921.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Thank you very much for your help.&lt;/P&gt;</description>
    <pubDate>Sun, 10 Mar 2024 18:53:20 GMT</pubDate>
    <dc:creator>SASdevAnneMarie</dc:creator>
    <dc:date>2024-03-10T18:53:20Z</dc:date>
    <item>
      <title>Value from a precedent row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Value-from-a-precedent-row/m-p/919690#M362258</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm wondering how to take the value from a precedent raw. The lag function doesn't work.&lt;/P&gt;
&lt;P&gt;I have joined the data.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SASdevAnneMarie_0-1710096753921.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/94543i7578AB947AFFC88F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SASdevAnneMarie_0-1710096753921.png" alt="SASdevAnneMarie_0-1710096753921.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Thank you very much for your help.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Mar 2024 18:53:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Value-from-a-precedent-row/m-p/919690#M362258</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2024-03-10T18:53:20Z</dc:date>
    </item>
    <item>
      <title>Re: Value from a precedent row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Value-from-a-precedent-row/m-p/919691#M362259</link>
      <description>Could you elaborate, what do you mean when you say the lag function does not work?&lt;BR /&gt;&lt;BR /&gt;Mind showing what you’ve tried?</description>
      <pubDate>Sun, 10 Mar 2024 18:59:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Value-from-a-precedent-row/m-p/919691#M362259</guid>
      <dc:creator>Mazi</dc:creator>
      <dc:date>2024-03-10T18:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: Value from a precedent row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Value-from-a-precedent-row/m-p/919694#M362261</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/286185"&gt;@SASdevAnneMarie&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/286185"&gt;@SASdevAnneMarie&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;The lag function doesn't work.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I guess you mean that values are carried over from one BY group to the next. But this can be avoided:&lt;/P&gt;
&lt;PRE&gt;data want;
set have;
by numero code2;
MT2_CORR_befor=&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;ifn(first.code2,.&lt;/STRONG&gt;&lt;STRONG&gt;,&lt;/STRONG&gt;&lt;/FONT&gt;lag(MT_2_CORR)&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/FONT&gt;;
run;&lt;/PRE&gt;</description>
      <pubDate>Sun, 10 Mar 2024 19:05:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Value-from-a-precedent-row/m-p/919694#M362261</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2024-03-10T19:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: Value from a precedent row</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Value-from-a-precedent-row/m-p/919697#M362263</link>
      <description>Thank you !</description>
      <pubDate>Sun, 10 Mar 2024 19:11:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Value-from-a-precedent-row/m-p/919697#M362263</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2024-03-10T19:11:05Z</dc:date>
    </item>
  </channel>
</rss>

