Creating a simple counter fact and metric
Before we play with sales figures, we need to know some basic information: how many records are we talking about? How many rows should I expect to be returned from a fact table?
Getting ready
I think it's useful to create a shortcut on the Windows desktop to the sqlcmd
utility, so that we can easily open the command-line SQL interface to verify the correctness of the statements generated by MicroStrategy.
This is the one liner that I use (should be written on a single line):
C:\Windows\System32\cmd.exe /c sqlcmd -S (localdb)\v11.0 -d AdventureWorksDW2008R2
So, whenever I click on the shortcut I jump directly into the data warehouse.
Once you get in please run this:
select count(1) from FactInternetSales go
This will show the real number of rows contained in the fact table (FactInternetSales
) that we are going to use. And this:
select sum(SalesAmount) from FactInternetSales go
This will return the total sales of all-time on the Internet channel. It's...