dbTalk Databases Forums  

Filter with member property

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


Discuss Filter with member property in the microsoft.public.sqlserver.olap forum.



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

Default Filter with member property - 02-17-2004 , 02:14 PM






Hi,

I need some help with a member property and a filter, i'm going to try
to explain with an example.

I have one dimension called Stores with two levels City and store.

And I have another table with the number of people that lives in the
cities codified.
1 -> From 1 to 1000
2 -> From 1001 to 10000
3 -> More than 10000

I've assigned to the cities the code that must be assigned in order of
the number of people living in cities.

City1 1
City2 1
City3 2
City4 1
City5 2

The table store is something like this
Store1 City1
Store2 City1
Store3 City2
Store4 City2
Store5 City3
Store6 city4
Store7 City5

In the fact table I have the store code

My problem is that I need to calculate the sales of the store1/sales
of stores that are in the same level of people number.

In the example is sales of store1/sales of
store1+store2+store3+store4+store6 because these are in a city with
codepopulation =1.

I was thinking in making a dimension with the population levels and
making a member property of the city level and in a calculated member
selecting the sum(filter(city.members=store.currentmember.parent .memberproperty)
or something like that. Can anybody help me to do that in a cube?

Thank's in advance!!!!

Un saludo,

Enrique Barceló

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

Default Re: Filter with member property - 02-18-2004 , 11:12 PM






You should be able to follow the approach you suggested.

Another possibility, with better performance, is to define Population
Code as a Member Property at Store level. Next create a Virtual
Dimension, say [Population Code], on that Member Property. Then, for a
given store, you can get sales for all stores with that Code by
selecting the correct member in the Virtual Dimension - no Filter()
needed.

To illustrate, consider Store dimension of Sales cube in Foodmart. This
has "Store Type" property, and [Store Type] Virtual Dimension. Suppose,
for each of the stores, we need sales also as a fraction of total for
that "Store Type":

Quote:
With Member [Measures].[Store Type] as
'[Store].CurrentMember.Properties("Store Type")'
Member [Measures].[Fraction Of Type] as
'([Store].CurrentMember,[Measures].[Store Sales])
/([Store].[All Stores],Members("[Store
Type].["+[Store].CurrentMember.Properties("Store Type")+"]"),
[Measures].[Store Sales])',
FORMAT_STRING = 'Percent'

Select {[Measures].[Store Type],[Measures].[Store
Sales],[Measures].[Fraction Of Type]} on Columns,
Descendants([Store].[All Stores].[USA].[WA],,LEAVES) 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.