- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Data Table Visibility
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
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Data Table Visibility
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Data Table Visibility
This thread is rather old, but i found where it was specifically addressed in JMP 13. The values of the visibility() option will properly evaluate now, if you're using a variable to control it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Data Table Visibility
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Data Table Visibility
Thanks for the fast reply! As you said, it´s a bit bulky, but it works
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Data Table Visibility
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 );
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Data Table Visibility
Thank you. This solution looks even cleaner. But both are working fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Data Table Visibility
This thread is rather old, but i found where it was specifically addressed in JMP 13. The values of the visibility() option will properly evaluate now, if you're using a variable to control it.