<?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: delete duplicate in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/delete-duplicate/m-p/35697#M21060</link>
    <description>&lt;P&gt;Look in the Scripting Index&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Help==&amp;gt;Scripting Index==&amp;gt;Functions==&amp;gt;Lag&lt;/P&gt;
&lt;P&gt;Also, look in the book, Using JMP&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Help==&amp;gt;Books==Using JMP&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Lag &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Returns the value of the first argument in the row defined by the current row less the second argument. The default Lag is one, which you can change to any number. The value returned for any lag that identifies a row number less than one is missing. Note that Lag(X, n) gives the same result as the subscripted notation, XRow( )–n.&lt;/P&gt;</description>
    <pubDate>Mon, 13 Feb 2017 03:09:03 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2017-02-13T03:09:03Z</dc:date>
    <item>
      <title>delete duplicate</title>
      <link>https://community.jmp.com/t5/Discussions/delete-duplicate/m-p/35241#M20800</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to sort my Data Table, it hase&amp;nbsp;duplicate values:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture11.PNG" style="width: 301px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/4991i2026483B6EBE2F0B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Capture11.PNG" alt="Capture11.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;As you see, I have same value for different name in CHART_PARAMETER, my interest is to take only rows that have one type of&amp;nbsp;CHART_PARAMETER per each value. I tryed Filter Data but it opens JMP window with options to choose, I am trying to do all calculations so user wont see them and create a new Data Table with selected rows and do furthe manipulation with this Data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Feb 2017 19:09:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/delete-duplicate/m-p/35241#M20800</guid>
      <dc:creator>RosDima</dc:creator>
      <dc:date>2017-02-02T19:09:29Z</dc:date>
    </item>
    <item>
      <title>Re: delete duplicate</title>
      <link>https://community.jmp.com/t5/Discussions/delete-duplicate/m-p/35245#M20803</link>
      <description>&lt;P&gt;Here is a quick script that will return a data table where it contains only the chart_values that have one entry&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Current Data Table();
dtsumm = dt &amp;lt;&amp;lt; Summary(
	invisible,
	Group( :Chart_Value ),
	Freq( "None" ),
	Weight( "None" ),
	Link to original data table( 0 )
);
dtsumm &amp;lt;&amp;lt; select where( :n rows &amp;gt; 1 );
dtsumm &amp;lt;&amp;lt; delete rows;
dtfinal = dt &amp;lt;&amp;lt; Join(
	With( dtsumm ),
	By Matching Columns( :Chart_Value = :Chart_Value ),
	Drop multiples( 0, 0 ),
	Include Nonmatches( 0, 0 ),
	Preserve main table order( 1 )
);
Close( dtsum, nosave );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Feb 2017 19:31:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/delete-duplicate/m-p/35245#M20803</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-02-02T19:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: delete duplicate</title>
      <link>https://community.jmp.com/t5/Discussions/delete-duplicate/m-p/35470#M20926</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks for a quick reply.&lt;/P&gt;&lt;P&gt;Now I am trying to select last 3 point by date for each Entity. I can group Table by Entity&amp;nbsp;but after that I need to find last 3 point by date range. How can I do it using select where or any other function.&lt;/P&gt;&lt;P&gt;RCL is my Entity and Entiry_1 names, and I need to select 3 last Values by date for each column. For example:&lt;/P&gt;&lt;P&gt;RCL101 3 last Values by date in Chart_Value and&amp;nbsp;&lt;SPAN&gt;Chart_Value_1.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Will use any help:)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;My Data table:&lt;/P&gt;&lt;PRE&gt;LOT_DATA_COLLECT_DATE	CHART_TYPE	MODULE	CHART_VALUE	ENTITY	MEASUREMENT_SET_NAME	MONITOR_SET_NAME	ENTITY_1	LOT_DATA_COLLECT_DATE_1	CHART_VALUE_1	MONITOR_SET_NAME_1	CHART_TYPE_1
2017/01/20 2:46:43 PM	X-BAR	RCL FE	8234.73	RCL104	RCLFE.BATCH_OX_WTW.74.DER	RCLFE.BATCH_ASHRATE_PST.74.MON					
2017/01/20 8:25:35 PM	X-BAR	RCL FE	8734.13	RCL104	RCLFE.BATCH_OX_WTW.74.DER	RCLFE.BATCH_ASHRATE_PST.74.MON					
2017/01/22 4:40:38 AM	X-BAR	RCL FE	8743.67	RCL104	RCLFE.BATCH_OX_WTW.74.DER	RCLFE.BATCH_ASHRATE_PST.74.MON					
2017/01/22 3:51:54 PM	X-BAR	RCL FE	8539.85	RCL104	RCLFE.BATCH_OX_WTW.74.DER	RCLFE.BATCH_ASHRATE_PST.74.MON					
2017/01/25 10:39:43 AM	X-BAR	RCL FE	9179.86	RCL104	RCLFE.BATCH_OX_WTW.74.DER	RCLFE.BATCH_ASHRATE_PST.74.MON					
2017/01/28 9:03:46 PM	X-BAR	RCL FE	8097.51	RCL104	RCLFE.BATCH_OX_WTW.74.DER	RCLFE.BATCH_ASHRATE_PST.74.MON					
2017/01/31 10:26:57 PM	X-BAR	RCL FE	7979.97	RCL104	RCLFE.BATCH_OX_WTW.74.DER	RCLFE.BATCH_ASHRATE_PST.74.MON					
2017/02/07 6:53:08 PM	X-BAR	RCL FE	7992.35	RCL104	RCLFE.BATCH_OX_WTW.74.DER	RCLFE.BATCH_ASHRATE_PST.74.MON					
2017/01/22 8:40:50 AM	X-BAR	RCL FE	7672.35	RCL103	RCLFE.BATCH_OX_WTW.74.DER	RCLFE.BATCH_ASHRATE_PST.74.MON					
2017/01/27 7:54:09 AM	X-BAR	RCL FE	8319.25	RCL103	RCLFE.BATCH_OX_WTW.74.DER	RCLFE.BATCH_ASHRATE_PST.74.MON					
2017/02/02 3:11:43 AM	X-BAR	RCL FE	7506.47	RCL103	RCLFE.BATCH_OX_WTW.74.DER	RCLFE.BATCH_ASHRATE_PST.74.MON					
2017/02/06 10:42:00 PM	X-BAR	RCL FE	8046.7	RCL103	RCLFE.BATCH_OX_WTW.74.DER	RCLFE.BATCH_ASHRATE_PST.74.MON					
2017/01/18 12:47:10 AM	X-BAR	RCL FE	81.0555	RCL102	RCLFE.BATCH_OX_WTW.74.DER	RCLFE.BATCH_ASHRATE_PST.74.MON					
2017/01/20 12:35:05 PM	X-BAR	RCL FE	9159.32	RCL102	RCLFE.BATCH_OX_WTW.74.DER	RCLFE.BATCH_ASHRATE_PST.74.MON					
2017/01/28 1:58:47 AM	X-BAR	RCL FE	9278.75	RCL102	RCLFE.BATCH_OX_WTW.74.DER	RCLFE.BATCH_ASHRATE_PST.74.MON					
2017/02/03 4:38:46 AM	X-BAR	RCL FE	9288.21	RCL102	RCLFE.BATCH_OX_WTW.74.DER	RCLFE.BATCH_ASHRATE_PST.74.MON					
2017/02/07 4:24:21 AM	X-BAR	RCL FE	8677.35	RCL102	RCLFE.BATCH_OX_WTW.74.DER	RCLFE.BATCH_ASHRATE_PST.74.MON					
2017/01/21 7:22:14 AM	X-BAR	RCL FE	9969.63	RCL101	RCLFE.BATCH_OX_WTW.74.DER	RCLFE.BATCH_ASHRATE_PST.74.MON					
2017/01/24 1:10:21 PM	X-BAR	RCL FE	9291.7	RCL101	RCLFE.BATCH_OX_WTW.74.DER	RCLFE.BATCH_ASHRATE_PST.74.MON					
2017/01/31 1:16:24 AM	X-BAR	RCL FE	9521.71	RCL101	RCLFE.BATCH_OX_WTW.74.DER	RCLFE.BATCH_ASHRATE_PST.74.MON					
2017/02/05 4:41:46 AM	X-BAR	RCL FE	9287.35	RCL101	RCLFE.BATCH_OX_WTW.74.DER	RCLFE.BATCH_ASHRATE_PST.74.MON					
							RCL101	2017/01/21 7:34:05 AM	3897.38724	RCLFE.ASHRATE_PST.74.MON	X-BAR
							RCL101	2017/01/24 1:28:26 PM	3898.22897	RCLFE.ASHRATE_PST.74.MON	X-BAR
							RCL101	2017/01/31 12:17:43 AM	4002.58931	RCLFE.ASHRATE_PST.74.MON	X-BAR
							RCL101	2017/02/05 5:01:06 AM	4014.63793	RCLFE.ASHRATE_PST.74.MON	X-BAR
							RCL102	2017/02/03 4:41:11 AM	4001.03793	RCLFE.ASHRATE_PST.74.MON	X-BAR
							RCL102	2017/02/07 5:03:23 AM	3927.14069	RCLFE.ASHRATE_PST.74.MON	X-BAR
							RCL103	2017/02/02 5:45:08 PM	3831.54276	RCLFE.ASHRATE_PST.74.MON	X-BAR
							RCL103	2017/02/02 5:49:14 PM	3827.88931	RCLFE.ASHRATE_PST.74.MON	X-BAR
							RCL103	2017/02/03 3:24:54 AM	3786.87207	RCLFE.ASHRATE_PST.74.MON	X-BAR
							RCL103	2017/02/06 11:49:29 PM	3847.12241	RCLFE.ASHRATE_PST.74.MON	X-BAR
							RCL104	2017/01/20 2:49:09 PM	3960.13897	RCLFE.ASHRATE_PST.74.MON	X-BAR
							RCL104	2017/01/29 1:54:30 AM	3988.62414	RCLFE.ASHRATE_PST.74.MON	X-BAR
							RCL104	2017/01/31 9:58:15 PM	3984.87379	RCLFE.ASHRATE_PST.74.MON	X-BAR
							RCL104	2017/02/07 6:42:46 PM	4064.63414	RCLFE.ASHRATE_PST.74.MON	X-BAR&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2017 20:22:38 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/delete-duplicate/m-p/35470#M20926</guid>
      <dc:creator>RosDima</dc:creator>
      <dc:date>2017-02-07T20:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: delete duplicate</title>
      <link>https://community.jmp.com/t5/Discussions/delete-duplicate/m-p/35472#M20927</link>
      <description>&lt;P&gt;I think the solution is simpler than you think.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Sort the data by ascending Entity, descending date&lt;/LI&gt;
