Connecting MySQL to Excel using ODBC Connector

We use vTiger CRM for capturing leads and general workflow management at Pristine. vTiger is by far one of the most feature rich and economical CRM solutions that are available in the market today. It lacks one thing though, a strong Reporting backbone, especially for the marketing department. So if you are running multiple campaigns across different mediums and capturing all these leads in vTiger using Webforms, then there are very few useful reports to find things such as Return on Investment (ROI) of all my marketing campaigns, or to find which campaign is working out on a day to day basis.

This is where we generally use Excel! I had written about one such report that we use to evaluate our daily and weekly campaign performance using Subtotals in Excel. You can of course pull data from vTiger in the form of a .CSV file and then run reports on it. However, if you have a local replica of the MySQL database of your CRM, then you can easily connect MySQL to Excel using Data Connections and MySQL ODBC Connector. Here are the steps on how you go about it –

  1. Obtain the MySQL ODBC Connector setup, select the appropriate version for you and install it
  2. Add an ODBC Driver – You can find this in Control Panel > Administrative Tools > Data Sources (ODBC). Here you will find all the existing ODBC Drivers listed, if you do not see any MySQL drivers listed, click on the Add button on the right hand side. In this list you will find the MySQL ODBC Driver that you had installed from Step 1

    Add ODBC Driver
    Add ODBC Driver
  3. On selecting the MySQL driver, you will be prompted to enter the database details that you wish to connect to. These are your MySQL Database details that you are maintaining on your local network (Pro Tip: Check for connectivity from your machine to the MySQL Server first! I have seen many a programmer waste endless hours trying to connect in vain.)

    Fill MySQL Details
    Fill MySQL Details
  4. Now you can import one single table from your target DB or you can choose to execute a query and fetch its results. I always prefer the later since then I can retrieve all the data I require in one Data Connection.

    Connecting to a table
    Connecting to a table
  5. Click on Save and Finish. Your ODBC Connection is ready to be used in Excel!

    Finish Connection
    Finish Connection
  6. Now open Microsoft Excel and switch to the Data Tab  and click on Connections to see all the data connections already present in the workbook. If it’s an empty workbook, then there will not be any data connections. Click on Add.

    Connection files on this Computer
    Connection files on this Computer
  7. Now your Connections are available in ODBC, so you need to click on Browse and click on the New Source to go to the ODBC Prompt.

    Connect to a new datasource
    Connect to a new datasource
  8. Choose your ODBC Connection and you are done!
  9. Now when you save the connection, Excel will pull the data and display it in your current worksheet! The only thing you need is mad ninja dashboarding skills to make your Excel look awesome!

Typically you would use this system if your dashboard or excel report is pretty much set and the data comes from a database which changes frequently (transaction based database). The only pitfall that I see of this method is that the size of the excel file can really shoot up if you are pulling in a lot of data. Stuff such as pivot tables also work a lot in increasing the excel file size. So try to be frugal in their use when you create a dashboard! The screenshots that I am including are from me connecting our Excel report to our CRM database.

 

PS – A word of advice, do not directly connect your live database to the Excel file. ALWAYS use a mirror!

SUBTOTAL in Excel

I generally do not write about Microsoft Excel, for the daily inspiration dose of dashboard heroics I look at Chandoo’s site. However, today I stumbled upon SUBTOTAL and was amazed at what it can do! At work, in Pristine, we run daily numbers of all our online marketing campaigns. Reporting numbers in a template is one thing, and to analyze them is something totally different. As I was sifting through the daily numbers, I realised that for each Excel filter I am running, if there were a summary dashboard, then it will be easier to analyze.

A quick look at the excel that we prepared told me that we had an overall daily summary prepared for Adwords (Clicks, Impressions, CTR, Leads, Landing Page Conversion, Cost, CPC, etc.). Why not have a summary which changes with respect to the filter I chose?

Fortunately we have our own set of Excel heroes within the organization who guided me to the SUBTOTAL formula. And you know what? It’s wowsome!!

SUBTOTAL in Excel

As you can see from the animated GIF that I quickly made, that the bottom summary changes depending on the filter conditions that I change. This dashboard is also a good tool to track the campaigns you are running (and if you are properly measuring your data).

The world without Microsoft Office

In a discussion with a friend (and an ex-colleague), we were joking about work life in general (euphemism for mutual bitching). It seems that a lot of us are destined to work on Microsoft Office Powerpoint and Microsoft Office Excel almost all the time; be it a job in the sales team, the financial analyst team, the business analyst team … Microsoft Office never leaves us.

A shared fantasy was, what would happen to the world if Microsoft Office suddenly ceased to exist … the following are some pearls from that discussion … of course I have added some of my own, and welcome all of you to keep on adding to this list through the comments –

  1. MBAs would not have anything to do apart from sitting in meetings
  2. Corporations would realize how overly paid we all are
  3. The consulting industry would come to a virtual stand still
  4. People will actually work instead of creating documents
  5. Colleagues and teams will start talking to each other instead of exchanging documents and Track Change (Ctrl+Shift+E) reviews and Comments (Alt+R+C)
  6. Wikis and other collaborative groupware would be put to use … heck even Google Buzz might be exhumed
  7. B-schools will be forced to change their pedagogy or they will be virtually assignment-free … wheeee!!

… to be continued