<?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 LAG Function Combined with Conditional Functions in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/LAG-Function-Combined-with-conditional-functions/m-p/699448#M214034</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to find a way to replace the values ​​of some rows, based on a particular row, itself based on the "name" column.&lt;/P&gt;&lt;P&gt;I will explain what I would like to achieve (I have tried many possibilities already, but never have the perfect result).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the "name" column, there are two names, A and B.&lt;BR /&gt;The "ID" column contains "ID", the important identifier being A66571, so I already put it in the first line, by "name" column.&lt;/P&gt;&lt;P&gt;There are then different columns ("AA", "BB"...).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want is that if for ID = "A66571", I subsequently have columns = "NO", then I want to enter "." in these same columns, but for EACH ID (including A66571), for this "name" column.&lt;/P&gt;&lt;P&gt;But if for the ID A66571, I subsequently have columns = "YES", then the other rows, for these same columns do not change.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's what I currently have,&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Have.png" style="width: 668px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/51755iBCDE4F784FFC7F89/image-size/large?v=v2&amp;amp;px=999" role="button" title="Have.png" alt="Have.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;and next what I would like to get :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Want.png" style="width: 669px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/51754iA88F7605DFDDDBE5/image-size/large?v=v2&amp;amp;px=999" role="button" title="Want.png" alt="Want.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;What I never manage to get is, for example, when ID = A66571, and the columns "AA" and "BB" = "YES", for me, when ID = "A08176", the columns "AA" and "BB" are always = "." .&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I hope you will help me solve this problem, I've been blocking it for quite a few hours (using Arrays, Retain, Lags...).&lt;/P&gt;&lt;P&gt;Thank you so much.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kevin_T&lt;/P&gt;</description>
    <pubDate>Tue, 17 Nov 2020 11:09:17 GMT</pubDate>
    <dc:creator>Kevin_T</dc:creator>
    <dc:date>2020-11-17T11:09:17Z</dc:date>
    <item>
      <title>LAG Function Combined with conditional functions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LAG-Function-Combined-with-conditional-functions/m-p/699501#M213987</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;I have been facing a problem for the past few hours, resulting in a result that I suppose is quite easy to solve.&lt;BR /&gt;I will quickly describe the data to you, and then I will tell you what I would like to get.&lt;/P&gt;
&lt;P&gt;Here is what I currently have: &lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Have.png" style="width: 668px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/51755iBCDE4F784FFC7F89/image-size/large?v=v2&amp;amp;px=999" role="button" title="Have.png" alt="Have.png" /&gt;&lt;/span&gt;&lt;BR /&gt;The "name" column simply contains two values, "A" or "B".&lt;/P&gt;
&lt;P&gt;The second column, "ID" contains various identifiers, including "A66571", which is the most important ID in this issue.&lt;/P&gt;
&lt;P&gt;The other columns ("AA", "BB" ...) are columns with either "YES" or "NO".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I would like is that for each different value of "name", and when "ID" = "A66571", if a column&lt;BR /&gt;("AA" and / or "BB" ...) = "YES", then we keep "YES"; if "ID" = "A66571" and column = "NO", then "." for all this column, including for "ID" = "A66571"&lt;BR /&gt;(for each value different from "name" obviously).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But if "ID" is different from "A66571", and if a column ("AA" for example) = "YES", then we keep "YES",&lt;BR /&gt;if the column = "NO", then we keep "NO" (and therefore keep the "." as specified in the previous step).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is what I would like to get: &lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Want.png" style="width: 669px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/51754iA88F7605DFDDDBE5/image-size/large?v=v2&amp;amp;px=999" role="button" title="Want.png" alt="Want.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I hope you can help me, I've been stuck for several hours now.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;Kevin_T&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 21:26:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LAG-Function-Combined-with-conditional-functions/m-p/699501#M213987</guid>
      <dc:creator>Kevin_T</dc:creator>
      <dc:date>2020-11-17T21:26:31Z</dc:date>
    </item>
    <item>
      <title>LAG Function Combined with Conditional Functions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LAG-Function-Combined-with-conditional-functions/m-p/699448#M214034</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to find a way to replace the values ​​of some rows, based on a particular row, itself based on the "name" column.&lt;/P&gt;&lt;P&gt;I will explain what I would like to achieve (I have tried many possibilities already, but never have the perfect result).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the "name" column, there are two names, A and B.&lt;BR /&gt;The "ID" column contains "ID", the important identifier being A66571, so I already put it in the first line, by "name" column.&lt;/P&gt;&lt;P&gt;There are then different columns ("AA", "BB"...).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want is that if for ID = "A66571", I subsequently have columns = "NO", then I want to enter "." in these same columns, but for EACH ID (including A66571), for this "name" column.&lt;/P&gt;&lt;P&gt;But if for the ID A66571, I subsequently have columns = "YES", then the other rows, for these same columns do not change.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's what I currently have,&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Have.png" style="width: 668px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/51755iBCDE4F784FFC7F89/image-size/large?v=v2&amp;amp;px=999" role="button" title="Have.png" alt="Have.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;and next what I would like to get :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Want.png" style="width: 669px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/51754iA88F7605DFDDDBE5/image-size/large?v=v2&amp;amp;px=999" role="button" title="Want.png" alt="Want.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;What I never manage to get is, for example, when ID = A66571, and the columns "AA" and "BB" = "YES", for me, when ID = "A08176", the columns "AA" and "BB" are always = "." .&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I hope you will help me solve this problem, I've been blocking it for quite a few hours (using Arrays, Retain, Lags...).&lt;/P&gt;&lt;P&gt;Thank you so much.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kevin_T&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 11:09:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LAG-Function-Combined-with-conditional-functions/m-p/699448#M214034</guid>
      <dc:creator>Kevin_T</dc:creator>
      <dc:date>2020-11-17T11:09:17Z</dc:date>
    </item>
    <item>
      <title>Re: LAG Function Combined with conditional functions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LAG-Function-Combined-with-conditional-functions/m-p/699520#M213995</link>
      <description>&lt;P&gt;See if the answer from&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;here works for you&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/LAG-Not-Copying-Data-Lag-Line/td-p/699227" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/LAG-Not-Copying-Data-Lag-Line/td-p/699227&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 14:41:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LAG-Function-Combined-with-conditional-functions/m-p/699520#M213995</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-11-17T14:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: LAG Function Combined with conditional functions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LAG-Function-Combined-with-conditional-functions/m-p/699530#M213997</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I've already seen this topic and the answer, which didn't help me.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 15:02:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LAG-Function-Combined-with-conditional-functions/m-p/699530#M213997</guid>
      <dc:creator>Kevin_T</dc:creator>
      <dc:date>2020-11-17T15:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: LAG Function Combined with conditional functions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LAG-Function-Combined-with-conditional-functions/m-p/699619#M214015</link>
      <description>&lt;P&gt;Here's an example, I've added comments so hopefully it will make sense&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Build sample HAVE data */

%let seed=18 ;

data have ;
	keep name id aa bb cc dd ee ;
	drop i k ;
	names="AB" ;
	yesno="YN" ;
	array yn(5) $ aa bb cc dd ee ;
	do i = 1 to 2 ;
		do id=1 to 8 ;
			do k=1 to 5 ; 
				yn{k}=substr(yesno,int(ranuni(&amp;amp;seed)*2)+1,1) ;
			end ;
			name=substr(names, i,1) ; 
			output ;
		end ;
	end ;
run ;


data want ;
	/* Array to hold the values */
	array yn{5} $ aa bb cc dd ee  ;
	/* simple flag string the first 0 refers to aa, second to bb, etc... */
	/* if flag is Y then we want to keep those values */
	/* if flag is N then we want to set those to missing */
	retain
		keepVar "NNNNN" ;
	set have ;
	by name ;
	/* If it's the first occurance of a name */
	if first.name then do ;
		/* Look at the 5 variables aa, bb, cc, dd, ee                */
		/* set the keepVar flags to only maintain those thare ware Y */
		/* You might need to add something here for your ID=A66571   */
		do i=1 to 5 ;
			substr(keepVar,i,1)=yn{i} ;
		end ;
		put name= keepVar= ;
	end ;
	/* Now that keepVar is defined we can loop through the variables */
	/* setting any where the first record was N to missing */
	do i=1 to 5 ;
		if substr(keepVar,i,1)="N" then 
			yn{i}="." ;
	end ;

run ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Nov 2020 20:38:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LAG-Function-Combined-with-conditional-functions/m-p/699619#M214015</guid>
      <dc:creator>AMSAS</dc:creator>
      <dc:date>2020-11-17T20:38:08Z</dc:date>
    </item>
    <item>
      <title>Re: LAG Function Combined with conditional functions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LAG-Function-Combined-with-conditional-functions/m-p/699626#M214019</link>
      <description>&lt;P&gt;You don't want to LAG() anything. Sounds like you need to RETAIN the values from the first observation in each group so you can use them.&amp;nbsp; This is assuming that the specific value of "&lt;SPAN&gt;A66571" is NOT important. Instead it is just the fact that it is the first observation in the group.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Since you don't seem to want to output the retained values you can actually just use a TEMPORARY array.&amp;nbsp; Values in temporary arrays are always retained across observations.&amp;nbsp; That way you don't need to invent new variable names or issue RETAIN statement for them.&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  by name;
  array current AA -- HH ;
  array first [100] $3 _temporary_;
  if first.name then do index=1 to dim(current);
    first[index] = current[index];
  end;
  do index=1 to dim(current);
    if 'NO' = first[index] then current[index]=' ' ;
  end;
  drop index;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I just used 100 for the dimension of the temporary array so that it is larger than any dimension you might have for the original list of variables.&amp;nbsp; Also the positional variable list is assuming that AA to HH are adjacent in the input table.&amp;nbsp; Also assumed that they are character strings with maximum of 3 bytes long.&amp;nbsp; Also changed it to set the values to blanks, not sure why you would want to store a period into a character variable.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 21:46:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LAG-Function-Combined-with-conditional-functions/m-p/699626#M214019</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-11-17T21:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: LAG Function Combined with Conditional Functions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LAG-Function-Combined-with-conditional-functions/m-p/699639#M214035</link>
      <description>&lt;P&gt;You don't provide usable test data, so I'l just provide a snippet.&lt;/P&gt;
