cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
xxvvcczz
Level III

How can I clear the contents of a specific column in a specific data table?

I have an existing data table and I've updated rows in it, but now I want to have a function that just clears all the rows or sets them all to empty(); also would like it to be really fast because it's a very large table. I tried this but it's quite slow.

 

	Column( my_table, "MY_COL" ) << formula (empty());
	Column( my_table, "MY_COL" ) << Delete Formula;
1 ACCEPTED SOLUTION

Accepted Solutions

Re: How can I clear the contents of a specific column in a specific data table?

Hi,

 

This should be faster; is it fast enough for your needs?

 

my_table[0, loc(my_table << get column names(string), "MY_COL")] = .;

For example:

 

Names Default To Here(1);

my_table = astable(J(1e5, 2, Random Uniform()));

my_table[0, loc(my_table << get column names(string), "Col1")] = .; 

View solution in original post

2 REPLIES 2

Re: How can I clear the contents of a specific column in a specific data table?

Hi,

 

This should be faster; is it fast enough for your needs?

 

my_table[0, loc(my_table << get column names(string), "MY_COL")] = .;

For example:

 

Names Default To Here(1);

my_table = astable(J(1e5, 2, Random Uniform()));

my_table[0, loc(my_table << get column names(string), "Col1")] = .; 
xxvvcczz
Level III

Re: How can I clear the contents of a specific column in a specific data table?

Thanks! This is much faster.

Recommended Articles