cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
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.
Discovery is online this week, April 16 and 18. Join us for these exciting interactive sessions.
Choose Language Hide Translation Bar
abdul_saqib
Level III

Is there a refresh option to update data table in JMP 13.2.1

Hi,

 

I imported some data from Excel into a data table in JMP 13.2.1. Now, some of the cells have been updated in the Excel file and I wonder if it is possible to import the data from the Excel file which now contains updated cells (something like refereshing the data in the JMP data table). Note that the number of rows or columns nor the column headings have been changed; just the numbers are different.

 

Thanks

10 REPLIES 10

Re: Is there a refresh option to update data table in JMP 13.2.1

This script will help in a slightly different scenario (need to change "Wetterdaten.jmp" with the appropriate one as well the settings, best use the source script for the initial report):

If you update your table like Byron suggested you will keep the table properties but you will overwrite any data cleaning steps, like recoded (overwritten) columns, or filled missing values, .... They will be overwritten by the Update table. 

Getting first the number of rows of the current table, and delete them from the imported one, then concatenate the final new table will avoid that painful awakening "all your work has been destroyed through the update. 

 

// Define current data table (current data)
dt1 = Current Data Table();

// Check number of rows in actual data table (current recorded and cleaned data)
n_rows = NRows();

// Open Excel file to read new data -> will open a new data table with the same name and all the previous and new data
dt2 = Open("Wetterdaten.xlsx",
	Worksheets( {"Import Data"} ),
	Use for all sheets( 1 ),
	Concatenate Worksheets( 1 ),
	Create Concatenation Column( 0 ),
	Worksheet Settings(
		1,
		Has Column Headers( 1 ),
		Number of Rows in Headers( 1 ),
		Headers Start on Row( 1 ),
		Data Starts on Row( 2 ),
		Data Starts on Column( 1 ),
		Data Ends on Row( 0 ),
		Data Ends on Column( 0 ),
		Replicated Spanned Rows( 1 ),
		Suppress Hidden Rows( 1 ),
		Suppress Hidden Columns( 1 ),
		Suppress Empty Columns( 1 ),
		Treat as Hierarchy( 0 )
	)
);

// Delete in dt2 all previous worked on data using the n_rows information
dt2 << DeleteRows(1::n_rows);

// Concatenate tables: dt2 appended to dt1, so you avoid creating a new table
dt1 << Concatenate  (dt2, Append to first table);

// Close support table dt2
Close(dt2);

Of course you can feel free to further customize this script. E.g. I would go for a general import routine, where I chenge the setting for the Excel Import to the original number + the current number of rows already beeing imported. With this you can directly go to concatenate without the need for deleting rows. And I do not like hardcoded tablenames, so I would first check the table name and use this as table name in the Excel Import. 

Just few thoughts ... :)

excelFile = "Wetterdaten.xlsx";

cdt = Current Data Table();
cdtName = cdt << get name();
n_Rows = NRows();

dtHelp = Open(
	excelFile,
	Worksheets( {eval(cdtName)} ),
	Use for all sheets( 1 ),
	Concatenate Worksheets( 1 ),
	Create Concatenation Column( 0 ),
	Worksheet Settings(
		1,
		Has Column Headers( 1 ),
		Number of Rows in Headers( 1 ),
		Headers Start on Row( 1 ),
		Data Starts on Row( 2+ n_Rows ),
		Data Starts on Column( 1 ),
		Data Ends on Row( 0 ),
		Data Ends on Column( 0 ),
		Replicated Spanned Rows( 1 ),
		Suppress Hidden Rows( 1 ),
		Suppress Hidden Columns( 1 ),
		Suppress Empty Columns( 1 ),
		Treat as Hierarchy( 0 )
	), Invisible
);

cdt << Concatenate  (dtHelp, Append to first table);

Close(dtHelp);

 

/****NeverStopLearning****/