⌨ Syntax
CUBESET(connection,set_expression,[caption],[sort_order],[sort_by])
Arguments
connection
(required)
— A text string of the name of the connection to the cube.
set_expression
(required)
— A text string of a set expression that results in a set of members or tuples. Set_expression can also be a cell reference to an Excel range that contains one or more members, tuples, or sets included in the set.
caption
(optional)
— A text string that is displayed in the cell instead of the caption, if one is defined, from the cube.
sort_order
(optional)
— The type of sort, if any, to perform and can be one of the following:
sort_by
(optional)
— A text string of the value by which to sort. For example, to get the city with the highest sales, set_expression would be a set of cities, and sort_by would be the sales measure. Or, to get the city with the highest population, set_expression would be a set of cities, and sort_by would be the population measure. If sort_order requires sort_by, and sort_by is omitted, CUBESET returns the #VALUE! error message.
▶ Examples
=CUBESET("Sales","[Product].[All Products].Children","Products",1,"[Measures].[Sales Amount]")
=CUBESET("Finance","Order([Product].[Product].[Product Category].Members,[Measures].[Unit Sales],ASC)","Products")