This website uses Cookies. Click Accept to agree to our website's cookie use as described in our Privacy Policy. Click Preferences to customize your cookie settings.

- JMP User Community
- :
- Discussions
- :
- Re: How to seperate columns into different tables.

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

JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.

Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.

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
- Report Inappropriate Content

Created:
Jul 3, 2021 10:51 PM
| Last Modified: Jun 9, 2023 03:51 PM
(789 views)

I have a datatable with 5 columns. Field names are from from A to Z. Now i want to seperate this table into 5 si gnetables. Every table just contain one column. The table A has one column A. Until the table E ha e one column Z. Can you give me suggestion on JSL?

8 REPLIES 8

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

Here is a script that illustrates how to do this. I strongly suggest that you take the time to read the Scripting Guide from the JMP Documentation Library, available under the Help pull down menu.

```
Names Default To Here( 1 );
// Open Data Table: big class.jmp
// → Data Table( "big class" )
dt = Open( "$SAMPLE_DATA/big class.jmp" );
// Loop across each column, selecting it and then subsetting
// the data table with all rows and just the selected column
For( i = 1, i <= N Cols( dt ), i++,
dt << select columns( Column( dt, i ) );
dt << subset( selected rows( 0 ), selected columns( 1 ) );
wait(0);
);
```

Jim

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

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

I assume the issue is that you are running version 13 or older. The Select Columns() function did not exist prior to JMP 14. Here is a different approach that does work.

```
Names Default To Here( 1 );
// Open Data Table: big class.jmp
// → Data Table( "big class" )
dt = Open( "$SAMPLE_DATA/big class.jmp" );
// Loop across each column, specifying a single column on
// each iteration
For( i = 1, i <= N Cols( dt ), i++,
dt << subset( selected rows(0), columns(column(dt,i)));
);
```

Jim

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

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

What version of JMP are you using?

I would examine the entry in the Scripting Index. Look for the Subset

I would examine the entry in the Scripting Index. Look for the Subset

Jim

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

Thank you. I am using 13.

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

The documentation in the JMP 13 Scripting Guide is not very helpful, but it does point to the Scripting Index

**Subset a Data Table**

Subset() creates a new data table from rows that you specify. If you specify no rows, Subset

uses the selected rows. If no rows are selected or specified, it uses all rows. If no columns are

selected or specified, it uses all columns. And if Subset has no arguments, the Subset window

appears.

```
dt << Subset(
Columns( columns ),
Rows( row matrix ),
Linked,
Output Table Name( "name" ),
Copy Formula( 1 or 0 ),
Sampling rate( n ),
Suppress Formula Evaluation( 1 or 0 ) );
```

Note: For more arguments, see the Scripting Index in the Help menu.

Jim

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

Thank you. I will do some study on your notes.

- © 2024 JMP Statistical Discovery LLC. All Rights Reserved.
- Terms of Use
- Privacy Statement
- About JMP
- JMP Software
- JMP User Community
- Contact