dbTalk Databases Forums  

Assigning an Intrinsic property to a calculated member

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


Discuss Assigning an Intrinsic property to a calculated member in the microsoft.public.sqlserver.olap forum.



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

Default Assigning an Intrinsic property to a calculated member - 11-15-2004 , 05:54 AM






Hi,

I'm looking for a way of assigning a cube intrinsic property
(specifically, CUBE_NAME) to a member, in such a way that I can then
use that value in a LookUpCube query on a second cube; basically, I'm
trying to define a standard calculated member which will encapsulate
the LookUpCube logic, and install that calculated member in multiple
cubes. For the logic to work as planned, the calculated member will
need to be able to sense which cube it's in (hence the question).

In case that's not clear, here's an example. If I execute the
following query in FoodMart 2000 in the MDX Sample Application

select {measures.[unit sales]} properties cube_name on 0 from sales

I can then click on the column heading {Unit Sales] and see the
property returned, as [Measures].[CUBE_NAME], with the value "Sales".
However, what I would *like* to do is to be able to assign that value
to a calculated member, along the lines of:

with member [measures].[cube name] as
'properties cube_name'
select {measures.[cube name]} on 0 from sales

or

with member [measures].[cube name] as
'[measures].[unit sales].properties("cube_name")'
select {measures.[cube name]} on 0 from sales

.... but neither of these works! :-)

Any ideas? If I can get the cube name assigned in such a way, the
rest of the requirement is quite straightforward.

Cheers,
Koan

Reply With Quote
  #2  
Old   
Chris Webb
 
Posts: n/a

Default RE: Assigning an Intrinsic property to a calculated member - 11-15-2004 , 10:13 AM






I can't think of a way to do this, and in any case I would recommend you
don't use the LOOKUPCUBE function: anything you can do with LOOKUPCUBE you
should be able to do with a virtual cube, and the virtual cube approach is
likely to perform much, much better. What is it you're trying to achieve here?

"Koan B" wrote:

Quote:
Hi,

I'm looking for a way of assigning a cube intrinsic property
(specifically, CUBE_NAME) to a member, in such a way that I can then
use that value in a LookUpCube query on a second cube; basically, I'm
trying to define a standard calculated member which will encapsulate
the LookUpCube logic, and install that calculated member in multiple
cubes. For the logic to work as planned, the calculated member will
need to be able to sense which cube it's in (hence the question).

In case that's not clear, here's an example. If I execute the
following query in FoodMart 2000 in the MDX Sample Application

select {measures.[unit sales]} properties cube_name on 0 from sales

I can then click on the column heading {Unit Sales] and see the
property returned, as [Measures].[CUBE_NAME], with the value "Sales".
However, what I would *like* to do is to be able to assign that value
to a calculated member, along the lines of:

with member [measures].[cube name] as
'properties cube_name'
select {measures.[cube name]} on 0 from sales

or

with member [measures].[cube name] as
'[measures].[unit sales].properties("cube_name")'
select {measures.[cube name]} on 0 from sales

.... but neither of these works! :-)

Any ideas? If I can get the cube name assigned in such a way, the
rest of the requirement is quite straightforward.

Cheers,
Koan


Reply With Quote
  #3  
Old   
Koan B
 
Posts: n/a

Default RE: Assigning an Intrinsic property to a calculated member - 11-15-2004 , 11:05 AM



"=?Utf-8?B?Q2hyaXMgV2ViYg==?="
<OnlyForPostingToNewsgroups (AT) hotmail (DOT) com> wrote in
news:6F08F171-2494-42D2-B974-12A89C5B2547 (AT) microsoft (DOT) com:

Quote:
I can't think of a way to do this, and in any case I would
recommend you don't use the LOOKUPCUBE function: anything you
can do with LOOKUPCUBE you should be able to do with a virtual
cube, and the virtual cube approach is likely to perform much,
much better. What is it you're trying to achieve here?
Appreciate the reply; but I've already described as much as I'm at
liberty to (about what I'm trying to achieve) in the original post.
I'm well aware of the impact of using LookUpCube; despite that, it is
the right approach for this particular requirement.

Sorry to appear vague, but I have to respect my company's policy on
IPR; specifically, about not inadvertently disclosing any.

Cheers,
Koan


Reply With Quote
  #4  
Old   
Peter Yang [MSFT]
 
Posts: n/a

Default RE: Assigning an Intrinsic property to a calculated member - 11-16-2004 , 02:32 AM



Hello Koan,

Thank you for your post.

I think this cannot be implemented because intrinsic member properties is
different from member properties. For example, you can use the following
MDX to return member perperites directly:

select {[Store].Members} DIMENSION properties Store.[Store Manager] on 0
from sales

WITH
MEMBER [Measures].[Store Size] AS
'Val(Store.CurrentMember.Properties("Store Sqft"))'

SELECT
{[Measures].[Unit Sales], [Measures].[Store Size]} ON COLUMNS,
{[Store].[Store Name].Members} ON ROWS
From Sales

However, when you use instric member perperties like cube_name, you cannot
see it directly

select {measures.[unit sales]} properties cube_name on 0 from sales

The workaround here is to create new member properties of cube name on
dimension members and then use a calcuated measure to show the cube_name by
using this member property.

Best Regards,

Peter Yang
MCSE2000, MCSA, MCDBA
Microsoft Partner Online Support

Get Secure! - www.microsoft.com/security

================================================== ===
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from your issue.
================================================== ===
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
Quote:
Subject: RE: Assigning an Intrinsic property to a calculated member
From: Koan B <koanb (AT) newsgroups (DOT) nospam
References: <Xns95A279251B16Akoanbee (AT) 207 (DOT) 46.248.16
6F08F171-2494-42D2-B974-12A89C5B2547...soft (DOT) com
Message-ID: <Xns95A2ADE807823koanbee (AT) 207 (DOT) 46.248.16
User-Agent: Xnews/06.02.16
Newsgroups: microsoft.public.sqlserver.olap
Date: Mon, 15 Nov 2004 09:05:41 -0800
NNTP-Posting-Host: exony-ltd-02.altohiway.com 213.83.66.226
Lines: 1
Path:
cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFT NGP08.phx.gbl!TK2MSFTNGP09
..phx.gbl
Quote:
Xref: cpmsftngxa10.phx.gbl microsoft.public.sqlserver.olap:54984
X-Tomcat-NG: microsoft.public.sqlserver.olap

"=?Utf-8?B?Q2hyaXMgV2ViYg==?="
OnlyForPostingToNewsgroups (AT) hotmail (DOT) com> wrote in
news:6F08F171-2494-42D2-B974-12A89C5B2547 (AT) microsoft (DOT) com:

I can't think of a way to do this, and in any case I would
recommend you don't use the LOOKUPCUBE function: anything you
can do with LOOKUPCUBE you should be able to do with a virtual
cube, and the virtual cube approach is likely to perform much,
much better. What is it you're trying to achieve here?

Appreciate the reply; but I've already described as much as I'm at
liberty to (about what I'm trying to achieve) in the original post.
I'm well aware of the impact of using LookUpCube; despite that, it is
the right approach for this particular requirement.

Sorry to appear vague, but I have to respect my company's policy on
IPR; specifically, about not inadvertently disclosing any.

Cheers,
Koan



Reply With Quote
  #5  
Old   
Koan B
 
Posts: n/a

Default RE: Assigning an Intrinsic property to a calculated member - 11-16-2004 , 02:58 AM



petery (AT) online (DOT) microsoft.com (Peter Yang [MSFT]) wrote in
news:3#I2Tb7yEHA.3028 (AT) cpmsftngxa10 (DOT) phx.gbl:

Quote:
I think this cannot be implemented because intrinsic member
properties is different from member properties. For example, you
can use the following MDX to return member perperites directly:
/Snip

Agreed

<Snip>
Quote:
The workaround here is to create new member properties of cube
name on dimension members and then use a calcuated measure to
show the cube_name by using this member property.
/Snip

I have settled on a different workaround; using DSO to read the cube
name and insert it in the appropriate place of the calculated member
definition.

Thanks again for your reply!

Cheers,
Koan


Reply With Quote
  #6  
Old   
Peter Yang [MSFT]
 
Posts: n/a

Default RE: Assigning an Intrinsic property to a calculated member - 11-16-2004 , 07:31 PM



Hello Koan,

Glad to hear that you found a workaround! :-)

Best Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security

================================================== ===
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from your issue.
================================================== ===
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
Quote:
Subject: RE: Assigning an Intrinsic property to a calculated member
From: Koan B <koanb (AT) newsgroups (DOT) nospam
References: <Xns95A279251B16Akoanbee (AT) 207 (DOT) 46.248.16
6F08F171-2494-42D2-B974-12A89C5B2547...soft (DOT) com
<Xns95A2ADE807823koanbee (AT) 207 (DOT) 46.248.16>
<3#I2Tb7yEHA.3028 (AT) cpmsftngxa10 (DOT) phx.gbl>
Quote:
Message-ID: <Xns95A35B4148F2Ekoanbee (AT) 207 (DOT) 46.248.16
User-Agent: Xnews/06.02.16
Newsgroups: microsoft.public.sqlserver.olap
Date: Tue, 16 Nov 2004 00:58:14 -0800
NNTP-Posting-Host: exony-ltd-02.altohiway.com 213.83.66.226
Lines: 1
Path:
cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl!TK2MSFT NGP08.phx.gbl!TK2MSFTNGP11
.phx.gbl
Quote:
Xref: cpmsftngxa10.phx.gbl microsoft.public.sqlserver.olap:55011
X-Tomcat-NG: microsoft.public.sqlserver.olap

petery (AT) online (DOT) microsoft.com (Peter Yang [MSFT]) wrote in
news:3#I2Tb7yEHA.3028 (AT) cpmsftngxa10 (DOT) phx.gbl:

I think this cannot be implemented because intrinsic member
properties is different from member properties. For example, you
can use the following MDX to return member perperites directly:
/Snip

Agreed

Snip
The workaround here is to create new member properties of cube
name on dimension members and then use a calcuated measure to
show the cube_name by using this member property.
/Snip

I have settled on a different workaround; using DSO to read the cube
name and insert it in the appropriate place of the calculated member
definition.

Thanks again for your reply!

Cheers,
Koan



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.