Back in 2017-18, I started teaching a course in a business school – instead of including a lot of theoretical frameworks, I opted to go with the basics and some implementation and tooling concepts. One of the tools that I chose to teach was how to use R in business analytics.
For those of you who do not know R, here is a helpful wiki article on the same.
Teaching what is broadly a scripting language to graduate students who havent written a single line of code is a humbling experience. You cannot take concepts such as variables, control loops, libraries as taken for granted since the exposure to these has been minimal. So how does one pack all that information into simple, usable instructions?
This is what I did.
Use free MOOCs
For students to understand the basic concepts of R – vectors, assignments, matrix, simple functions, etc, I prefer free MOOC such as the Introduction to R by Datacamp. The course is simple, it has the R ide within the practice area and allows for easy practice sessions and a playground to test your scripts while you are reading through the course material. I find this super useful for application oriented courses.
Right before jumping into the actual concepts of how R can be used for business analysis, this basic introduction course helps in establish a good solid base for participants who want to get started with R.
Use multiple datasets
I typically start these sessions with a financial data set. Credit card usage statistics, or some such information. However, I realized that students do better if they are able to relate to the date. During the length of the course, I found that switching to a course such as movie data (and thanks to IMDB for opening up their database) or cricket data made a lot more sense. It became easier for the participants to apply conceptual learning on the data sets.
See and Do
We used to incorporate several practice sessions in the class. This included getting the basics, writing scripts and getting started with R.
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 –
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
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.)
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.
Click on Save and Finish. Your ODBC Connection is ready to be used in Excel!
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.
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.
Choose your ODBC Connection and you are done!
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!
WordPress is a fantastic Content Management System, it can be a very simple application to learn for newbies, and it can still deliver the high level of customization that pros typically require. The level of help available across the interwebs for this is also high and it has a thriving developer community. I thought that I would add to the helpful howto’s on WordPress so that a complete newbie can install WordPress on his own machine to give it a whirl.
Here’s a step by step guide on how to install WordPress on your machine –
First ensure you have all the right resources (XAMPP) – This is to ensure that you have a webserver with a MySQL server setup on your machine. Download the setup and install it. It will typically create a folder C:\xampp. Within this folder, make a note of the htdocs folder (this becomes your document root for your local web server). To check whether this has been properly done or not, simply open a browser and type in localhost and see whether you get a welcome page or not!
After setting up your own webserver, you need the WordPress scripts. Download and extract this in your htdocs folder (it should default to a wordpress folder)
Now simply type in this URL in your browser (http://localhost/wordpress). If you are setting it up for the first time, then you will be prompted to create a configuration file.
Now remember, for the next step you need to have created the database for WordPress. This is pretty straightforward. Open another link in your browser (http://localhost/phpmyadmin). This will be installed by default if you are using XAMPP. I am creating a database by the name of wp2, here’s how it looks
Now go to the previous browser window and click on the “Create a Configuration File” and proceed to the next step. Enter the following details, (Database – wp2, Username – root, leave the password blank since the default MySQL password for XAMPP is empty! Click on Submit.
All right! You are all set to run the install (a confirmation for this is the Run the Install button!).
The next screen is simple, what do you want to call your site (Site Title – I would always name it test since its on my local machine), username is admin and password also admin. NOTE – On a live webserver, the usernames and passwords will HAVE to be different.
In the end, I always check off the Allow Search Engines to index this site. Its on my local host and I do not want to do unnecessary indexing and pinging to the search engines.
That’s it, now you login with your username and password (in this case it was admin, admin). You should see the Dashboard of WordPress. Congratulations! You have setup WordPress on your localhost successfully!
I hope you found this helpful! In case if you got stuck anywhere in the steps outlined, do let me know, I shall be more than happy to help you out!