取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Discussions

Solve problems, and share tips and tricks with other JMP users.
选择语言 隐藏翻译栏
Arocha1
Level II

Deleting Multiple Replicate Rows (n=5 or more)

I have a table where column 1 has titles, and column 2 has values. I need a script that can find any title in column 1 that appears more that 5 times and deletes the entire row. If it it equal to or less than 5, it can stay. The closest thing I could come to was deleting duplicates, but I want to keep duplicates and delete only anything over a "quintuplet".

 

JMP 16

1 个已接受解答

已接受的解答
jthi
Super User

Re: Deleting Multiple Replicate Rows (n=5 or more)

You could create summary table and then check from the if N Rows >= 5 and using summary table to select correct rows from main table and then delete those rows from main table. Same could also be done by using Summarize, Tabulate, Col formula column and many other methods.

Here is example using calculation column

Names Default To Here(1);

dt = New Table("Untitled",
	Add Rows(6),
	New Column("Column 1", Character, "Nominal", Set Values({"a", "a", "a", "b", "b", "c"}))
);

wait(1);
dt << New Column("Count", Numeric, Continuous, << Set Each Value(
	Col Number(1, :Column 1)
));

wait(1);
dt << Select Where(:Count >= 3) << Delete Rows;
-Jarmo

在原帖中查看解决方案

1 条回复1
jthi
Super User

Re: Deleting Multiple Replicate Rows (n=5 or more)

You could create summary table and then check from the if N Rows >= 5 and using summary table to select correct rows from main table and then delete those rows from main table. Same could also be done by using Summarize, Tabulate, Col formula column and many other methods.

Here is example using calculation column

Names Default To Here(1);

dt = New Table("Untitled",
	Add Rows(6),
	New Column("Column 1", Character, "Nominal", Set Values({"a", "a", "a", "b", "b", "c"}))
);

wait(1);
dt << New Column("Count", Numeric, Continuous, << Set Each Value(
	Col Number(1, :Column 1)
));

wait(1);
dt << Select Where(:Count >= 3) << Delete Rows;
-Jarmo

推荐文章