Auto-Updating (Running) Workspace Projects (example, When the Data Change)

Statistica Data Miner projects are themselves programmable objects, that can be called from within Statistica Visual Basic or other applications, that support the COM-Object architecture. This feature is particularly useful for connecting workspaces to application or spreadsheet events, so that the project automatically updates or runs whenever the particular event occurs.

For example, suppose you wanted to connect a Statistica workspace project to a data file so that the project automatically updates every time the data in the data file change, follow these basic steps:

Procedure

  1. Create and program the appropriate application or spreadsheet document event.
  2. Inside the event handler (Statistica Visual Basic program), update the desired Statistica workspace project.

Result

Here is a simple example of a  spreadsheet event handler, for the spreadsheet DataChanged event:

Private Sub Document_DataChanged(ByVal Flags As Long, _
 ByVal FirstCase As Long, ByVal FirstVar As Long, _
 ByVal LastCase As Long, ByVal LastVar As Long, _
 ByVal bLast As Boolean)
' Dimension DMProject as an object of type DataMiner
 Dim DMProject As DataMiner
'  Assign the currently ActiveDataMiner project to the DataMiner
 '  object; here you could insert additional code (logic) for
'  "finding" the right DataMiner project.
 Set DMProject = ActiveDataMiner
'  Execute (Run) the DataMiner project; you could insert here
 '  additional code (logic) so that the project only updates when
 '  certain cases or variables change. Many additional properties
 '  and methods are available for the DataMiner object to fully
 '  customize the auto-update "behavior".
DMProject.Execute
End Sub

By connecting any of the Statistica application or document events to data miner projects, very complex and highly customized auto-updating schemes can be achieved.