如果数据条件处于活动状态,我有每个月都会滚动的数据。下面是示例
源数据:
DID YearMonth Createddatekey count
a 201307 20130701 1
b 201307 20130701 1
a 201308 20130701 1
b 201308 20130701 1
c 201308 20130801 1
所需输出:
预期的
output
Yearmonth Count
201307 2
201308 1
只需添加如下条件,我就可以在 SQL 中得到结果。
select Createdatekey,count(*) from table with (nolock)
Where Createdatekey>=20130701 and YearMonth=201307
Group by Createdatekey
但是,当我通过加入 Createdatekey 在 Datedimension 中创建层次结构时,它会给出组合结果,而不考虑月份。
如何实现我在 SSAS 多维数据集模型中编写的 SQL 条件?