&lt;LI&gt;Create a new column that has the following formula, which is a simple counter within each Entity&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If( Lag( :Entity ) != :Entity,
			num = 1,
			num = num + 1
		);
		num;&lt;/CODE&gt;&lt;/PRE&gt;
Finally, you can Select Where your new column has a value of &amp;lt;= 3&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Tue, 07 Feb 2017 20:50:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/delete-duplicate/m-p/35472#M20927</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-02-07T20:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: delete duplicate</title>
      <link>https://community.jmp.com/t5/Discussions/delete-duplicate/m-p/35624#M21012</link>
      <description>&lt;P&gt;Jim hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tryed your script&lt;/P&gt;&lt;P&gt;Please see:&lt;/P&gt;&lt;P&gt;Table after code run.&lt;/P&gt;&lt;P&gt;Num didnt get proper numbers.&lt;/P&gt;&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Table.PNG" style="width: 999px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/5089i41F6A82ED280F229/image-size/large?v=v2&amp;amp;px=999" role="button" title="Table.PNG" alt="Table.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;MP = AR &amp;lt;&amp;lt; Sort(
by(ENTITY,LOT_DATA_COLLECT_DATE),Order(Ascending,Descending)
);

MP &amp;lt;&amp;lt; New Column("num",
Character,
Formula(
	If( Lag(:ENTITY) != :ENTITY,
			num = 1,
			num = num + 1
		)
	)	
	);&lt;/PRE&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Feb 2017 23:31:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/delete-duplicate/m-p/35624#M21012</guid>
      <dc:creator>RosDima</dc:creator>
      <dc:date>2017-02-09T23:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: delete duplicate</title>
      <link>https://community.jmp.com/t5/Discussions/delete-duplicate/m-p/35633#M21014</link>
      <description>&lt;P&gt;The formula was not copied correctly.&amp;nbsp; You left the trailing "num" off of the formula.&amp;nbsp; The way formulas work, the last value expressed is the value the passed back to jmp.&amp;nbsp; Therefore by specifying "num" as the last item in the formula, it is what gets passed back&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;MP = AR &amp;lt;&amp;lt; Sort(
by(ENTITY,LOT_DATA_COLLECT_DATE),Order(Ascending,Descending)
);

