dbTalk Databases Forums  

Descendants Function and StrToMember Function Error

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


Discuss Descendants Function and StrToMember Function Error in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
US-A Brian
 
Posts: n/a

Default Descendants Function and StrToMember Function Error - 04-09-2004 , 10:16 AM






I am attempting to use StrToMember inside of the Descendants function and I get an error. Here is an example of the query I would like to run using the FoodMart 2000 Cube. Keep in mind, I will be using other data and the StrToMember is being used to allow dynamic selection in another application

SELEC
{ [Measures].[Unit Sales] } on Rows
Descendants( StrToMember("[Time].[1998]"), [Time].[Day of Month]) on Column
From [Sales

This is the error I receive

Unable to open cellse
Formula error - object type is not valid - in an <object> base clas

If I just run the query without the StrToMember..
SELEC
{ [Measures].[Unit Sales] } on Rows
Descendants( [Time].[1998], [Time].[Day of Month]) on Column
From [Sales

It works fine. Any help would be greatly appreciated

-Bria


Reply With Quote
  #2  
Old   
Martin Mason
 
Posts: n/a

Default Re: Descendants Function and StrToMember Function Error - 04-10-2004 , 02:24 PM






There appears to be some inconsistent behavior with the StrToMember
function. If you replace it with the Members function, the query works.

SELECT
{ [Measures].[Unit Sales] } on Rows,
Descendants( Members("[Time].[1998]"), [Time].[Day of Month]) on Columns
From [Sales]

HTH,
Martin

"US-A Brian" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
I am attempting to use StrToMember inside of the Descendants function and
I get an error. Here is an example of the query I would like to run using
the FoodMart 2000 Cube. Keep in mind, I will be using other data and the
StrToMember is being used to allow dynamic selection in another application.
Quote:
SELECT
{ [Measures].[Unit Sales] } on Rows,
Descendants( StrToMember("[Time].[1998]"), [Time].[Day of Month]) on
Columns
From [Sales]

This is the error I receive:

Unable to open cellset
Formula error - object type is not valid - in an <object> base class

If I just run the query without the StrToMember...
SELECT
{ [Measures].[Unit Sales] } on Rows,
Descendants( [Time].[1998], [Time].[Day of Month]) on Columns
From [Sales]

It works fine. Any help would be greatly appreciated.

-Brian




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.