cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Instantly extract effect sizes, F-ratios, and FDR-adjusted p-values from your models with the Calculate Effects Sizes extension, available now in the JMP Marketplace!
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • See how to use the JMP Marketplace – Free tools to expand JMP capabilities. Register. July 10, 2 pm US Eastern Time.

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