Is it possible to add a calculated measure before activating PivotCube?
When I try to do this the calculated measure doesn't appeare in the PivotGrid.
Here is my code
- Code: Select all
var
mm : TMapMeasure;
FieldName : string;
begin
IQuery1.Open;
FieldName := 'F01';
mm := TMapMeasure.Create(PivotMap1);
mm.AliasName := FieldName;
mm.DisplayName := FieldName;
mm.FieldName := FieldName;
mm.CalcFormula :=
'begin ' +
' Result = "AMOUNTCL" + 100 ' +
' end ';
mm.IsCalculated := True;
mm.mType := mtCalculated;
mm.Visible := True;
mm.VisualIndex := -1;
PivotMap1.AddCalculatedMeasure(mm.AliasName,mm.CalcFormula);
PivotMap1.RefreshData(False);
PivotCube1.Active := true;
Thank you!