2011-02-16 18 views
1

在以編程方式爲使用AMO的SQL Server Analysis Services構建多維數據集時,我發現當度量標題中包含「總計」時,多維數據集中的總計是由一個明顯的總和而不是僅僅一個和來計算的(創建非常奇怪的結果)包含「總計」的度量名稱在多維數據集中有奇怪的總計算

使用DSO構建多維數據集時不會發生這種情況。有誰知道爲什麼會發生這種情況?

請原諒我使用Python的:

class MeasureSpec(MeasureSpec): 
    def create(self, measureGroup, cube, dsv, factTable): 
     log("creating measure:", self.name) 
     measure = measureGroup.Measures.Add(self.name) 
     measure.AggregateFunction = self.aggregateFunction 
     measure.FormatString = self.format 
     # Set datatype to integer for counts otherwise this is set to the same 
     # type as the source column in createDataItem 
     if self.aggregateFunction in (aggCount, aggDistinctCount): 
      measure.DataType = MeasureDataType.Integer 
     measure.Visible = self.isVisible 
     measure.Source = createDataItem(dsv, factTable, self.column.getColumnName()) 

回答

1

這裏是發生了什麼事情。 AMO將數據列標記爲任何名稱中包含Total的字節。這是騎自行車到32,這驚人的是相同的數字作爲一個明顯的總和列...哇。