Adding calculated measure before activating PivotCube

Discussion forum for PivotCube VCL users. Common questions. Bug and problem reports

Moderator: Alex Zencovich

Adding calculated measure before activating PivotCube

Postby skatty » Thu Jan 25, 2018 9:42 am

Hello!
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!
skatty
Guest
 
Posts: 1
Joined: Mon Jan 22, 2018 11:28 am

Re: Adding calculated measure before activating PivotCube

Postby AlexZencovich » Tue Jan 30, 2018 2:28 am

No.
Best regards,

Alex Zencovich
-------------------------------------------------------------------------------------------------------------------------------------------
www.pivotcube.com - OLAP solution for Delphi, C++ Builder and ActiveX environment
AlexZencovich
Site Admin
 
Posts: 580
Joined: Sun Jun 18, 2006 10:09 am


Return to PivotCube VCL

Who is online

Users browsing this forum: No registered users and 6 guests

cron