Below is the example of using the SetCube operation for adding a dimension to cube structure. The request contains cube moniker, the pattern indicating whether to add a dimension and updated metadata containing the added dimension. The response contains updated information about cube dimensions.
{
"SetCube" :
{
"tCube" :
{
"id" : "S1!M!S!C1"
},
"tArg" :
{
"pattern" :
{
"obInst" : "true",
"dims" : "Add"
},
"meta" :
{
"dims" :
{
"its" :
{
"it" :
[
{
"k" : "208",
"id" : "",
"n" : "",
"obDesc" :
{
"@isShortcut" : "false",
"@isLink" : "false",
"@hf" : "false",
"i" : "COUNTRIES",
"n" : "Countries",
"k" : "208",
"c" : "3076",
"p" : "159",
"h" : "false",
"hasPrv" : "false",
"ic" : "false"
}
}
]
}
}
},
"metaGet" :
{
"obInst" : "true",
"dims" : "Get"
}
}
}
}
{
"SetCubeResult" :
{
"id" :
{
"id" : "S1!M!S!C1"
},
"meta" :
{
"obInst" :
{
"obDesc" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "32",
"@hf" : "0",
"i" : "STD_CUBE",
"n" : "Cube",
"k" : "5857",
"c" : "1281",
"p" : "5845",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"isPermanent" : "1",
"isTemp" : "0"
}
},
"dirty" : "0",
"dims" :
{
"its" :
{
"it" :
[
{
"k" : "5858",
"id" : "FACTS",
"n" : "Facts",
"vis" : "1",
"obDesc" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "32",
"@hf" : "0",
"i" : "FACTS",
"n" : "Facts",
"k" : "5858",
"c" : "1028",
"p" : "5857",
"h" : "0",
"hasPrv" : "0",
"ic" : "0"
},
"aggsPresent" : "0",
"hierAggsPresent" : "0"
},
{
"k" : "112",
"id" : "CALENDAR",
"n" : "Calendar",
"vis" : "1",
"obDesc" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "6",
"@hf" : "0",
"i" : "CALENDAR",
"n" : "Calendar",
"k" : "112",
"c" : "1026",
"p" : "103",
"h" : "0",
"hasPrv" : "0",
"ic" : "0"
},
"aggsPresent" : "0",
"hierAggsPresent" : "0"
},
{
"k" : "116",
"id" : "DIM_1",
"n" : "Dim_1",
"vis" : "1",
"obDesc" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "3",
"@hf" : "0",
"i" : "DIM_1",
"n" : "Dim_1",
"k" : "116",
"c" : "1025",
"p" : "103",
"h" : "0",
"hasPrv" : "0",
"ic" : "0"
},
"aggsPresent" : "0",
"hierAggsPresent" : "0"
},
{
"k" : "991",
"id" : "DIM_2",
"n" : "Dim_2",
"vis" : "1",
"obDesc" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "0",
"@hf" : "0",
"i" : "DIM_2",
"n" : "Dim_2",
"k" : "991",
"c" : "1025",
"p" : "10529",
"h" : "0",
"hasPrv" : "0",
"ic" : "0"
},
"aggsPresent" : "0",
"hierAggsPresent" : "0"
},
{
"k" : "208",
"id" : "COUNTRIES",
"n" : "Countries",
"vis" : "1",
"obDesc" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "5",
"@hf" : "0",
"i" : "COUNTRIES",
"n" : "Countries",
"k" : "208",
"c" : "3076",
"p" : "159",
"h" : "0",
"hasPrv" : "0",
"ic" : "0"
},
"aggsPresent" : "0",
"hierAggsPresent" : "0"
}
]
}
},
"supportsRub" : "0"
}
}
}
public static SetCubeResult ChangeCubeStructure(CubeId moniker, Od newDim)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tSet = new SetCube()
{
tArg = new SetCubeArg()
{
//Pattern that indicates whether dimension should be added to cube
pattern = new CubeMdPattern()
{
dims = ListOperation.Add
},
//Updated metadata containing new dimension
meta = new CubeMd
{
dims = new CubeDims
{
its = new CubeDim[]
{
new CubeDim
{
k = newDim.k,
id = string.Empty,
n = string.Empty,
obDesc = newDim
}
}
}
},
metaGet = new CubeMdPattern()
{
dims = ListOperation.Get,
}
},
tCube = moniker
};
//Change cube structure
var result = somClient.SetCube(tSet);
return result;
}
See also: