dbTalk Databases Forums  

using a member property in a calculated measure

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss using a member property in a calculated measure in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
MattFloyd
 
Posts: n/a

Default using a member property in a calculated measure - 12-02-2004 , 08:11 AM






My question has two parts. The below situation would be equivalent to my real
world scenario.

1. In the FoodMart 2000 database, I would like to calculate sales/square
foot (of store size).
2. I only want to calculate this value for some dimensions (ie I don't want
sales/square foot for each product or for each gender or the household
income. For those dimensions, I would only want the measure to be calculated
if All Gender and All Household Income and All Product were selected.) I do
want to know it for each store, city, region, country and at the all stores
level. I also want to know it for each time period from year to month.

Thanks, Matt



Reply With Quote
  #2  
Old   
jam96-BuffaloJoe
 
Posts: n/a

Default RE: using a member property in a calculated measure - 12-02-2004 , 03:23 PM






Will a named set with the units to be calculated work.
Then use the named set to create your results formula.

Joe

"MattFloyd" wrote:

Quote:
My question has two parts. The below situation would be equivalent to my real
world scenario.

1. In the FoodMart 2000 database, I would like to calculate sales/square
foot (of store size).
2. I only want to calculate this value for some dimensions (ie I don't want
sales/square foot for each product or for each gender or the household
income. For those dimensions, I would only want the measure to be calculated
if All Gender and All Household Income and All Product were selected.) I do
want to know it for each store, city, region, country and at the all stores
level. I also want to know it for each time period from year to month.

Thanks, Matt



Reply With Quote
  #3  
Old   
MattFloyd
 
Posts: n/a

Default RE: using a member property in a calculated measure - 12-02-2004 , 03:31 PM



Are you answering the second part of the question? The problem with the first
part is that store size is a member property and a dimension in the Foodmart
2000 Sales cube.

"jam96-BuffaloJoe" wrote:

Quote:
Will a named set with the units to be calculated work.
Then use the named set to create your results formula.

Joe

"MattFloyd" wrote:

My question has two parts. The below situation would be equivalent to my real
world scenario.

1. In the FoodMart 2000 database, I would like to calculate sales/square
foot (of store size).
2. I only want to calculate this value for some dimensions (ie I don't want
sales/square foot for each product or for each gender or the household
income. For those dimensions, I would only want the measure to be calculated
if All Gender and All Household Income and All Product were selected.) I do
want to know it for each store, city, region, country and at the all stores
level. I also want to know it for each time period from year to month.

Thanks, Matt



Reply With Quote
  #4  
Old   
Dave Wickert [MSFT]
 
Posts: n/a

Default Re: using a member property in a calculated measure - 12-02-2004 , 06:06 PM



If you subscribe to SQL Server Magazine, which I wholeheartedly recommend,
one of Russ Whitney's best articles is from the August 2003 issue titled:
"Member-Properties Boot Camp"
http://www.winnetmag.com/Article/Art...384/39384.html
He outlines 10 ways to effectively use member properties. It would be
extremely useful here.
--
Dave Wickert [MSFT]
dwickert (AT) online (DOT) microsoft.com
Program Manager
BI SystemsTeam
SQL BI Product Unit (Analysis Services)
--
This posting is provided "AS IS" with no warranties, and confers no rights.

"MattFloyd" <MattFloyd (AT) discussions (DOT) microsoft.com> wrote

Quote:
My question has two parts. The below situation would be equivalent to my
real
world scenario.

1. In the FoodMart 2000 database, I would like to calculate sales/square
foot (of store size).
2. I only want to calculate this value for some dimensions (ie I don't
want
sales/square foot for each product or for each gender or the household
income. For those dimensions, I would only want the measure to be
calculated
if All Gender and All Household Income and All Product were selected.) I
do
want to know it for each store, city, region, country and at the all
stores
level. I also want to know it for each time period from year to month.

Thanks, Matt





Reply With Quote
  #5  
Old   
Deepak Puri
 
Posts: n/a

Default Re: using a member property in a calculated measure - 12-02-2004 , 10:04 PM



You can try this Foodmart Sales MDX query, which defines calculated
measures for [StoreSqft] and [SalesPerSqft]:

Quote:
With
Member [Measures].[StoreSqft] as
'Sum(Descendants([Store].CurrentMember, [Store].[Store Name]),
Val([Store].Properties("Store Sqft")))'

Member [Measures].[SalesPerSqft] as
'iif([Gender].CurrentMember is [Gender].[All Gender]
and [Product].CurrentMember is [Product].[All Products],
[Measures].[Store Sales]/[Measures].[StoreSqft], NULL)',
FORMAT_STRING = 'Currency'

Select
{[Measures].[Store Sales], [Measures].[StoreSqft],
[Measures].[SalesPerSqft]} on columns,
Descendants([Store].[All Stores].[USA].[OR],
[Store].[Store State], SELF_AND_AFTER) on rows
from Sales
Quote:

- Deepak

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.