Database Reference
In-Depth Information
Defining
measure
groups
and
measures
The first cube recipe will create a simplistic cube based on the
FactResellerSales
fact table and will include only two dimensions: promotion and date.
To create a cube and its related entities, you must first define the data sources from
where we'll import data and
Data Source Views
(
DSVs
), which define necessary re-
lationships between dimension and fact tables, as well as dimensions you intend to
include in your cube. Please refer to
Chapter 2
,
Defining Analysis Services Dimen-
sions
, for recipes on defining data sources, DSVs, and creating dimensions
Getting ready
Create a new SSDT project called
SSAS_Cookbook_Chapter3
and save it to any
location of your choice. Create a data source view with all the tables via the
Adven-
tureWorksDW2012
database. Add the promotion dimension as discussed in
Chapter
DimDate
table and include the year, month, and date attributes. The date attribute
should be based on the
DateKey
column, and use
FullDateAlternateKey
as
the name column. The date attribute should also be the key attribute of the dimen-
sion. The month attribute must use the
MonthNumberOfYear
and
CalendarYear
columns as keys and the
EnglishMonthName
as the name column. Be sure to cre-
ate attribute relationships between the month and year attributes.
How to do it...
Let's build your first cube by performing the following steps:
1. Right-click on the
Cubes
folder in the
Solution Explorer
window and choose
New Cube
. This activates the cube wizard.
2. Much like the dimension wizard, the cube wizard also allows you to build a
cube-based on existing tables.
3. Other alternatives include creating an empty cube or generating tables in the
relational data source. Creating an empty cube will allow you to add necessary
measure groups and dimensions manually. You will be able to add/remove di-
Search WWH ::
Custom Search