发布日期: 09/18/2023

Update Data in JMP Live

If the data behind a JMP Live report changes, you can update only the data. Any reports that use the data are updated and automatically regenerate in JMP Live.

The following example creates a Distribution report, publishes the report and the associated data to a folder in your personal space, and updates the data.

Example of Updating Data

This example publishes a Distribution report to a folder in your personal space, updating the existing data in JMP Live.

Names Default To Here( 1 );

// Open the Big Class sample data table.

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
// Run the Distribution table script and call the report dist.
dist = dt << Run Script( "Distribution" );
// Set up the connection to the JMP Live server.
liveconnection = New JMP Live();

/* Create a folder in your personal space with a title. Use the JMP Live Connection that you established and return a JMP Live object called jmpliveresult. */

jmpliveresult = liveconnection << Create Folder( Space( "~" ), Title( "Update Data Example" ) );
// Make the result scriptable.
folder = jmpliveresult << As Scriptable;
// Add the dist report to content.
content = New JMP Live Content( dist );
// Publish the content to the newly created folder and get the folder ID.
jmpliveresult = liveconnection << Publish( content, Folder( ID( folder << Get ID ) ) );
// Make the list of created posts scriptable.
postlist = jmpliveresult << As Scriptable;
// Get the details for the post.
dataId = "";
For( i = 1, i <= postlist << Get Number Of Items, i += 1,
	type = postlist[i] << Get Type();
	If( type == "Data",
		dataId = postlist[i] << Get ID
	);
);
// Use the Update Data command and the dataId to update the data table in JMP Live.
liveresult = liveconnection << Update Data( dataId, dt );
需要更多信息?有问题?从 JMP 用户社区得到解答 (community.jmp.com).