Ever wondered how you can vary the data source for a Turbo Integrator process inside the actual process so it becomes dynamic? Well here is a method.
Firstly, define a bunch of variables:
sCurrentMonth = CellGetS ( 'System Assumptions', 'No Year', 'No Month', 'Current Month', 'String' );
sFileDir = '\\servername\folder\';
sFileName = sCurrentMonth | ' ' | SUBST(sCurrentYear,3,2) | ' Employees.csv';
sFilePath = sFileDir | sFileName;
Then use DatasourceNameForServer and DatasourceNameForClient to force the TI to use specific files for both the Datasource Name for the server and for the client.
DatasourceNameForServer = sFilePath;
DatasourceNameForClient = sFilePath;
Why is this useful? Well there are a couple of reasons:
- Where you have a file that is being automatically created and includes (in our case) the month and year in the filename, this is very useful. It then allows us to keep historic versions of the source files in case we need to reload them.
- If you have a Dev and Prod environment, for example, you could have the server name as an entry in a System Assumptions cube and then retrieve it from System Assumptions and use it dynamically in a TI.