dbTalk Databases Forums  

MDX for Calculated Member Set

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


Discuss MDX for Calculated Member Set in the microsoft.public.sqlserver.olap forum.



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

Default MDX for Calculated Member Set - 05-04-2006 , 03:27 PM






This Q regards AS 2000
I have one dimension called "Property" that has a (level) property called
'SameStoreNextYear_Flag'. I want to add a calculated member called
"SameStoreProjected" to another dim, "PortfolioStatus" that is a list of all
the Property members that have SameStoreNextYear_Flag='Y'. The idea is that
when "SameStoreProjected" is a slicer and Property.Members is on the rows,
the rows will be filtered to only those where SameStoreNextYear_Flag='Y'.

How do I do it ? This is a start, that is not working:
Iif([Property].CurrentMember.Properties ("Samestorenextyr_Flag") = "Y",
[Property].CurrentMember,0)

Reply With Quote
  #2  
Old   
AT
 
Posts: n/a

Default RE: MDX for Calculated Member Set - 05-05-2006 , 03:44 AM






Hello,

Do all members in Property dimension have SameStoreNextYear_Flag member
property ? If the property is only for a level you may need to use
CurrentMember.Level.Name to check if member is on the level.

What is the error message you got by using the IIF expression?

Best Regards,

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

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.



Reply With Quote
  #3  
Old   
Darren Gosbell
 
Posts: n/a

Default Re: MDX for Calculated Member Set - 05-05-2006 , 10:44 PM



First off the reason why your iif statement is not working is that in AS
2000, an iif can only return a string or a number and you are trying to
return an member (the iif in AS 2005 can return members)

Secondly I don't know if the calculated member in the slicer is going to
work, but what you could do is to either create a virtual dimension off
the member property - you could then use the virtual dim in the slicer.
Or you could use the filter function, either directly in your query or
to create a named set.

eg.

FILTER(Property.Stores.Members
,Property.CurrentMember.Properties("Samestorenexty r_Flag") = "Y")

--
Regards
Darren Gosbell [MCSD]
Blog: http://www.geekswithblogs.net/darrengosbell

In article <99ADA4D1-03BE-4C05-AB80-EFC508A80C45 (AT) microsoft (DOT) com>,
markgsch (AT) noemail (DOT) noemail says...
Quote:
This Q regards AS 2000
I have one dimension called "Property" that has a (level) property called
'SameStoreNextYear_Flag'. I want to add a calculated member called
"SameStoreProjected" to another dim, "PortfolioStatus" that is a list of all
the Property members that have SameStoreNextYear_Flag='Y'. The idea is that
when "SameStoreProjected" is a slicer and Property.Members is on the rows,
the rows will be filtered to only those where SameStoreNextYear_Flag='Y'.

How do I do it ? This is a start, that is not working:
Iif([Property].CurrentMember.Properties ("Samestorenextyr_Flag") = "Y",
[Property].CurrentMember,0)


Reply With Quote
  #4  
Old   
MarkGsch
 
Posts: n/a

Default Re: MDX for Calculated Member Set - 05-08-2006 , 12:29 PM



Darren, I can get this to work with a virtual dim, but would like to avoid it
if possible. With your help I was able to create a named set that works as
follows:
FILTER([Property].[Project].Members
,[Property].CurrentMember.Properties("Samestorenextyr_Flag") = "Y")

Now how do I now create a calculated member in the PortfolioStatus dim that
brings in the aggregation of the named sets' members ? Thanks


"Darren Gosbell" wrote:

Quote:
First off the reason why your iif statement is not working is that in AS
2000, an iif can only return a string or a number and you are trying to
return an member (the iif in AS 2005 can return members)

Secondly I don't know if the calculated member in the slicer is going to
work, but what you could do is to either create a virtual dimension off
the member property - you could then use the virtual dim in the slicer.
Or you could use the filter function, either directly in your query or
to create a named set.

eg.

FILTER(Property.Stores.Members
,Property.CurrentMember.Properties("Samestorenexty r_Flag") = "Y")

--
Regards
Darren Gosbell [MCSD]
Blog: http://www.geekswithblogs.net/darrengosbell

In article <99ADA4D1-03BE-4C05-AB80-EFC508A80C45 (AT) microsoft (DOT) com>,
markgsch (AT) noemail (DOT) noemail says...
This Q regards AS 2000
I have one dimension called "Property" that has a (level) property called
'SameStoreNextYear_Flag'. I want to add a calculated member called
"SameStoreProjected" to another dim, "PortfolioStatus" that is a list of all
the Property members that have SameStoreNextYear_Flag='Y'. The idea is that
when "SameStoreProjected" is a slicer and Property.Members is on the rows,
the rows will be filtered to only those where SameStoreNextYear_Flag='Y'.

How do I do it ? This is a start, that is not working:
Iif([Property].CurrentMember.Properties ("Samestorenextyr_Flag") = "Y",
[Property].CurrentMember,0)



Reply With Quote
  #5  
Old   
Darren Gosbell
 
Posts: n/a

Default Re: MDX for Calculated Member Set - 05-09-2006 , 07:00 AM



Actually I'm can't remember why I was thinking that the calculated
member would not work. To calculate a single member, it should be as
simple as wrapping the set in a call to the aggregate (or sum) function.

eg.

AGGREGATE(FILTER([Property].[Project].Members
,[Property].CurrentMember.Properties("Samestorenextyr_Flag") = "Y"))

--
Regards
Darren Gosbell [MCSD]
Blog: http://www.geekswithblogs.net/darrengosbell

