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
- :
- File Exchange
- :
- JMP Scripts
- :
- Column Formulas to CSV

Jan 9, 2015 11:22 AM
(2035 views)

JSL to find the formulas in a JMP data table and write a CSV (comma separated value) file. There is an open issue for exporting formulas to Excel; maybe this script can serve as a starting point to determine what is really needed.

The code also demonstrates a simple use of Regex, user functions, and saving a file to the $TEMP directory.

This code has ** only** been tested on the included data table.

which opens this table

which the attached JSL exports to this CSV text

If the .CSV file is opened in Excel, the formulas are character fields.

Comments

01-14-2015
04:05 PM

- Mark as Read
- Mark as New
- Bookmark
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

01-14-2015
04:05 PM

Another option is to add a row to the table where any column formulas could be appended.

The following example loops through each column to check for a formula. If a formula is found, the formula is added to the last row. Finally, the table is stored as CSV or Excel.

```
dt = Open( "$SAMPLE_DATA\Tiretread.jmp" );
dt << Run Formulas;
dt << Add Rows( 1 );
r = N Rows( dt );
For( i = 1, i <= N Cols( dt ), i++,
f = Column( i ) << Get formula;
If( !Is Empty( f ),
Column( i ) << Delete Formula;
Column( i ) << Data Type( "Character" );
Column( i )[r] = Char( Name Expr( f ) );
);
);
dt << Save( "$TEMP\Tiretread_Formulas.xlsx" );
dt << Save( "$TEMP\Tiretread_Formulas.csv" );
Close( dt, "No Save" );
```

Is this helpful for exporting JMP column formulas to Excel?

01-15-2015
10:00 AM

- Mark as Read
- Mark as New
- Bookmark
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

01-15-2015
10:00 AM

- Article History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Email to a Friend
- Printer Friendly Page
- Report Inappropriate Content