Export tables to CSV post plugin [Windows]
This post explains how to install and configure the post plugin for exporting tables into CSVs . This plugin enables the user to define which tables will be exported into CSVs during the build finalization process.
With this plugin, you will be able to:
- Reduce build time. For example, a user can store historical data in a CSV file and just union it with the new data on every new build (handy when pulling data from web services).
- Define and maintain a unified repository cube. In cases when several cubes need to use the same data table, the user can define one cube that creates the data table, and all other cubes will use the CSV extracted from it.
- Push the data into other reporting systems. Some customers also use the Elasticube manager as an ETL tool and transfer the data forward.
Important! The Build process will not end until the post plugin has finished. Exporting millions of rows to CSV files may take a considerable amount of time and thus will result in a longer ElastiCube build process.
Steps
Step 1: Download And Install Python X64 On Your Machine.
Download Zip: ExportTablesToCSVPostPlugin
Files included:
- ectools.zip
- ectools_sisense_ver<6.4.zip - (only for versions 6.4 and below)
- python-2.7.11.amd64.msi
- config_example.txt
- EC_export.dll
Note! In order to run the plugin, an installation of Python x64 is required.
- Install the attached Python version.
- In the Windows Search Box, located next to the Start button, type in Edit the system environment variable and click on it.
- Under Advanced, click on the Environment Variables button.
- Under the System Variables pane, click on the Path variable and then click Edit.
- In the Edit environment variable window, click on New and add C:\Python27 at the bottom of the list.
STEP 2: INSTALL THE EXPORT TO CSV POST PLUGIN
- Create a new directory in C:\Program Files\Sisense\Prism\Server and name it Plugins.
- Download the EC_export_dll dll file and place it in C:\Program Files\Sisense\Prism\Server\Plugins and C:\Program Files\Sisense\Prism\Plugins
- Right-click the DLL file, and choose Properties.
- In the General pane, if a button with an Unblock caption exists, click on it (now Windows allows executing the DLL)
- Extract the contents of the ectools.zip into C:\Program Files\Sisense\Prism
- Open Services and restart the ElastiCubeService Service (Sisense.ECMS).
STEP 3: EXECUTING THE PLUGIN IN THE ELASTICUBE MANAGER
- Once in ElastiCube Manager, open ElastiCube ==> Pre & Post Execution Plugins.
- Add to the post plugin section a new plugin called EC_export.
- Click on Add to configure how the plugin should behave (HTML):
<Attributes path="c:\data" csv="true" tables="brand,categorypath" pythonPath="C:\Python27\python.exe" timestamp="true"> </Attributes>
These are the attributes we can add:
- path - the directory where the TDE/CSV files will be created. (e.g - path="C:\TDE")
- row_limit (optional) - limit the number of rows imported from each table in the Elasticube. (e.g, row_limit="1000", only 1000 rows will be imported from each table).
- csv (optional) - determines if TDE files will be created, or CSV files instead. TDE files are automatically created if this attribute is not found. (e.g, csv="true", CSV files will be created).
- tables (optional) - determines which tables will be imported from the ElastiCube. Tables are separated by a comma. If this attribute isn't found, all the tables will be imported. (e.g, tables="brand,categorypath", "brand" and "categorypath" tables will be the only ones imported.)
- pythonPath (optional) - direct path to Python.exe (if the PATH variable is not working in your environment)
- timestamp (optional) - adds timestamp to CSV filename
STEP 4: RUN BUILD.
In the build's finalizing step, the plugin execution will appear in the ElastiCube manager log window. In the ElastiCube Manager console:
Disclaimer: This post outlines a potential custom workaround for a specific use case or provides instructions regarding a specific task. The solution may not work in all scenarios or Sisense versions, so we strongly recommend testing it in your environment before deployment. If you need further assistance with this, please let us know.