// Get the Source for the product dimension.
Source prodStdDim = mdmProdStdDim.getSource();
// Get the marketing manager attribute and the Source for it.
MdmAttribute mdmMktMngrAttr = getContext().getAttributeByName(mdmProdStdDim,
"MARKETING_MANAGER_AW");
Source mktMngrAttr = mdmMktMngrAttr.getSource();
// Get the default hierarchies of the dimensions and the Source objects
// for them.
MdmLevelHierarchy mdmCalendar = (MdmLevelHierarchy)
mdmTimeDim.getDefaultHierarchy();
MdmLevelHierarchy mdmProdHier = (MdmLevelHierarchy)
mdmProdStdDim.getDefaultHierarchy();
MdmLevelHierarchy mdmChanHier = (MdmLevelHierarchy)
mdmChanDim.getDefaultHierarchy();
MdmLevelHierarchy mdmShipHier = (MdmLevelHierarchy)
mdmCustDim.getDefaultHierarchy();
StringSource calendar = (StringSource) mdmCalendar.getSource();
StringSource prodHier = (StringSource) mdmProdHier.getSource();
StringSource chanHier = (StringSource) mdmChanHier.getSource();
StringSource shipHier = (StringSource) mdmShipHier.getSource();
// Get the placeholder Source for the Number data type.
Source ph = dp.getFundamentalMetadataProvider()
.getNumberPlaceholder()
.getSource();
// Get the level to which the dimension members belong.
MdmLevel mdmItemLevel = getContext().getLevelByName(mdmProdHier,
"ITEM_AW");
// Get the Source for the ITEM level.
Source itemLevel = mdmItemLevel.getSource();
// Select the members of the level that are managed by a marketing manager.
Source prodForManager = itemLevel.join(mktMngrAttr, "Jackson");
// Get the short value description attribute for Product and the Source
// for it.
MdmAttribute mdmProdShortDescr =
mdmProdStdDim.getShortValueDescriptionAttribute();
Source prodShortDescr = mdmProdShortDescr.getSource();
// Create the calculation Source, which specifies the aggregation of
// the selected products.
Source calc = ((NumberSource)
(ph.join(prodHier,