This Year - Last Year SSAS Calculated Member

Who is online?  0 guests and 1 members
Home  »  Articles  »  This Year - Last Year SSAS Calculated Member

This Year - Last Year SSAS Calculated Member

change text size: A A A
Published: 2/16/2010 by  tinocash  - Views:  [1951]  

Creating a This Year Last Year Calculation for SSAS Cube

In this quick demo I’m going to add a calculated member to the AdventureWorks cube that allows an end user to do a This Year/ Last Year comparison for a given measure.

To do this tutorial you must have the AdventureWorks database AdvertureWoksDW2008 in place on your server. You will also need the AdvertureWorks 2008 SSAS project.

Step 1. Open up the Adventure Works SSAS 2008 Enterprise project. Go to the Adventure Works data source view. Right click on the Date table and add a named calculation as shown below to the Date table. Click Save. 

Figure 1

 

Figure 2

Step 2. Add the new [Date – Calculations] column as a dimension attribute of the Date dimension and set the attribute properties. To do this, drag the [Date – Calculations] column from the Data Source View to the Attributes window. Set the properties for the Date – Calculations attribute as shown below. Click Save.

Figure 3

Figure 4

Step 3. Add the Last Year calculation to the cube as shown below.

Figure 5

Step 4. Add a scope to the Last Year calculated member as shown below.

Figure 6

Step 5. Deploy the cube. Now let’s see what our calculation looks like.

Figure 7

In this demo the Date- Calculation only works for the Date dimension, and Reseller Sales Amount measure. It doesn’t work for Delivery Date or Shipping Date. Delivery Date and Shipping Date would need to be scoped separately as well as additional measures.

To use the Date – Calculation an attribute from the Date dimension must be on one of the axis.

Hope this post was helpful.

 
0
/5
Avg: 0/5: (0 votes)

Comments (1)

mikedavis
mikedavis said:
Very Nice Article Tino. Glad to see you writing.
2/17/2010
 · 
 
by

Most Recent Articles