cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • 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!
  • Use World Cup data to build models, explore spatial relationships, and create informative visualizations in JMP. Register. July 17, 2 pm US Eastern Time.
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.

Discussions

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

How to determine a column has formula?

I would like to remove all formulas from all columns with script. I wrote a forloop but whether a column has formula needs to be determined. How to do that with scripts?

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: How to determine a column has formula?

One option is to use <<Get Formula with Is Empty()

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
col1 = dt << New Column("Ratio", Numeric, Continuous);
col1 << Formula(:height / :weight);
wait(1);

For Each({col_name}, dt << Get Column Names("String"),
	col = Column(dt, col_name);
	If(!Is Empty(col << get formula),
		Column(dt, col_name) << Delete Formula
	);
);

Scripting Index has a lot of information and you can find it directly from JMP's menu Help / Scripting Index

jthi_0-1670526823473.png

If you add those formulas yourself and don't really need them for formula usage, you can avoid adding them all together by using << Set Each Value()

-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User

Re: How to determine a column has formula?

One option is to use <<Get Formula with Is Empty()

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
col1 = dt << New Column("Ratio", Numeric, Continuous);
col1 << Formula(:height / :weight);
wait(1);

For Each({col_name}, dt << Get Column Names("String"),
	col = Column(dt, col_name);
	If(!Is Empty(col << get formula),
		Column(dt, col_name) << Delete Formula
	);
);

Scripting Index has a lot of information and you can find it directly from JMP's menu Help / Scripting Index

jthi_0-1670526823473.png

If you add those formulas yourself and don't really need them for formula usage, you can avoid adding them all together by using << Set Each Value()

-Jarmo

Re: How to determine a column has formula?

It worked!

Thank you so much!

Recommended Articles