- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
How do I script Tabulating a document and then saving that Tabulated data into a Data table on my hard drive?
I would like to tabulate some data from document 'Data1', make this tabulated data into a new data table, and then save the new data as document 'Data2', here is my first high level stab at this and doesn't seem to work, any quick guidance?
dt = Open( "Data1.jmp", invisible );
(Data Table( "Data1" ) << tab = dt << Tabulate(
Add Table(
Column Table( Grouping Columns( :Code LLT ) ),
Row Table( Grouping Columns( :CodeTypePrmaryAndDesc 3, :CodeTypePrmaryAndDesc 4 ) )
)
));
dt_tab << Make Into Data Table
dt_tab << set name( "Tabulate" );
dt_tab << Save( "Data2.jmp" );
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How do I script Tabulating a document and then saving that Tabulated data into a Data table on my hard drive?
Below is a working version modification of your code. Given the issues in your original code, I suggest that you spend some time reading the JSL documentation:
Help==>Books==>Scripting Guide
Also, in the code below, in your Save() function, you do not specify a path to where you want to save the data. You may need to specify a fully qualified path, in order to be able to save the table
dt = Open( "Data1.jmp", invisible );
tab = dt << Tabulate(
Add Table(
Column Table( Grouping Columns( :Code LLT ) ),
Row Table( Grouping Columns( :CodeTypePrmaryAndDesc 3, :CodeTypePrmaryAndDesc 4 ) )
)
);
dt_tab = tab << Make Into Data Table;
dt_tab << set name( "Tabulate" );
dt_tab << Save( "Data2.jmp" );
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How do I script Tabulating a document and then saving that Tabulated data into a Data table on my hard drive?
@txnelson I am still not seeing a data2.jmp created with the script below:
dt = Open( "C:\Users\juvelj1\Desktop\Data 2014-2019\Products_2014.jmp", invisible );
tab = dt << Tabulate(
Add Table(
Column Table( Grouping Columns( :Code LLT ) ),
Row Table( Grouping Columns( :CodeTypePrmaryAndDesc 3, :CodeTypePrmaryAndDesc 4 ) )
)
);
dt_tab = tab << Make Into Data Table;
dt_tab << set name( "Tabulate" );
dt_tab << Save( "C:\Users\juvelj1\Desktop\Data 2014-2019\Data2.jmp" );
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How do I script Tabulating a document and then saving that Tabulated data into a Data table on my hard drive?
Below is a working version modification of your code. Given the issues in your original code, I suggest that you spend some time reading the JSL documentation:
Help==>Books==>Scripting Guide
Also, in the code below, in your Save() function, you do not specify a path to where you want to save the data. You may need to specify a fully qualified path, in order to be able to save the table
dt = Open( "Data1.jmp", invisible );
tab = dt << Tabulate(
Add Table(
Column Table( Grouping Columns( :Code LLT ) ),
Row Table( Grouping Columns( :CodeTypePrmaryAndDesc 3, :CodeTypePrmaryAndDesc 4 ) )
)
);
dt_tab = tab << Make Into Data Table;
dt_tab << set name( "Tabulate" );
dt_tab << Save( "Data2.jmp" );
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How do I script Tabulating a document and then saving that Tabulated data into a Data table on my hard drive?
@txnelson I am still not seeing a data2.jmp created with the script below:
dt = Open( "C:\Users\juvelj1\Desktop\Data 2014-2019\Products_2014.jmp", invisible );
tab = dt << Tabulate(
Add Table(
Column Table( Grouping Columns( :Code LLT ) ),
Row Table( Grouping Columns( :CodeTypePrmaryAndDesc 3, :CodeTypePrmaryAndDesc 4 ) )
)
);
dt_tab = tab << Make Into Data Table;
dt_tab << set name( "Tabulate" );
dt_tab << Save( "C:\Users\juvelj1\Desktop\Data 2014-2019\Data2.jmp" );
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How do I script Tabulating a document and then saving that Tabulated data into a Data table on my hard drive?
What messages are in your JMP Log?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How do I script Tabulating a document and then saving that Tabulated data into a Data table on my hard drive?
Thanks Jim!