0

我正在 MicroStrategy 中进行培训,我正在练习使用具有 3 个属性的输出级别创建过滤器:国家、产品和年份,以及来自 FactResellerSales 的一个度量和 OrderQuantity,该度量作为报表过滤器,产品和年份属性的输出级别仅而不是按国家/地区汇总。

但是,我得到的一组数字与书中给出的完全不同,我不知道我做错了什么。我可以看到,从报告中完全删除国家属性可以提供准确的数据集,就本书中显示的内容而言。下面是我在 SQL 视图中看到的内容。请帮助我了解此报告中可能出现的问题。

select  a11.ProductKey  ProductKey,
    a12.CalendarYear  CalendarYear
into ##T3X3AC0ARMQ000
from    FactResellerSales   a11
    join    DimDate a12
      on    (a11.OrderDateKey = a12.DateKey)
group by    a11.ProductKey,
    a12.CalendarYear
having  sum(a11.OrderQuantity) > 1000.0 

Pass1 -     Query Execution:    0:00:21.04
    Data Fetching and Processing:   0:00:00.00
      Data Transfer from Datasource(s): 0:00:00.00
    Other Processing:   0:00:00.03
    Rows selected: 210


select  a11.ProductKey  ProductKey,
    max(a15.EnglishProductName)  EnglishProductName,
    a12.CountryRegionCode  CountryRegionCode,
    max(a12.EnglishCountryRegionName)  EnglishCountryRegionName,
    a13.CalendarYear  CalendarYear,
    sum(a11.OrderQuantity)  WJXBFS1
from    FactResellerSales   a11
    cross join  DimGeography    a12
    join    DimDate a13
      on    (a11.OrderDateKey = a13.DateKey)
    join    ##T3X3AC0ARMQ000    pa14
      on    (a11.ProductKey = pa14.ProductKey and 
    a13.CalendarYear = pa14.CalendarYear)
    join    DimProduct  a15
      on    (a11.ProductKey = a15.ProductKey)
group by    a11.ProductKey,
    a12.CountryRegionCode,
    a13.CalendarYear

Pass2 -     Query Execution:    0:00:00.00
    Data Fetching and Processing:   0:00:00.00
      Data Transfer from Datasource(s): 0:00:00.00
    Other Processing:   0:00:00.00
[Populate Report Data]

Pass3 -     Query Execution:    0:00:00.00
    Data Fetching and Processing:   0:00:00.00
      Data Transfer from Datasource(s): 0:00:00.00
    Other Processing:   0:00:00.02

drop table ##T3X3AC0ARMQ000
4

1 回答 1

1

当然,当您将国家属性放入时,您会遇到奇怪的数据:这个克里特岛是与地理的交叉连接。我不知道为什么,因为我不知道您的数据集市的架构,但我会说看起来 DimGeography 不在您的事实表中;至少不是直接的。创建重复层次结构很常见,因此您可能有 SalesGeography。

如果您给我更多详细信息,我可以为您提供更多帮助。

于 2015-04-19T21:28:29.717 回答