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())