ODBC icon

I am in the process of learning about QlikView, an awesome data visualisation application. It has the ability to connect to diverse data sources: anything from a CSV file to a database table. This is how to connect QlikView to a MySQL database using a ODBC on a local dev machine.

An ODBC connector works as a standard gateway for programming languages, applications (such as Excel, Access, or OpenOffice) to communicate with database server with ease.

To dynamically connect to and query a MySQL database table directly from QlikView Personal Edition:

  1. Download and install the MySQL ODBC connector: mysql-connector-odbc-5.3.4-winx64.msi [https://dev.mysql.com/downloads/connector/odbc/]
  2. Create a DSN — I used this excellent tutorial: http://www.plaintutorials.com/install-and-create-mysql-odbc-connector-on-windows-7/
  3. Open QlikView, and open the Edit Script window: File >> Edit Script
  4. Place cursor end of file (there will be some default config info)
  5. At the bottom of the window, on the Data tab, select ODBC from the Database select option, and click the Select… button and select the DSN you created from above from the Data Sources select — you can click Test Connection to check that you have entered the correct details
  6. Click OK
  7. This will open the Create Select Statement window:
    1. the Data source should be set to your DSN, and the Database select should be populated with your the databases
    2. Select the relevant database; the Database Tables and Fields boxes will be populated, and a SQL SELECT statement will be visible at the bottom in the Script tab
    3. Click OK, and new lines will be added to the script window which define a connection string and a SQL statement
    4. Click Save and OK
    5. Select File >> Reload, and a Script Execution Progress window will pop-up and you will see the script connect to and query the database using your DSN connection
    6. You are now ready to add data to your project!


By foxbeefly

PHP / MySQL Developer. HTML, CSS and some JavaScript.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.