我正在进行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发布于 2015-04-20 05:28:30
当然,当你输入国家属性时,你会有奇怪的数据,但是:这是一个与地理交叉连接的克里特岛。我不能准确地知道原因,因为我不知道您的数据集市的模式,但是我想说看起来DimGeography不在您的事实表中;至少不是直接的。创建重复的层次结构是很常见的,因此您可能会有SalesGeography。
如果你给我更多的细节,我可以帮你更多。
https://stackoverflow.com/questions/24591008
复制相似问题