Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 using a Cube Calculated measure as a Dimension

Author  Topic 

djj66
Starting Member

1 Post

Posted - 2011-01-04 : 02:25:08
Hi everyone,
I have an Inventory Cube, where Stock levels are recorded by Warehouse within Company, ie a simple hierarchy with the following levels
- Company
- Warehouse
- Item ID (SKU)

I would like to create a dimension that allows me to filter SKU's to only show those stocked or not stocked. (Stock Quantity is a measure in the Cube of course). I'd like this filter to work at all levels, (ie show a result at Company level or Item Level).

To do this, I've made a simple calculated member as follows...

CREATE MEMBER CURRENTCUBE.[Measures].[ProductStocked]
AS case
when [Measures].[Physical Inventory] > 0 then "In Stock"
else "Out Of Stock"
end,
FORMAT_STRING = "Standard",
VISIBLE = 1 , ASSOCIATED_MEASURE_GROUP = 'Inventory Items' ;


and this works fine - It shows the correct text whether at Item or Company Level.
However I want to use this calculated measure as a Dimension, so that Cube Users can filter by it, and just list items in stock etc.

Seems simple to me, but haven't had any success at all. If anyone can suggest how to use this measure as a Dimension, thay would be great. Otherwise if I'm going about this completely the wrong way, some pointers in the right direction would be much appreciated.

Many thanks in advance
David
   

- Advertisement -