In article <FD39C45C-4F99-441C-BB62-C523062BE58B (AT) microsoft (DOT) com>,
markgsch (AT) noemail (DOT) noemail says...
Quote:
Darren, I can get this to work with a virtual dim, but would like to avoid it
if possible. With your help I was able to create a named set that works as
follows:
FILTER([Property].[Project].Members
,[Property].CurrentMember.Properties("Samestorenextyr_Flag") = "Y")

Now how do I now create a calculated member in the PortfolioStatus dim that
brings in the aggregation of the named sets' members ? Thanks


"Darren Gosbell" wrote:

First off the reason why your iif statement is not working is that in AS
2000, an iif can only return a string or a number and you are trying to
return an member (the iif in AS 2005 can return members)

Secondly I don't know if the calculated member in the slicer is going to
work, but what you could do is to either create a virtual dimension off
the member property - you could then use the virtual dim in the slicer.
Or you could use the filter function, either directly in your query or
to create a named set.

eg.

FILTER(Property.Stores.Members
,Property.CurrentMember.Properties("Samestorenexty r_Flag") = "Y")

--
Regards
Darren Gosbell [MCSD]
Blog: http://www.geekswithblogs.net/darrengosbell

In article <99ADA4D1-03BE-4C05-AB80-EFC508A80C45 (AT) microsoft (DOT) com>,
markgsch (AT) noemail (DOT) noemail says...
This Q regards AS 2000
I have one dimension called "Property" that has a (level) property called
'SameStoreNextYear_Flag'. I want to add a calculated member called
"SameStoreProjected" to another dim, "PortfolioStatus" that is a list of all
the Property members that have SameStoreNextYear_Flag='Y'. The idea is that
when "SameStoreProjected" is a slicer and Property.Members is on the rows,
the rows will be filtered to only those where SameStoreNextYear_Flag='Y'.

How do I do it ? This is a start, that is not working:
Iif([Property].CurrentMember.Properties ("Samestorenextyr_Flag") = "Y",
[Property].CurrentMember,0)




Reply With Quote
  #6  
Old   
MarkGsch
 
Posts: n/a

Default Re: MDX for Calculated Member Set - 05-10-2006 , 11:37 AM



Darren, your AGGREGATE is along the lines of what I had in mind, but it is
returning this error when I put it in a calulated member and try to slice on
it:
"Infinite recursion detected during execution of calculated member
SameStoreNextYear. An error occurred during attempt to get a cell value"

Tried it with both SUM and AGGREGATE (same error)
Tried it in an MDX statement and the query just hangs.

One thing I am not sure about is when I slice on 'SameStoreNextYear' and Put
Property.Project.Members down the rows, will it aggregate all
Property.Project.Members, or just filter the Property.Project.Members to the
ones where [Property].CurrentMember.Properties("Samestorenextyr_Flag") = "Y"))

Please advise. Thanks.

"Darren Gosbell" wrote:

Quote:
Actually I'm can't remember why I was thinking that the calculated
member would not work. To calculate a single member, it should be as
simple as wrapping the set in a call to the aggregate (or sum) function.

eg.

AGGREGATE(FILTER([Property].[Project].Members
,[Property].CurrentMember.Properties("Samestorenextyr_Flag") = "Y"))

--
Regards
Darren Gosbell [MCSD]
Blog: http://www.geekswithblogs.net/darrengosbell

In article <FD39C45C-4F99-441C-BB62-C523062BE58B (AT) microsoft (DOT) com>,
markgsch (AT) noemail (DOT) noemail says...
Darren, I can get this to work with a virtual dim, but would like to avoid it
if possible. With your help I was able to create a named set that works as
follows:
FILTER([Property].[Project].Members
,[Property].CurrentMember.Properties("Samestorenextyr_Flag") = "Y")

Now how do I now create a calculated member in the PortfolioStatus dim that
brings in the aggregation of the named sets' members ? Thanks


"Darren Gosbell" wrote:

First off the reason why your iif statement is not working is that in AS
2000, an iif can only return a string or a number and you are trying to
return an member (the iif in AS 2005 can return members)

Secondly I don't know if the calculated member in the slicer is going to
work, but what you could do is to either create a virtual dimension off
the member property - you could then use the virtual dim in the slicer.
Or you could use the filter function, either directly in your query or
to create a named set.

eg.

FILTER(Property.Stores.Members
,Property.CurrentMember.Properties("Samestorenexty r_Flag") = "Y")

--
Regards
Darren Gosbell [MCSD]
Blog: http://www.geekswithblogs.net/darrengosbell

In article <99ADA4D1-03BE-4C05-AB80-EFC508A80C45 (AT) microsoft (DOT) com>,
markgsch (AT) noemail (DOT) noemail says...
This Q regards AS 2000
I have one dimension called "Property" that has a (level) property called
'SameStoreNextYear_Flag'. I want to add a calculated member called
"SameStoreProjected" to another dim, "PortfolioStatus" that is a list of all
the Property members that have SameStoreNextYear_Flag='Y'. The idea is that
when "SameStoreProjected" is a slicer and Property.Members is on the rows,
the rows will be filtered to only those where SameStoreNextYear_Flag='Y'.

How do I do it ? This is a start, that is not working:
Iif([Property].CurrentMember.Properties ("Samestorenextyr_Flag") = "Y",
[Property].CurrentMember,0)





Reply With Quote
  #7  
Old   
AT
 
Posts: n/a

Default Re: MDX for Calculated Member Set - 05-12-2006 , 02:28 AM



Hello,

It seems to be related to solve order. You may want to let calculated
member has a higher solve order than 1000 to test.

Best Regards,

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

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.



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.