cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

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