JoinList: IVirtualCubeDimensionJoinList;
JoinList: Prognoz.Platform.Interop.Cubes.IVirtualCubeDimensionJoinList;
The JoinList property returns the list of comparisons of dimensions of the current source with dimensions of other sources.
By default, dimensions of different sources of virtual cube are not compared with each other. The virtual cube contains dimensions common for all dimension sources, and unique dimensions form a composite dimension. The composite dimension contains the elements, which are fixed in unique dimensions.
Comparison enables the user to link unique dimensions of different sources. After comparison, unique dimensions can be unfixed. In this case the virtual cube uses dimension of the current source cube. On changing the selection, this dimension will be used to compare elements and create selection for unique dimensions of other source cubes.
Executing the example requires that the repository contains a virtual cube with the V_Cube identifier. The virtual cube is built on two cubes:
The first cube stores various information of countries , the cube structure has a dimension with the COUNTRY identifier. The dimension structure has the ISO unique index created by the attribute, which stores ISO code of country.
The second cube stores information of country capitals, the cube structure has a dimension with the CAPITAL identifier. The dimension structure has the COUNTRY_ISO unique index created by the attribute with ISO codes of countries, to which each of capitals corresponds.
Sub UserProc;
Var
MB: IMetabase;
Cube: IVirtualCube;
VSource: IVirtualCubeSource;
JoinList: IVirtualCubeDimensionJoinList;
Joins: IVirtualCubeDimensionJoins;
Dim: IDimensionModel;
Index: IDimIndex;
Begin
MB := MetabaseClass.Active;
Cube := MB.ItemByID("V_Cube").Edit As IVirtualCube;
//First source
VSource := Cube.Sources.Item(0);
Dim := VSource.Cube.Dimensions.FindById("COUNTRY");
Index := Dim.Indexes.FindById("ISO");
JoinList := VSource.JoinList;
Joins := JoinList.Add(Dim, Index);
//Second source
VSource := Cube.Sources.Item(1);
Dim := VSource.Cube.Dimensions.FindById("CAPITAL");
Index := Dim.Indexes.FindById("COUNTRY_ISO");
Joins.Add(VSource, Dim, Index);
//Unfix dimension
VSource.FixInfo.Item(1).Fixed := False;
(Cube As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the COUNTRY dimension is compared with the CAPITAL dimension, elements of these dimensions are compared by values of attributes with ISO codes of countries. On opening the cube the selection is set in the COUNTRY dimension, after which the corresponding selection is formed and passed to the CAPITAL dimension.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.Metabase;
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Cube: IVirtualCube;
VSource: IVirtualCubeSource;
JoinList: IVirtualCubeDimensionJoinList;
Joins: IVirtualCubeDimensionJoins;
Dim: IDimensionModel;
Index: IDimIndex;
Begin
MB := Params.Metabase;
Cube := MB.ItemById["V_Cube"].Edit() As IVirtualCube;
//First source
VSource := Cube.Sources.Item[0];
Dim := VSource.Cube.Dimensions.FindById("COUNTRY");
Index := Dim.Indexes.FindById("ISO");
JoinList := VSource.JoinList;
Joins := JoinList.Add(Dim, Index);
//Second source
VSource := Cube.Sources.Item[1];
Dim := VSource.Cube.Dimensions.FindById("CAPITAL");
Index := Dim.Indexes.FindById("COUNTRY_ISO");
Joins.Add(VSource, Dim, Index);
//Unfix dimension
VSource.FixInfo.Item[1].Fixed := False;
(Cube As IMetabaseObject).Save();
End Sub;
See also: