Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

MDX simple concept question Expand / Collapse
Author
Message
Posted Sunday, March 10, 2013 12:51 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Yesterday @ 3:36 PM
Points: 1,184, Visits: 1,218
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
Post #1429006
Posted Thursday, March 14, 2013 11:15 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, January 13, 2014 7:34 AM
Points: 117, 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
Post #1431146
Posted Monday, March 18, 2013 6:19 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Yesterday @ 3:36 PM
Points: 1,184, Visits: 1,218
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
Post #1432164
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse