Importing Data with Custom Queries
Sisense allows you to import data from a variety of data sources and manipulate the data that is imported by running custom SQL queries against the database, for example:
- Import selected data only to reduce import and build times when you do not require all the data.
- Perform various procedures in the database such as table joins.
After running your custom query, you can preview the updated tables before importing the data into the ElastiCube.
- This feature is available for the following relational databases: AWS Athena, Databricks, Microsoft SQL Server, MySQL, PostgreSQL, Oracle, AWS Redshift, Salesforce, Snowflake, BigQuery and Generic JDBC.
- This feature runs a query in the source database, which may require a lot of processing power from your database, especially for complex queries.
To add tables with custom queries:
After selecting your database, click + at the bottom of the list of tables and views in the database. An empty custom table is added and the Settings area is displayed.
When previewing an existing table, click Edit Query to modify the custom query.
In the Settings area, enter your custom SQL query.
Click + to add additional custom tables. You can delete any of the tables by selecting the import query's menu and clicking Delete.
Click Done to import your custom data into Sisense.
Using the Advanced Limit Query Editor
If your SQL query parses successfully but the preview pane shows "Query Error", use the Advanced Limit Query Editor to resolve the problem.
By default, the Advanced Limit Query Editor is activated and available. It can be activated or deactivated as follows:
Navigate to Admin > Server & Hardware > System Management > Configuration > 5 clicks on the Sisense logo > Base Configuration > Ecm.
Activate or deactivate the Advanced Limit Query Editor.
Click Save Base. A notice is displayed asking you to confirm the change.
To resolve the preview pane query error and have the Preview Data pane display the preview correctly:
When viewing your SQL query, click Advanced Query Editor to open it.
Add the following to the end of your query: AND ROWNUM <= @numberofrecords.
Click Done. You are returned to the basic editor where your original SQL query appears as before, but now the Preview Data pane displays the preview correctly.