cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
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!