throws Exception
{
println("\nHierarchical Sorting by Measure Value");
// Get the primary dimensions and the measure.
MdmMeasure mdmUnits = getMdmMeasure("UNITS_AW");
// Get the MdmPrimaryDimension and the default MdmLevelHiearchy for the
// PRODUCT dimension.
MdmPrimaryDimension mdmProdDim = getMdmPrimaryDimension("PRODUCT_AW");
StringSource custHier = (StringSource)
getMdmPrimaryDimension("CUSTOMER_AW").getDefaultHierarchy().getSource();
StringSource chanHier = (StringSource)
getMdmPrimaryDimension("CHANNEL_AW").getDefaultHierarchy().getSource();
StringSource timeHier = (StringSource)
getMdmPrimaryDimension("TIME_AW").getDefaultHierarchy().getSource();
MdmLevelHierarchy mdmProdHier = (MdmLevelHierarchy)
mdmProdDim.getDefaultHierarchy();
// Get the Source for the default product hierarchy .
StringSource prodHier = (StringSource) mdmProdHier.getSource();
// Get the Source objects for the measure and for the default hierarchies
// of the other dimensions.
NumberSource units = (NumberSource) mdmUnits.getSource();
// Get the parent attribute of the PRODUCT dimension and the Source for it
// to use in the recursiveJoin method.
MdmAttribute mdmProdParentAttr = mdmProdHier.getParentAttribute();
Source prodParent = mdmProdParentAttr.getSource();