<?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 Delete consecutive repeating values in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Delete-consecutive-repeating-values/m-p/663330#M85192</link>
    <description>&lt;P&gt;I have a data table where some of the columns have values that repeat because the program that generates the data holds the last value if a new one isn't given.&amp;nbsp; This means I can't use the "select duplicate rows" option because that deletes all duplicates not just ones that are repeating. I also don't want to delete the rows, just the values in the "cells".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;4.1&lt;/LI&gt;&lt;LI&gt;3.4&lt;/LI&gt;&lt;LI&gt;3.4 - delete value&lt;/LI&gt;&lt;LI&gt;3.4 - delete value&lt;/LI&gt;&lt;LI&gt;5.1&lt;/LI&gt;&lt;LI&gt;2.6&lt;/LI&gt;&lt;LI&gt;4.1 - keep!&lt;/LI&gt;&lt;LI&gt;3.4 - keep!&lt;/LI&gt;&lt;LI&gt;7.2&lt;/LI&gt;&lt;LI&gt;7.2 - delete value&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;7.2 - delete value&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This would become&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;4.1&lt;/LI&gt;&lt;LI&gt;3.4&lt;/LI&gt;&lt;LI&gt;.&lt;/LI&gt;&lt;LI&gt;.&lt;/LI&gt;&lt;LI&gt;5.1&lt;/LI&gt;&lt;LI&gt;2.6&lt;/LI&gt;&lt;LI&gt;4.1&lt;/LI&gt;&lt;LI&gt;3.4&lt;/LI&gt;&lt;LI&gt;7.2&lt;/LI&gt;&lt;LI&gt;.&lt;/LI&gt;&lt;LI&gt;.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;JMP Pro 17.0.0&lt;/P&gt;</description>
    <pubDate>Fri, 28 Jul 2023 13:24:01 GMT</pubDate>
    <dc:creator>JMPtxUser36</dc:creator>
    <dc:date>2023-07-28T13:24:01Z</dc:date>
    <item>
      <title>Delete consecutive repeating values</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-consecutive-repeating-values/m-p/663330#M85192</link>
      <description>&lt;P&gt;I have a data table where some of the columns have values that repeat because the program that generates the data holds the last value if a new one isn't given.&amp;nbsp; This means I can't use the "select duplicate rows" option because that deletes all duplicates not just ones that are repeating. I also don't want to delete the rows, just the values in the "cells".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;4.1&lt;/LI&gt;&lt;LI&gt;3.4&lt;/LI&gt;&lt;LI&gt;3.4 - delete value&lt;/LI&gt;&lt;LI&gt;3.4 - delete value&lt;/LI&gt;&lt;LI&gt;5.1&lt;/LI&gt;&lt;LI&gt;2.6&lt;/LI&gt;&lt;LI&gt;4.1 - keep!&lt;/LI&gt;&lt;LI&gt;3.4 - keep!&lt;/LI&gt;&lt;LI&gt;7.2&lt;/LI&gt;&lt;LI&gt;7.2 - delete value&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;7.2 - delete value&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This would become&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;4.1&lt;/LI&gt;&lt;LI&gt;3.4&lt;/LI&gt;&lt;LI&gt;.&lt;/LI&gt;&lt;LI&gt;.&lt;/LI&gt;&lt;LI&gt;5.1&lt;/LI&gt;&lt;LI&gt;2.6&lt;/LI&gt;&lt;LI&gt;4.1&lt;/LI&gt;&lt;LI&gt;3.4&lt;/LI&gt;&lt;LI&gt;7.2&lt;/LI&gt;&lt;LI&gt;.&lt;/LI&gt;&lt;LI&gt;.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;JMP Pro 17.0.0&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jul 2023 13:24:01 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-consecutive-repeating-values/m-p/663330#M85192</guid>
      <dc:creator>JMPtxUser36</dc:creator>
      <dc:date>2023-07-28T13:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: Delete consecutive repeating values</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-consecutive-repeating-values/m-p/663346#M85194</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Vous pouvez utiliser un script comme ci-dessous :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To here(1);

dt= current data table();

// nouvelle colonne
dt &amp;lt;&amp;lt; New Column( "nouvelles valeurs",
	Numeric,
	"Continuous",
	Format( "Best", 12 )
);


// Modifier la formule de colonne&amp;nbsp;: nouvelles valeurs
dt:nouvelles valeurs &amp;lt;&amp;lt;
Set Formula(
	If( :valeurs[Sequence( 1, N rows(dt), 1, 1 )] == :valeurs[Sequence( 2, N rows(dt), 1, 1 )],
		:nouvelles valeurs = .,
		:nouvelles valeurs = :valeurs
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 28 Jul 2023 13:41:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-consecutive-repeating-values/m-p/663346#M85194</guid>
      <dc:creator>hcarr01</dc:creator>
      <dc:date>2023-07-28T13:41:29Z</dc:date>
    </item>
    <item>
      <title>Re: Delete consecutive repeating values</title>
      <link>https://community.jmp.com/t5/Discussions/Delete-consecutive-repeating-values/m-p/663506#M85198</link>
      <description>&lt;P&gt;I would most likely use either Dif or Lag and create new column. Then based on the values of that column, remove values from existing column&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = New Table("Untitled",
	Add Rows(11),
	Compress File When Saved(1),
	New Column("Column 1",
		Numeric,
		"Continuous",
		Format("Best", 12),
		Set Values([4.1, 3.4, 3.4, 3.4, 5.1, 2.6, 4.1, 3.4, 7.2, 7.2, 7.2])
	)
);

dt &amp;lt;&amp;lt; New Column("ToDelete", Numeric, Nominal, &amp;lt;&amp;lt; Set Each Value(
	Dif(:Column 1) == 0
));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or you can create new column with values (IfMZ is used to keep first row)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = New Table("Untitled",
	Add Rows(11),
	Compress File When Saved(1),
	New Column("Column 1",
		Numeric,
		"Continuous",
		Format("Best", 12),
		Set Values([4.1, 3.4, 3.4, 3.4, 5.1, 2.6, 4.1, 3.4, 7.2, 7.2, 7.2])
	)
);

dt &amp;lt;&amp;lt; New Column("NewValues", Numeric, Nominal, &amp;lt;&amp;lt; Set Each Value(
	IfMZ(Dif(:Column 1) == 0,
		.
	,
		:Column 1
	)
));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1690565391398.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/55416i337AFCDD86EF6EBD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1690565391398.png" alt="jthi_0-1690565391398.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jul 2023 17:30:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Delete-consecutive-repeating-values/m-p/663506#M85198</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2023-07-28T17:30:03Z</dc:date>
    </item>
  </channel>
</rss>

