Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- Re: Any way to close all tables EXCEPT the table of interest?

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Apr 9, 2010 8:50 AM
(7426 views)

Hi Guys,

Is there any way to close all the tables open in the JMP except the table of interest?

I tried using the close all(Data tables) command and it closes all of them. Also I don't want to individually close every table because I have several tables open.

Thanks.

Is there any way to close all the tables open in the JMP except the table of interest?

I tried using the close all(Data tables) command and it closes all of them. Also I don't want to individually close every table because I have several tables open.

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Here's a function that will do exactly what mpb says (and it works):

```
CloseAllDataTablesExcept = Function({FunctionDataTable},
FunctionName = FunctionDataTable << Get Name;
For(i=NTable(), i>0, i--,
If(DataTable(i)<<GetName != FunctionName,
Close(DataTable(i), nosave)
)
);
);
```

3 REPLIES 3

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Any way to close all tables EXCEPT the table of interest?

You can go through each open table using a For loop from N Table()to 1, looking at Data Table(i) << Get Name, to compare each name to the one you want to keep open. Either leave it open if it's the keeper, or close it without saving if it's not. You need to go backwards in the loop because of the way JMP numbers the tables. Let me know if I've got that mixed up ... the idea is sound though.

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Here's a function that will do exactly what mpb says (and it works):

```
CloseAllDataTablesExcept = Function({FunctionDataTable},
FunctionName = FunctionDataTable << Get Name;
For(i=NTable(), i>0, i--,
If(DataTable(i)<<GetName != FunctionName,
Close(DataTable(i), nosave)
)
);
);
```

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Any way to close all tables EXCEPT the table of interest?

```
DontClose = {"Test1", "Result"}; // Example names of tables you want to leave
// Loop backwards through the list, so the table numbers do not change
For( i = N Table(), i >= 0, i--,
If( Contains( DontClose, Data Table( i ) << get name ),
Continue(),
Close( Data Table( i ), "No Save" )
)
);
```

https://community.jmp.com/t5/Discussions/JSL-How-to-close-data-tables-after-analysis/m-p/36739#M2164...

Exact same question . Another way to script it . The post above also addresses this question

Best

Uday

Uday