ICubeCacheUpdateScheduledTask.LoadSelection

Syntax

LoadSelection(Value: IDimSelectionSet): IDimSelectionSet;

Parameters

Value. Empty selection of the source cube, to which the selection will be loaded, according to which data cache is updated.

Description

The LoadSelection method copies the selection, according to which data cache is updated.

Example

Executing the example requires a scheduled task of cache update for the calculated cube. The task has the SCHEDULED_TASK identifier and it has the selection, by which the cube cache should be updated.

Sub UserProc;
Var
    Metabase: IMetabase;
    CubeIns: ICubeInstance;
    CubInDes: ICubeInstanceDestination;
    MObj: IMetabaseObject;
    ScheduledTask: ICubeCacheUpdateScheduledTask;
    DimSS: IDimSelectionSet;
    DimS: IDimSelection;
Begin
    Metabase := MetabaseClass.Active;
    MObj := Metabase.ItemById("SCHEDULED_TASK").Edit;
    ScheduledTask := MObj As ICubeCacheUpdateScheduledTask;
    CubeIns := (ScheduledTask.SourceCube As IMetabaseObject).Open(NullAs ICubeInstance;
    CubInDes := CubeIns.Destinations.FindByKey(ScheduledTask.DestKey);
    DimSS := CubInDes.CreateDimSelectionSet;
    //Copy selection already set for the task
    DimSS := ScheduledTask.LoadSelection(DimSS);
    //Change selection
    For Each DimS In DimSS Do
    DimS.InvertAll;
    End For;
    //Set new selection
    ScheduledTask.SetSelection(DimSS);
    MObj.Save;
End Sub UserProc;

After executing the example the specified selection will be loaded from the scheduled task and replaced with the new one.

See also:

ICubeCacheUpdateScheduledTask