0
votes

I am an OLAP/MDX newbie so pardon me if this is too obvious of a question.

I am trying to define a MDX calculated member which will SUM the values from a dimension property but unable to do so. I am not even sure if this is possible or not.

This is an example scenario.

In the DataWarehouse

Imagine a DiskDim dimension which stores instances of disks and which has a column Size which stores the Size in MB’s of the each Disk.

There is a ComputerDim dimension which stores instances of computers.

There is a fact table ComputerHasDisk which stores the relationship between an instance of a computer and disk. Note the fact table only has the relationship and no columns which can be used as measures.

In AS

We have a DiskDim dimension, a Computer dimension and a count of rows measure for ComputerHasDisk, a count of rows measure for DiskDim and a count of rows measure for ComputerDim.

I want to define a calculated member as part of Measures for Total Disk Size such that using the calculated member I should be able to slice on Computer and get the sum of all the disk sizes for each Computer.

This is the query I am expecting to write:

SELECT [Measures].[TotalDiskSize] ON COLUMNS, [ComputerDim].[ComputerDim].Members ON ROWS FROM [Cube]

How do we define the calculated member [Measures].[TotalDiskSize] to be able to write the query above. Is it even possible ?

Thanks, Anirudh

1

1 Answers

0
votes

If you want to SUM your Disk_Size, then it should have an associated Measure, and not just be a Dimension - you can't and shouldn't be attempting to calculate on dimensions.

Can you extend your fact table to include this column and thus derive a Measure from it?