&lt;P&gt;I have not understood how you use ID.&lt;/P&gt;
&lt;P&gt;Something like this should work:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;array VALUES [8] $ AA--HH;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;array RETAIN [8] _temporary_;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;do I=1 to 8;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; if VALUES[I]='YES' then KEEP[I]=1;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; if ^KEEP[I] then VALUES[I]='.';&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;end;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Nov 2020 23:27:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LAG-Function-Combined-with-conditional-functions/m-p/699639#M214035</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-11-17T23:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: LAG Function Combined with Conditional Functions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LAG-Function-Combined-with-conditional-functions/m-p/699675#M214036</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/297306"&gt;@Kevin_T&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to find a way to replace the values ​​of some rows, based on a particular row, itself based on the "name" column.&lt;/P&gt;
&lt;P&gt;I will explain what I would like to achieve (I have tried many possibilities already, but never have the perfect result).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the "name" column, there are two names, A and B.&lt;BR /&gt;The "ID" column contains "ID", the important identifier being A66571, so I already put it in the first line, by "name" column.&lt;/P&gt;
&lt;P&gt;There are then different columns ("AA", "BB"...).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I want is that if for ID = "A66571", I subsequently have columns = "NO", then I want to enter "." in these same columns, but for EACH ID (including A66571), for this "name" column.&lt;/P&gt;
&lt;P&gt;But if for the ID A66571, I subsequently have columns = "YES", then the other rows, for these same columns do not change.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's what I currently have,&lt;/P&gt;
&lt;P&gt;[...]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;and next what I would like to get :&lt;/P&gt;
&lt;P&gt;[...]&lt;BR /&gt;&lt;BR /&gt;What I never manage to get is, for example, when ID = A66571, and the columns "AA" and "BB" = "YES", for me, when ID = "A08176", the columns "AA" and "BB" are always = "." .&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I hope you will help me solve this problem, I've been blocking it for quite a few hours (using Arrays, Retain, Lags...).&lt;/P&gt;
&lt;P&gt;Thank you so much.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kevin_T&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Please don't double post the same question. I have merged your second post with the original one.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2020 05:55:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LAG-Function-Combined-with-conditional-functions/m-p/699675#M214036</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-11-18T05:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: LAG Function Combined with conditional functions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LAG-Function-Combined-with-conditional-functions/m-p/699693#M214043</link>
      <description>&lt;P&gt;Hello &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/226241"&gt;@AMSAS&lt;/a&gt;,&amp;nbsp;your answer meets my expectations exactly!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I was not far from this result, I had not thought of storing the values ​​found in a new variable (here keepVar), indeed, instead of Y or N, I had YES or NO, so I had to adapt the base table with the TRANWRD function, then following your program, repeat the reverse step with TRANWRD.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for your contribution, it helped me a lot!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kevin_T&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2020 08:17:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LAG-Function-Combined-with-conditional-functions/m-p/699693#M214043</guid>
      <dc:creator>Kevin_T</dc:creator>
      <dc:date>2020-11-18T08:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: LAG Function Combined with conditional functions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LAG-Function-Combined-with-conditional-functions/m-p/699699#M214044</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought I could use the LAG function but it's tricky to use with this kind of problem. I've tried TEMPORARY arrays before posting here, but it didn't work.&lt;/P&gt;&lt;P&gt;And&amp;nbsp;I also considered using a BLANK instead of a period.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I see your solution works too, so thanks for your contribution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kevin_T&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2020 08:45:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LAG-Function-Combined-with-conditional-functions/m-p/699699#M214044</guid>
      <dc:creator>Kevin_T</dc:creator>
      <dc:date>2020-11-18T08:45:56Z</dc:date>
    </item>
    <item>
      <title>Re: LAG Function Combined with Conditional Functions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LAG-Function-Combined-with-conditional-functions/m-p/699702#M214045</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, your snippet also works, I just modified some parts of the code to match my personal code.&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/16961"&gt;@ChrisNZ&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have not understood how you use ID.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Well, If the ID=A66571, for each new value of the column "name", and if a column (AA for example) is equal to "NO", so all the AA column for ths particular "name" value is set to missing, and so on for BB...&lt;/P&gt;&lt;P&gt;So, A66571 is my "Master ID", and the others just follow Master ID's rules.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for contributing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kevin_T&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2020 08:53:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LAG-Function-Combined-with-conditional-functions/m-p/699702#M214045</guid>
      <dc:creator>Kevin_T</dc:creator>
      <dc:date>2020-11-18T08:53:44Z</dc:date>
    </item>
    <item>
      <title>Re: LAG Function Combined with Conditional Functions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LAG-Function-Combined-with-conditional-functions/m-p/699703#M214046</link>
      <description>&lt;P&gt;Hello &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15475"&gt;@andreas_lds&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/15475"&gt;@andreas_lds&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Please don't double post the same question. I have merged your second post with the original one.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Thank you for merging the two topics.&lt;/P&gt;&lt;P&gt;I'm sorry, this was my first post on this site, and when I created the first topic, I realized 2 hours later that it was gone, so I created a new one, not knowing that the first was considered spam...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kevin_T&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2020 09:05:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LAG-Function-Combined-with-conditional-functions/m-p/699703#M214046</guid>
      <dc:creator>Kevin_T</dc:creator>
      <dc:date>2020-11-18T09:05:18Z</dc:date>
    </item>
    <item>
      <title>Re: LAG Function Combined with Conditional Functions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/LAG-Function-Combined-with-conditional-functions/m-p/700018#M214183</link>
      <description>&lt;P&gt;If my snippet works, I hope you use that rather than the chosen solution.&lt;/P&gt;
&lt;P&gt;Simpler code is easier to read and to maintain.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Nov 2020 22:28:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/LAG-Function-Combined-with-conditional-functions/m-p/700018#M214183</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-11-18T22:28:15Z</dc:date>
    </item>
  </channel>
</rss>

