Executing the example requires that the repository contains a workbook with the OBJ123 identifier in which series are grouped. A time series database used to create the workbook must contain an attribute with the TERRID identifier, one of its values must be 1.
Add links to the following system assemblies:
Cubes.
Express.
Laner.
Metabase.
Rds.
Sub UserProc;
Var
MB: IMetabase;
CrInfo: IMetabaseObjectCreateInfo;
MObj: IMetabaseObject;
Exp: IEaxAnalyzer;
WB: ILaner;
TSDB: IRubricator;
MetaAtt: IMetaAttribute;
AttrVals: ILanerMetaAttributeValues;
AttrVal: ILanerMetaAttributeValue;
GroupSer: ILanerGroupSerie;
Begin
MB := MetabaseClass.Active;
//Open a workbook to edit
MObj := MB.ItemById("OBJ123").Edit;
Exp := MObj As IEaxAnalyzer;
//Return the workbook
WB := Exp.Laner;
WB.BeginUpdate;
//Return the database used to create the workbook
TSDB := WB.RubricatorInstance.Rubricator;
//Create collection of attributes' values
AttrVals := WB.Series.CreateMetaAttributeValues;
//Get attribute with the defined identifier the time database
MetaAtt := TSDB.Facts.Attributes.FindById("TERRID");
//Add the attribute to collection of attributes
AttrVal := AttrVals.Add(MetaAtt);
//Set attribute value
AttrVal.Value := 1;
//Add a group of series in which the value of the TERRID attribute is 1
GroupSer := WB.Series.AddGroupSerie(TSDB, AttrVals);
//Expand the group of series
GroupSer.Expanded := True;
WB.EndUpdate;
MObj.Save;
End Sub UserProc;
After executing the example a new group of series is added to the workbook. The group includes the series, in which the COUNTRY attribute value is 512. The group is expanded.
See also:
Examples | ILaner | ILanerMetaAttributeValue | ILanerMetaAttributeValues | ILanerGroupSerie