dbTalk Databases Forums  

Counting Rows in a dimension with a certain member property

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


Discuss Counting Rows in a dimension with a certain member property in the microsoft.public.sqlserver.olap forum.



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

Default Counting Rows in a dimension with a certain member property - 07-15-2004 , 01:40 PM






I have a dimension in my OLAP cube that has 4 levels. At the lowest
level I have a member property created. I want to be able to create a
calculated measure that will count the number of rows in the dimension
with this property at the lowest level sent to 'Y', for each level in
the dimension.



Example:
Site Dimension

Country
State
City
Zipcode(with member property valid)

If the city of Phoenix has 3 zipcodes with member propery valid set to
Y, then I want to see a measure showing 3 at the City level for
Phoenix.

If the city of Tucson has 2 zipcodes with member property set to Y,
then I want to see the measue showing 2 at the city level of Tucson,
and 5 at the state level of Arizona, etc.

This is needed for another calcuation that I am working on, so it is
important that I know the number of rows at each level in the
dimension that has the member properties set to 'Y'.

Any help would be greatly appreciated.


Thanks!

Reply With Quote
  #2  
Old   
Andrej Hudoklin
 
Posts: n/a

Default Re: Counting Rows in a dimension with a certain member property - 07-16-2004 , 02:40 AM






Hi,

If this is a star schema dimension that means your values are on the level
of ZipCode,
why don't you just create another column in fact table where for each
ZipCode with 'Y' you put in value 1
and then you create a measure with sum function and that is it!


HTH,
Andrej




"Mitch" <mitchchristensen (AT) yahoo (DOT) com> wrote

Quote:
I have a dimension in my OLAP cube that has 4 levels. At the lowest
level I have a member property created. I want to be able to create a
calculated measure that will count the number of rows in the dimension
with this property at the lowest level sent to 'Y', for each level in
the dimension.



Example:
Site Dimension

Country
State
City
Zipcode(with member property valid)

If the city of Phoenix has 3 zipcodes with member propery valid set to
Y, then I want to see a measure showing 3 at the City level for
Phoenix.

If the city of Tucson has 2 zipcodes with member property set to Y,
then I want to see the measue showing 2 at the city level of Tucson,
and 5 at the state level of Arizona, etc.

This is needed for another calcuation that I am working on, so it is
important that I know the number of rows at each level in the
dimension that has the member properties set to 'Y'.

Any help would be greatly appreciated.


Thanks!



Reply With Quote
  #3  
Old   
Mitch Christensen
 
Posts: n/a

Default Re: Counting Rows in a dimension with a certain member property - 07-16-2004 , 11:35 AM




Thanks for the suggestion. Unfortunately, that will not work for me. I
don't need to count the number of facts with that property set to 'Y', I
only need to count the number of rows in the dimension that has the
property set to 'Y' irregardless of the time, etc.

So if the dimensions has three records with a property set to 'Y', then
at the highest level in the dimension, my measure would show 3.


Thanks!


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

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

Default Re: Counting Rows in a dimension with a certain member property - 07-16-2004 , 01:47 PM



How about defining [Measures].[ValidZipCount] as follows:

Quote:
Filter(Descendants([Site].CurrentMember,,LEAVES),
[Site].CurrentMember.Properties("Valid") = "Y").Count
Quote:
- Deepak

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


Reply With Quote
  #5  
Old   
Mitch Christensen
 
Posts: n/a

Default Re: Counting Rows in a dimension with a certain member property - 07-16-2004 , 03:36 PM



Thanks! That works great. I appreciate the help.





*** 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.