SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


MDX simple concept question


MDX simple concept question

Author
Message
Rob Taylor
Rob Taylor
Hall of Fame
Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)

Group: General Forum Members
Points: 3678 Visits: 1616
As near as I can tell from documentation, the Descendants() function returns a set.

This returns a set of 1,500+ product names.
SELECT
{ } ON COLUMNS,
{Descendants([Product].CurrentMember, [Product].[Product Name])} ON ROWS
FROM [Sales and Warehouse];


Then why doesn't this return the same set of 1,500+ product names? I only get the one item "Set Of Products".
WITH MEMBER [Set Of Products] AS
{ Descendants([Product].CurrentMember, [Product].[Product Name]) }
SELECT
{ } ON COLUMNS,
{ ([Set Of Products])} ON ROWS
FROM [Sales and Warehouse]


And if I try using StrToSet, it complains that it isn't a set (The function expects a tuple set expression for the 1 argument. A string or numeric expression was used.)
WITH MEMBER [Set Of Products] AS
{ Descendants([Product].CurrentMember, [Product].[Product Name]) }
SELECT
{ } ON COLUMNS,
{ SetToStr(( [Set Of Products] ))} ON ROWS
FROM [Sales and Warehouse]


So, my calculated measure must not be a set.

Can someone shed some light?

Thanks,
Rob
Mackers
Mackers
SSChasing Mays
SSChasing Mays (645 reputation)SSChasing Mays (645 reputation)SSChasing Mays (645 reputation)SSChasing Mays (645 reputation)SSChasing Mays (645 reputation)SSChasing Mays (645 reputation)SSChasing Mays (645 reputation)SSChasing Mays (645 reputation)

Group: General Forum Members
Points: 645 Visits: 499
A member is one thing - one product or the sum/avg of a set of products

You need to define your set as a set as below - a set being a collection of members

WITH Set [Set Of Products] AS { Descendants([Product].CurrentMember, [Product].[Product Name]) }SELECT { } ON COLUMNS, { ([Set Of Products])} ON ROWSFROM [Sales and Warehouse]



Make sense?
Mack
Rob Taylor
Rob Taylor
Hall of Fame
Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)

Group: General Forum Members
Points: 3678 Visits: 1616
Mackers (3/14/2013)
A member is one thing - one product or the sum/avg of a set of products

You need to define your set as a set as below - a set being a collection of members

WITH Set [Set Of Products] AS { Descendants([Product].CurrentMember, [Product].[Product Name]) }SELECT { } ON COLUMNS, { ([Set Of Products])} ON ROWSFROM [Sales and Warehouse]



Make sense?
Mack


Makes perfect sense!!

Thank you very much!
Rob
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search