AMO を使用すると、喜んで 2 次元属性の存在を確認できます。関係を築きたい。次の (結果) は結果コード 0 を返しますが、キューブを処理した後は関係がありません。提案?
// confirm db exists
db = objServer.Databases.FindByName(strCubeDBName);
// find the dimension
string dimName = "Product";
Dimension dim = db.Dimensions.FindByName(dimName);
attrSource = dim.Attributes.FindByName("Spanish Product Subcategory Name");
if (attrSource != null)
Console.WriteLine(attrSource + " - source attribute exists");
else
throw new Exception(attrSource + " - source attribute does not exist");
attrRelated = dim.Attributes.FindByName("French Product Subcategory Name");
if (attrRelated != null)
Console.WriteLine(attrRelated + " - Related attribute exists");
else
throw new Exception(attrRelated + " - Related attribute does not exist");
int result;
result = attrSource.AttributeRelationships.Add(new AttributeRelationship(attrRelated));
Console.WriteLine(result);
dim.Process(ProcessType.ProcessUpdate);