dbTalk Databases Forums  

Member Properties, how to use

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


Discuss Member Properties, how to use in the microsoft.public.sqlserver.olap forum.



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

Default Member Properties, how to use - 07-21-2004 , 07:30 PM






I want to get properties, but I get an error:

SELECT {[Subs Count]} On Columns, {[Zone Id].properties("Zone Name")} On
Rows
from [Consumer]


I guess the syntax is wrong



Reply With Quote
  #2  
Old   
Cindy Lee
 
Posts: n/a

Default Re: Member Properties, how to use - 07-21-2004 , 07:47 PM






ok, i got it. You gotta do something like this:

WITH SET CardTypes AS 'CreatePropertySet([Gender], [Zone Id].[Zone
Id].Members,
[Zone Id].CurrentMember.Properties
("Zone Name"))'
SELECT {[Subs Count]} ON COLUMNS,
CardTypes ON ROWS
from [Consumer]


Any easier way?



"Cindy Lee" <cindylee (AT) hotmail (DOT) com> wrote

Quote:
I want to get properties, but I get an error:

SELECT {[Subs Count]} On Columns, {[Zone Id].properties("Zone Name")} On
Rows
from [Consumer]


I guess the syntax is wrong





Reply With Quote
  #3  
Old   
Olivier Matrat
 
Posts: n/a

Default Re: Member Properties, how to use - 07-22-2004 , 04:22 AM



Depends on what you want to do with the properties.

Your syntax with the CreatePropertySet() is a very powerfull, undocumented
one that creates a set based on all distinct values for a member property,
and maybe this is exactly what you want.

If you simply want to display your property's values for each member in a
report, you can use a calculated member such as :

WITH Member Measures.ZoneName AS '[Zone Id].CurrentMember.Properties("Zone
Name")'
SELECT {Measures.[ZoneName], Measures.[Subs Count]} On Columns, {[Zone
Id].[Zone Id].Members} On Rows
from [Consumer]

Also, notice that member properties are not sent to the client by default
when executing a query; but you can force them by explicitly specifying the
properties you want in your result set, using the [DIMENSION] PROPERTIES
keyword on the axis specification:

SELECT {[Subs Count]} ON COLUMNS,
{[Zone Id].[Zone Id].Members} PROPERTIES [Zone Id].[Zone Id].[Zone Name] ON
ROWS
from [Consumer]

The way the properties values are displayed in this case depends on the
client tool you are using; in MDX sample app, you can view the properties'
values by double clicking on the row headers after executing the query,
whereas they can be displayed directly as part of a report in MS Excel
2K2/2K3 PivotTables.

HTH

Olivier.


"Cindy Lee" <cindylee (AT) hotmail (DOT) com> wrote

Quote:
ok, i got it. You gotta do something like this:

WITH SET CardTypes AS 'CreatePropertySet([Gender], [Zone Id].[Zone
Id].Members,
[Zone Id].CurrentMember.Properties
("Zone Name"))'
SELECT {[Subs Count]} ON COLUMNS,
CardTypes ON ROWS
from [Consumer]


Any easier way?



"Cindy Lee" <cindylee (AT) hotmail (DOT) com> wrote in message
news:%23jFRjM4bEHA.1644 (AT) tk2msftngp13 (DOT) phx.gbl...
I want to get properties, but I get an error:

SELECT {[Subs Count]} On Columns, {[Zone Id].properties("Zone Name")}
On
Rows
from [Consumer]


I guess the syntax is wrong







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

Default Re: Member Properties, how to use - 07-22-2004 , 10:42 AM



Look at Russ Whitney's SQL Server Magazine article on Member Properties from
last August:
http://www.winnetmag.com/Article/Art...384/39384.html

It is one of my favorites. If he doesn't do something like this directly,
I'd bet that you can derive a hint on how to do it from one of his examples.


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

"Olivier Matrat" <olivier.matrat_nospam (AT) winsight (DOT) fr> wrote

Quote:
Depends on what you want to do with the properties.

Your syntax with the CreatePropertySet() is a very powerfull, undocumented
one that creates a set based on all distinct values for a member property,
and maybe this is exactly what you want.

If you simply want to display your property's values for each member in a
report, you can use a calculated member such as :

WITH Member Measures.ZoneName AS '[Zone Id].CurrentMember.Properties("Zone
Name")'
SELECT {Measures.[ZoneName], Measures.[Subs Count]} On Columns, {[Zone
Id].[Zone Id].Members} On Rows
from [Consumer]

Also, notice that member properties are not sent to the client by default
when executing a query; but you can force them by explicitly specifying
the
properties you want in your result set, using the [DIMENSION] PROPERTIES
keyword on the axis specification:

SELECT {[Subs Count]} ON COLUMNS,
{[Zone Id].[Zone Id].Members} PROPERTIES [Zone Id].[Zone Id].[Zone Name]
ON
ROWS
from [Consumer]

The way the properties values are displayed in this case depends on the
client tool you are using; in MDX sample app, you can view the properties'
values by double clicking on the row headers after executing the query,
whereas they can be displayed directly as part of a report in MS Excel
2K2/2K3 PivotTables.

HTH

Olivier.


"Cindy Lee" <cindylee (AT) hotmail (DOT) com> wrote in message
news:OG#1#V4bEHA.1656 (AT) TK2MSFTNGP09 (DOT) phx.gbl...
ok, i got it. You gotta do something like this:

WITH SET CardTypes AS 'CreatePropertySet([Gender], [Zone Id].[Zone
Id].Members,
[Zone Id].CurrentMember.Properties
("Zone Name"))'
SELECT {[Subs Count]} ON COLUMNS,
CardTypes ON ROWS
from [Consumer]


Any easier way?



"Cindy Lee" <cindylee (AT) hotmail (DOT) com> wrote in message
news:%23jFRjM4bEHA.1644 (AT) tk2msftngp13 (DOT) phx.gbl...
I want to get properties, but I get an error:

SELECT {[Subs Count]} On Columns, {[Zone Id].properties("Zone Name")}
On
Rows
from [Consumer]


I guess the syntax is wrong









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.