MP &amp;lt;&amp;lt; New Column("num",
Character,
Formula(
	If( Lag(:ENTITY) != :ENTITY,
			num = 1,
			num = num + 1
		)
	)	
	);
	num;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2017 00:25:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/delete-duplicate/m-p/35633#M21014</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-02-10T00:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: delete duplicate</title>
      <link>https://community.jmp.com/t5/Discussions/delete-duplicate/m-p/35681#M21049</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I still have only one value "1" for each ENTITY.&lt;/P&gt;&lt;PRE&gt;MP = AR &amp;lt;&amp;lt; Sort(
by(ENTITY,LOT_DATA_COLLECT_DATE),Order(Ascending,Descending)
);
//MP:LOT_DATA_COLLECT_DATE &amp;lt;&amp;lt; Format("m/d/y")&amp;lt;&amp;lt;Data Type("Character")&amp;lt;&amp;lt;Modeling Type("Nominal") ;

MP &amp;lt;&amp;lt; New Column("num",
Character,
Formula(
	If( Lag(:ENTITY) != :ENTITY,
			num = 1,
			num = num + 1
		)
	)	
	);
	num ;	&lt;/PRE&gt;&lt;P&gt;Can I use any other way? What can I do wrong? Date should be in specific format?&lt;/P&gt;&lt;P&gt;Lag function compare EVENT for EVENT from previous row, how does it now that value to compare is the Date column?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Sat, 11 Feb 2017 13:19:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/delete-duplicate/m-p/35681#M21049</guid>
      <dc:creator>RosDima</dc:creator>
      <dc:date>2017-02-11T13:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: delete duplicate</title>
      <link>https://community.jmp.com/t5/Discussions/delete-duplicate/m-p/35683#M21051</link>
      <description>&lt;P&gt;This is my error.&amp;nbsp; In my rush, I indicated the wrong place for the trailing "num".&amp;nbsp; Here is a little script that creates your Entity column and then add the new column with the counter in it.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = New Table( "count",
	Add Rows( 34 ),
	New Column( "Entity",
		Character,
		"Nominal",
		Set Values(
			{"RLC101", "RLC101", "RLC101", "RLC101", "RLC102", "RLC102", "RLC102", "RLC102", "RLC102",
			"RLC102", "RLC102", "RLC102", "RLC102", "RLC102", "RLC102", "RLC102", "RLC103", "RLC103", "RLC103",
			"RLC103", "RLC103", "RLC103", "RLC103", "RLC103", "RLC103", "RLC103", "RLC103", "RLC103", "RLC104",
			"RLC104", "RLC104", "RLC104", "RLC104", "RLC101"}
		)
	)
);
dt &amp;lt;&amp;lt; New Column( "Number",
	numeric,
	formula( If( Lag( :ENTITY ) != :ENTITY, num = 1, num = num + 1 );	
	num;
));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 11 Feb 2017 14:06:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/delete-duplicate/m-p/35683#M21051</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-02-11T14:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: delete duplicate</title>
      <link>https://community.jmp.com/t5/Discussions/delete-duplicate/m-p/35690#M21055</link>
      <description>Can you please send me information for Lag function if you have? I founded some examples but not in a way you used it.&lt;BR /&gt;Thanks a lot for your help!</description>
      <pubDate>Sun, 12 Feb 2017 19:52:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/delete-duplicate/m-p/35690#M21055</guid>
      <dc:creator>RosDima</dc:creator>
      <dc:date>2017-02-12T19:52:15Z</dc:date>
    </item>
    <item>
      <title>Re: delete duplicate</title>
      <link>https://community.jmp.com/t5/Discussions/delete-duplicate/m-p/35697#M21060</link>
      <description>&lt;P&gt;Look in the Scripting Index&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Help==&amp;gt;Scripting Index==&amp;gt;Functions==&amp;gt;Lag&lt;/P&gt;
&lt;P&gt;Also, look in the book, Using JMP&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Help==&amp;gt;Books==Using JMP&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Lag &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Returns the value of the first argument in the row defined by the current row less the second argument. The default Lag is one, which you can change to any number. The value returned for any lag that identifies a row number less than one is missing. Note that Lag(X, n) gives the same result as the subscripted notation, XRow( )–n.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2017 03:09:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/delete-duplicate/m-p/35697#M21060</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-02-13T03:09:03Z</dc:date>
    </item>
  </channel>
</rss>

