var myMap: TCubeDims;
nCount: integer; // used in step 3
//DecisionCube1 and IBQuery1 are components on your form. DecisionCube1 is a TDecisionCube,
and IBQuery1 is a TIBQuery, or other TDataset descendant.
with myMap do
begin
// Part A: Configure dimensions
for nCount := 0 to [Number of Dimensions - 1] do
begin
Items[nCount].DimensionType := dimDimension;
Items[nCount].BaseName := 'TABLE.FIELDNAME';
//If the dimension is a date and should be grouped, use this code
Items[nCount].FieldType:=ftDateTime;
Items[nCount].BinType:=binYear
{or}
Items[nCount].BinType:=binQuarter
{or}
Items[nCount].BinType:=binMonth
Items[nCount].BinFormat:='mm/dd/yyyy';
Items[nCount].StartValue:=BaseDate;
//If the dimension is not a date, or is a date but should not be grouped,use this code
Items[nCount].BinType:=binNone;
end;
// Part B: Configure summaries
for nCount:=[Number of Dimensions] to [Number of Fields-1] do
Items[nCount].DimensionType := dimCount;
end;
// And finally, apply the new dimension map
DecisionCube1.Refresh(myMap, true); finally
myMap.Free
end;