Analyzing Money
print | close
Analyzing Money
SQL Server Pro
Russ Whitney
Russ Whitney
Mon, 06/16/2003 - 11:00pm
1/3
9/30/2014
Analyzing Money
limited focus by creating what Money calls a "Transactions by Category" report. After I generated this
report, I chose the Customize option and changed a few settings. On the Rows & Columns tab, I checked the
boxes to include all fields, I set subtotaling to None, and I selected the Show Splits box. These settings gave
me the maximum amount of detailed transaction data. Next, I flipped to the Category tab and clicked Select
All, then cleared the Include Transfers box to include all the data except the inter
account transfers. Next, I
flipped to the Date tab and typed the date range of the transactions I wanted to export: 1/1/2002 to the
current date. (If youre using the Money sample file, you should choose 1/1/2000 to 1/1/2002.) Finally, I
clicked OK and saw the report containing all the data I wanted to export.
When youve generated your report, youll see on the left side of the report under the heading Other Tasks
the option Export to Microsoft Excel. This option generates a CSV file, launches Excel, and opens a spread
sheet that contains your exported data. Click the Export to Microsoft Excel op
tion, and type the name of the
CSV file (I chose Sample .csv). After you select the filename and click OK, youll see your data in Excel.
Now comes the fun part. Any experienced DBA knows that data is never in the right format for a direct
import. When you in
spect the Money data, youll see some problems. A blank line separates the
transactions, the Memo field in investment transactions contains multiple pieces of information, the
category field contains both the category and subcategory, and split transactions are a mess. You have to
create a script or use an extraction, transformation, and loading (ETL) tool to fix all these problems. Every
DBA has a favorite ETL tool, but I simply used Visual Basic for Applications (VBA) in Excel. I created a VBA
macro that steps through Excel and reformats the data so that Ican import it into Access and, from there,
build my cube. For more information about the macro I cre
ated, see Money Macro.
If you have an OLE DB driver that reads Excel documents, you could go directly from this step to designing
and processing the cube. I didnt have the necessary driver, so I first loaded the Excel data from Sample.xls
(the Excel version of Sample.csv) into an Ac
cess table. To do this, start Access and choose File, New, Blank
Database. Pick a filename such as MSMoneySample.mdb. From the File menu, select Get External Data,
Import. Select Sample.xls, and Access will show you the Import Spreadsheet Wiz
ard. In the wiz
ard, you
need to make a few changes. On the wizards first page, select the First Row Contains Column Headings
option. In the first column of the third page, change the field option called Indexed to No. Finally, click
Finish, and close Access.
2/3
9/30/2014
Analyzing Money
that has a combo box of choices. You can also enable drillthrough from the cube editor. From the Tools
menu, select Drillthrough Options. In the Cube Drillthrough Options dialog box, click Enable Drillthrough,
and select the columns you want your OLAP front-end application to display when you drill through a cell
of the cube. (I recommend select
ing all the columns.)
Drillthrough lets you see individual trans
actions that make up cell values in the cube. For example, say your
money-management application says you spent $1543.21 on din
ing out in March, and you cant believe it.
Drill
through lets you see ex
actly which transactions you, your spouse, or someone else in the family entered
in the Dining Out category for March.
If youre like me, every chart or grid of numbers you see thats based on the Money data will answer one
question and prompt you to ask two more. If you have a good OLAP front-end tool, you can quickly
navigate the data by pivoting in and out of di
mensions. Drill down or up, and youll learn things about your
finances that you never knew before. You could learn these things by running reports in Money, but
analyzing the re
ports would take you a long time, and you mightgiveup beforeyou got any information.
http://sqlmag.com/print/analysis/analyzing-money
3/3