The Right Place for Calculated Members

Suppose you have an OLAP application with 25 or 30 measures and you want to add some calculations, such as Year-To-Date Total, Year-To-Date Average, Growth Rate Current Year vs. Previous Year, and so on. People usually add these calculations to the Measures dimension. So, if you have 25 measures and you want to define 4 or 5 calculations, you have to define more than 100 calculated measures. This simple example almost reaches SQL Server 7.0 OLAP Services' limit on the number of measures allowed per cube, which is 128. SQL Server 2000 Analysis Services lifts this limit to 1024 measures per cube. Still, this approach requires a lot of work to define and manage all the calculated measures and is confusing to end users, who will see a long list of measures with similar names.

An alternative is to add a dimension to your cube to hold these calculations. Let's look at an example of an additional dimension called Periodicity, which has a single input member called Periodical that you assign all input data to. You define all the calculations in this dimension, for example:

(\[Year-To-Date Total\] as 'Sum(\{Ytd(),\[Periodicity\].\[Periodical\])'

The multidimensional nature of the OLAP model creates a Year-To-Date Total for each existing measure and for any measure that you might add in the future. More than that, the end user can easily slice the data by measure and by the new Periodicity dimension.

Discuss this Article 1

Tim Harris (not verified)
on Jul 24, 2001
This is a litlle vague. How exactly is the dimension added?

Please or Register to post comments.

IT/Dev Connections

Las Vegas
September 30th - October 4th

Paul ThurottOur Experts will show you:
• Common SQL Server
Problems
• Best Practices for T-SQL
• SQL Server Integration
Services
• Database Development

Come See Mike Otey & Tim Ford in Person!

Early Registration Now Open

From the Blogs
May 9, 2013
blog

My ISO 8601-Compliant Signature 2

My family recently just "officially" announced that we're in the process of adopting a child from South Africa. We're quite excited, of course, but there's a ton of paperwork to do—along with the need for gobs of signatures....More
May 8, 2013
blog

Use SSIS for ETL from Hadoop

In this blog post, Mark Kromer walks you through using SSIS as a way to use ETL techniques using Microsoft's Hadoop on Windows (HDInsight) as a source using Hive connectors...More
Vision road sign
May 6, 2013
blog

Cheaters Never Win, Even in TPC Benchmarks

In this portion of the series on database benchmarking, I want to tell you about one of my favorite aspects of the TPC benchmarks – CHEATING....More
SQL Server Pro Forums

Get answers to questions, share tips, and engage with the SQL Server community in our Forums.