包含“总计”的度量名称在立方体中有奇怪的总计计算
在使用 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())
In programmatically building cubes for SQL Server Analysis Services using AMO, I've discovered that when a measure has "Total" in it's title, the grand total in the cube is calculated by a distinct sum instead of just a sum (creating very strange results)
This doesn't occur when building cubes using DSO. Does anyone know of why this could be happening?
Please pardon my use of 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())
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事情是这样的。 AMO 将数据列标记为名称中包含 Total 的任何内容的字节。它循环到 32,令人惊讶的是,这个数字与列上的不同总和相同......哇。
Here's what was going on. AMO was tagging the datacolumn as byte for anything with Total in the name. It was cycling to 32 which amazingly was the same number as a distinct sum on the column... Wow.