cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Image to Table JMP extension imports single or batch images as data tables. Useful to extract curves from pictures or convert image data to curve data to use in analyses like Functional Data Explorer. Download and install the extension.

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