ValidationValuesByScenario: Boolean;
ValidationValuesByScenario: boolean;
The ValidationValuesByScenario property determines whether validation data can be saved or extracted in the scenarios dimension.
Available values:
True. Save or extract validation data in the scenarios dimension.
False. Save or extract actual data.
Executing the example requires that the repository contains a time series database with the OBJ_RUBRICATOR identifier. This database must contain a unique attribute of a factor with the COUNTRY identifier that refers to a dictionary. Add links to the Cubes, Matrix, Metabase, Orm, Rds system assemblies.
Sub UserProc;
Var
MB: IMetabase;
RubDesc: IMetabaseObjectDescriptor;
RubrIn: IRubricatorInstance;
Cub: ICubeInstance;
Dest: ICubeInstanceDestination;
FactorExec: IRubricatorFactorExecutor;
FactorIO: IRubricatorFactorIO;
FactsLookup: IRubricatorFactsLookup;
MetaDLookup: IMetaDictionaryLookup;
Key: Array Of Integer;
i: Integer;
Cond: IOrmCondition;
Exec: ICubeInstanceDestinationExecutor;
Mat: IMatrix;
Ite: IMatrixIterator;
Begin
MB := MetabaseClass.Active;
RubDesc := MB.ItemById("OBJ_RUBRICATOR");
RubrIn := RubDesc.Open(Null) As IRubricatorInstance;
Cub := RubrIn As ICubeInstance;
Dest := Cub.Destinations.DefaultDestination;
Exec := Dest.CreateExecutor;
FactorExec := Exec As IRubricatorFactorExecutor;
FactsLookup := RubrIn.CreateFactsLookup;
MetaDLookup := FactsLookup.Lookup;
Cond := MetaDLookup.Where.Add;
Cond.AttributeName := "COUNTRY";
Cond.Value := 512;
i := FactsLookup.LookupFactors.Length;
Key := New Integer[i];
Key := FactsLookup.LookupFactors;
FactorExec.SetFactorKeys(Key);
FactorIO := FactorExec As IRubricatorFactorIO;
FactorIO.ValueKind := MetaAttributeKind.Value;
FactorIO.ValueId := "VL";
FactorIO.MultipleFactors := True;
FactorIO.ValidationValuesByScenario := True;
FactorIO.ValidationExecKey := 1;
Exec := FactorExec.AsCubeExecutor;
Exec.PrepareExecute(Null);
Exec.PerformExecute;
Mat := Exec.Matrix;
Ite := Mat.CreateIterator;
Ite.Move(IteratorDirection.First);
While Ite.Valid Do
Debug.WriteLine(Ite.Value);
Ite.Move(IteratorDirection.Next);
End While;
End Sub UserProc;
On executing the example the console window displays data of validation factors with the 1 key in the scenarios dimension corresponding to the following condition: value of the COUNTRY attribute equals to 512.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Matrix;
Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Rds;
Imports Prognoz.Platform.Interop.Orm;
Imports Prognoz.Platform.Interop.ForeSystem;
…
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
RubDesc: IMetabaseObjectDescriptor;
RubrIn: IRubricatorInstance;
Cub: ICubeInstance;
Dest: ICubeInstanceDestination;
FactorExec: IRubricatorFactorExecutor;
FactorIO: IRubricatorFactorIO;
FactsLookup: IRubricatorFactsLookup;
MetaDLookup: IMetaDictionaryLookup;
Key: System.Array;
i: Integer;
Cond: IOrmCondition;
Exec: ICubeInstanceDestinationExecutor;
Mat: IMatrix;
Ite: IMatrixIterator;
Begin
MB := Params.Metabase;
RubDesc := MB.ItemById["OBJ_RUBRICATOR"];
RubrIn := RubDesc.Open(Null) As IRubricatorInstance;
Cub := RubrIn As ICubeInstance;
Dest := Cub.Destinations.DefaultDestination;
Exec := Dest.CreateExecutor();
FactorExec := Exec As IRubricatorFactorExecutor;
FactsLookup := RubrIn.CreateFactsLookup();
MetaDLookup := FactsLookup.Lookup;
Cond := MetaDLookup.Where.Add();
Cond.AttributeName := "COUNTRY";
Cond.Value := 512;
i := FactsLookup.LookupFactors().Length;
Key := New Integer[i];
Key := FactsLookup.LookupFactors();
FactorExec.SetFactorKeys(Key);
FactorIO := FactorExec As IRubricatorFactorIO;
FactorIO.ValueKind := MetaAttributeKind.meakValue;
FactorIO.ValueId := "VL";
FactorIO.MultipleFactors := True;
FactorIO.ValidationValuesByScenario := True;
FactorIO.ValidationExecKey := 1;
Exec := FactorExec.AsCubeExecutor();
Exec.PrepareExecute(Null);
Exec.PerformExecute(False);
Mat := Exec.Matrix;
Ite := Mat.CreateIterator();
Ite.Move(IteratorDirection.itdFirst);
While Ite.Valid Do
System.Diagnostics.Debug.WriteLine(Ite.Value);
Ite.Move(IteratorDirection.itdNext);
End While;
End Sub;
See also: