Subscribe Bookmark RSS Feed

Data Table Visibility

vkessler

Community Trekker

Joined:

Dec 23, 2015

Hi everyone,

i want to set the visibility ("private" or "invisible") of a data table with a variable. Unfortunately this doesn´t work for me. Here is a short example:

Names Default To Here (1);

name ="foo";

visibility = "private";

dt = New Table (name, visibility , New Column("bar", Character, "Nominal") );

Although the variable "visibility" is set to "private", JMP still shows me a data table with the name "foo". Using "Eval Insert" also didn´t work for me.

Is there a way to set the visibility of a data table with a variable?

Thank you!

Victor

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

Victor,

I was able to solve the problem by placing the whole new table function into a literal string and then evaluating the created string:

eval(parse("dt = New Table (name,"||visibility||", New Column(\!"bar\!", Character, Nominal) )"));

It isn't pretty, but it works.

Jim
4 REPLIES
Solution

Victor,

I was able to solve the problem by placing the whole new table function into a literal string and then evaluating the created string:

eval(parse("dt = New Table (name,"||visibility||", New Column(\!"bar\!", Character, Nominal) )"));

It isn't pretty, but it works.

Jim
vkessler

Community Trekker

Joined:

Dec 23, 2015

Thanks for the fast reply! As you said, it´s a bit bulky, but it works

Craige_Hales

Staff

Joined:

Mar 21, 2013

You can also manipulate the expression:

name = "foo";

visibility = "private"; // "private" or "invisible"

dt = Eval( Eval Expr( New Table( name, Expr( visibility ), New Column( "bar", Character, "Nominal" ) ) ) );

Show( dt );

Close( dt, nosave );

Craige
vkessler

Community Trekker

Joined:

Dec 23, 2015

Thank you. This solution looks even cleaner. But both are working fine.