Business Intelligence

This chapter gives the practitioner's view of how business intelligence can be used. Can you think of at least one key business process/activity that is well-suited for a business intelligence application?

Databases

Learning Objectives

  1. Determine which tables and fields in a database are needed to complete a query
  2. Explain how data is captured in our Class App store
  3. Explain how the Class App store data can be used for business intelligence


Introduction

In all of the forms of BI described above, you must actually store data to analyze. Organizations store their data in databases connected to their production systems. Here are some examples:

  • Banking transaction systems store data in databases containing information about customers, accounts, and transactions against those accounts.
  • University enrollment systems store data in databases containing information about students, faculty, courses, and enrollment in those courses.
  • Cell phone billing systems store data in databases containing information about customers, rate plans, and calls made.
  • Credit card billing systems store data in databases containing information about customers, credit plans, and items charged.
  • Supermarket checkout systems store data in databases containing information about customers, products, and buying habits of their customers. The loyalty card that you have swiped at the checkout ties all your purchases back to your name.

What do these databases actually look like? They consist of tables of data that are related to each other. This is called a relational database. Each table must have a unique identifier that is called a primary key. The database is organized into parent and child tables to avoid duplicating data. Data common to each child is stored in the parent table. Diagrammatically a parent table points to its child tables. Each parent record can have zero or more child records. To logically link the tables together simply repeat the primary key as a foreign key in each corresponding record of the child table. To get information in and out of a relational database requires a relational database management system (RDBMS) such as Microsoft Access. The goal of the system is to facilitate transactions while safe guarding the integrity of the data.

The theory behind database design is one of the most elegant areas in all of information systems. If you continue in information systems, you will see it in detail. However, for our purposes all we need to know is that data is typically stored in multiple files even if the report that we get is contained in a single file. Why? The simple answer is that we want to avoid duplicate data by storing information common to each child in the parent table. Why do we care? Because duplicate data opens up the possibility that one of the duplicates will be different in an important way. For example you would not want your bank balance to be sometimes one number, sometimes another depending on which record happens to be called up by the database.


The data from the Class App store is stored in a relational database consisting of two tables – an APP table and a SALES table. The primary key of the APP table is App name. The primary key of the SALES table is the combination of Timestamp and App name. App name in the SALES table is also a foreign key linking each sale with its corresponding App.


Architecture of Class App Store

The Class App store created for this course has at its heart a simple database. Nonetheless, that database supports some fairly sophisticated functionality. The beauty of the Class App store is that it was created almost entirely without writing code, by using Google Sites and Google Docs.

The database consists of two tables – an App table and a Sales table. The App table captures registration information about each app. The Sales table captures sales information – who bought what and when.

Conceptually the tables are linked by what is called a one to many relationship. One app has many sales. Every database has one to many links of this sort. The relationships are formed by the primary key to foreign key correspondence.

Once the architecture is established the next step is to get data in and out of the database. Data is entered into a database using forms. For the App table, use the Register App form. For the Sales table, use the Purchase App form.

Data is extracted from the database using reports. The listing of apps on the Class App store home page is a report.

When the reports involve summary data, we would characterize that as meaningful information. For example, listing the best selling apps and the top rated apps qualifies as information. The number of apps purchased by each student is also information – it reveals how many students have completed the assignment.

And there are a variety of reports that can come out of even a simple database such as this. For example, a report might list the best selling apps for men who are freshmen. One can be quite specific as to the information extracted for analysis.


Architecture of the Class App store. Even this simple database requires two forms and four reports.


Group and Summarize Data

We will analyze the sales data for our own app store to find trends in buying patterns for the class. Distilling that data and finding meaningful patterns is a form of business intelligence.

The important concepts here are to group and summarize data, and then to order and compare groups. For example, showing a list of the best selling apps. Creating this list requires counting total sales for each app and then listing those totals in descending order.

To do this in real time requires sending a query to the store typically written in a language called Structured Query Language (SQL). This is how we were able to get the store to display tables of best selling and top rated apps. The query looks similar to this:

select App, count(Timestamp)

group by App

order by count(Timestamp) desc, App asc

Translation: select the app name and count the number of records (timestamps) for that app. Produce a subtotal (group by) for each App name. Then order the subtotals in descending order. If two apps have the same subtotal, then order them alphabetically.

However, SQL is beyond the scope of this course. What is within the scope of the course is to download and analyze the data in a spreadsheet. Database data can be downloaded and then analyzed using Excel pivot tables. A pivot table is a visual query tool that allows you to answer sophisticated questions without writing any SQL code.


Data is sorted by timestamp above left and by app above right. However, neither sorting produces useful information. Left we download and then group, summarize and sort the data by sales in descending order to reveal the top selling apps. This is meaningful information. "Count of Email" means that we are counting the number of email addresses registered for each app. We count emails since they are unique whereas names might not be. This analysis is performed using an Excel pivot table on the downloaded data.


Multi-Table Databases

The problem with one table databases is that we are limited to querying the data that happens to be in that table. For example, there is no way to see which developers bought their own apps. The sales data here shows only the buyer not the seller. The seller data is stored in a different table. What we need is a way to join information between the two tables. While joining information between tables is possible to do with a spreadsheet (using the Vlookup operation), it is rather difficult and is error prone. The best practice way to accomplish a join is using a database system such as Microsoft Access.

The magic of database systems is that they are able to make data that lives in separate tables appear to reside in the same table. Once the data appears to reside in a single table, then all of the query techniques that apply to one table databases become tools for analysis.


The APP table above and the SALES table below. A relational database is able to integrate information between the two tables.


Data Warehouse

As with many subjects in the course, it is more complicated than that. It would be relatively rare to pull business intelligence data from a live database. The drain on the system might slow down the entire business and thereby frustrate customers. Instead, corporations typically copy data from their databases into a repository called a data warehouse. The warehouse can then be queried repeatedly without affecting the production system.


Periodically, perhaps once a day, data is copied from the company’s many databases to a very large database called the data warehouse. The process of copying the data is called extract, transform, and load (ETL).

  • Extract – Copies data from one or more databases systems.
  • Transform – Cleans the data so that related records in different databases appear in a consistent format.
  • Load – Inserts the cleansed data into the data warehouse.
Why go to all this trouble? One of the main reasons is that analyzing the data on the production system would slow it down considerably leading to poor customer service. Another reason to copy the data is so that multiple databases can be merged into a single data warehouse.

It is the data warehouse that is analyzed to produce management reports.


Note the role of the data warehouse as the central repository for all the business intelligence data.

Latency is the amount of time between the occurrence of a transaction and the loading of that transaction’s information into the business intelligence system. In other words it is the amount of time that passes before a manager has a distilled report in hand analyzing the operation. Some mangers are content to get a monthly update, others need daily or even hourly updates. It depends on the nature of the job. Ironically, lower level managers tend to need more up to the minute data. This is because they control the systems in real time. Upper level managers, by contrast, tend to focus on the big picture over a larger time horizon.


Key Takeaways

  • Multiple corporate databases feed into a large data warehouse that is used for querying the data.
  • The greatest sin in database design is allowing duplicate data. Duplicate data has the potential to become inconsistent – sometimes one value, sometimes another.
  • The higher up a manager is in the organization, the less detail he or she needs to see in the data. In fact, detail only becomes important to an upper manager when it is needed to explain an unexpected trend.


Questions and Exercises

  1. The transform step in the ETL process can be quite involved. Research and find an example of data that needs to be cleaned.
  2. Explain why databases beyond one table require relationships among the tables.