ValidMeasure

Analysis Services

Analysis Services

ValidMeasure

Returns a valid measure in a virtual cube by forcing inapplicable dimensions to their top level.

Syntax

ValidMeasure(«Tuple»)

Returns a valid measure from a tuple in a virtual cube specified in «Tuple».

Remarks

When computing values in a virtual cube, measure cells only contain values at the (All) level for dimensions that are not common between the underlying cubes. The ValidMeasure function returns the measure value from the cell at the (All) level coordinates for the dimensions that are not common.

Example

Consider a virtual cube named ExchSales that is derived from cubes Sales and ExchRate. The Sales cube contains dimensions Time, Products, and Customers, and the measure Sale in dollars. The ExchRate cube contains the dimensions Time and Currency and the measure Rate.

To create a calculated member named YenSale that returns the value of each sale in Yen, the (All) level must be specified for each dimension not present in the ExchRate cube for there to be a value present in the virtual cube cell. This can be cumbersome for virtual cubes where a number of dimensions are not common between the underlying cubes.

The ValidMeasure function ensures the measure's value is taken from the appropriate cell at the (All) level for each dimension not in common. The following two Multidimensional Expressions (MDX) statements are equivalent:

YenSale = Sum({Descendants(Time.CurrentMember, Day}}, 
    Sale * (Currency.Yen, AllProducts, AllCustomers))

YenSale = Sum({Descendants(Time.CurrentMember, Day}}, 
    Sale * ValidMeasure(Currency.Yen))