Creating an In-Memory Copy of a Data Source
The SnapshotDataSource function enables you to create a new in-memory data source by copying the contents of an existing data source. The new copy will contain all columns and rows from the original, and you can use it just like any other in-memory data source.
Implementation:
- Open the Expression Editor where you want to add the expression.
- Enter the following:
SnapshotDataSource( OriginalDataSourceName, SnapshotDataSourceName, ModelReference, FilterName, Refresh );
- Replace OriginalDataSourceName with the keyword for the data source to copy.
- Replace SnapshotDataSourceName with the name to give the new data source.
- (Optional) Replace ModelReference with the reference for the model associated with the data source. This is only required if this function is called outside the context of a model, such as in a web page expression.
- (Optional) Replace FilterName with a name of a filter associated with the original data source. If used, only data rows matching this filter will be included in the copy.
- (Optional) Replace Refresh with 1 if the expression should refresh the data source before creating the copy.
- Save the expression.