ChildRubricator: IRubricator;
The ChildRubricator property returns the child time series database.
The temporary database is created if the child time series database is missing. Bindings are saved into the source cube but not into the time series database when saving.
Executing the example requires that the repository contains a standard cube with the STD_CUBE identifier.
Add links to the Metabase, Cube, Rds system assemblies.
// Data output function
Function ToString(Value: Variant): String;
Var
sRes: String;
i, l, idx: integer;
s: String;
arr: Array Of Variant;
Begin
Select Case Value.VarType
Case ForeVariantType.Integer:
i := Value;
sRes := i.ToString;
Case ForeVariantType.Matrix:
arr := Value As Array Of Variant;
l := arr.Length - 1;
For idx := 0 To l Do
s := s + ToString(arr[idx]) + "; ";
End For;
sRes := s;
End Select;
Return sRes;
End Function ToString;
// Main procedure
Sub UserProc;
Var
mb: IMetabase;
Cube: IStandardCube;
Rub: IMetabaseObject;
RubI: IRubricatorInstance;
Key: Array[2];
FactD: IRubricatorFactData;
FactVal: IFactorObservationValues;
i: Integer;
Mem: IMetaDataMember;
Begin
mb := MetabaseClass.Active;
// Get cube
Cube := mb.ItemById("STD_CUBE").Bind As IStandardCube;
// Get child time series database
Rub := Cube.ChildRubricator As IMetabaseObject;
If Rub <> Null Then
RubI := Rub.Open(Null) As IRubricatorInstance;
Key[0] := 512;
Key[1] := 1009;
// Get time series by composite key value
FactD := RubI.GetCompoundFactData(Key);
// Display data about time series
If FactD <> Null Then
Debug.WriteLine("____________");
Debug.WriteLine("Mnemo:" + FactD.Mnemo);
Debug.WriteLine("Key: " + FactD.FactorKey.ToString);
Debug.WriteLine("IsDeleted: " + FactD.IsDeleted.ToString);
Debug.WriteLine("IsEmpty: " + FactD.IsEmpty.ToString);
Debug.WriteLine("UseCompoundKey: " + FactD.UseCompoundKey.ToString);
Debug.WriteLine("CompoundKey: " + ToString(FactD.CompoundKey));
Debug.WriteLine("CompoundFactorKey: " + ToString(FactD.CompoundFactorKey));
Debug.WriteLine("____________");
// Display data about time series observations
For i := 1980 To 2012 Do
FactVal := RubI.GetObservationValues(FactD, DateTime.ComposeDay(i, 1, 1));
If FactVal <> Null Then
Debug.WriteLine("Date: " + DateTime.ComposeDay(i, 1, 1).ToString);
Debug.WriteLine("FactDataCompoundKey: " + ToString(FactVal.FactDataCompoundKey));
Mem := FactVal.Record.Members.FindByKind(MetaAttributeKind.Value);
Debug.WriteLine("Value: " + ToString(Mem.Value));
Debug.WriteLine("----");
End If;
End For;
End If;
End If;
End Sub UserProc;
After the basic procedure is executed, the console window displays the data of time series and its observations that is obtained by the composite key value.
See also: