日期:2014-05-17  浏览次数:20617 次

如何使用ssas的渐变维


/* id 主键
   names 组织架构名称 */
create table zo(id int identity(1,1) primary key not null,names varchar(50) null)
insert zo 
select '华北区' union all
select '华南区'

/* id 主键
   names 人员姓名
   zoid 组织架构ID */
create table za(id int identity(1,1) primary key not null,names varchar(50) null,zoid int null)
insert za 
select 'admin',1 union all
select 'robay',1 union all
select 'emmy',1 union all
select 'alex',2 union all
select 'linda',2  
/* id 主键
   zaid 人员ID
   zoid 组织架构ID
   num 销量 */
create table zb(id int identity(1,1) primary key not null,zaid int null,zoid int null,num int null,dates datetime null)
insert zb
select 1,1,109,'2011-05-15' union all
select 1,1,258,'2011-05-15' union all
select 1,2,300,'2011-05-16' union all

需求:
1. zo:组织架构表  za:人员表  zb:订单表
2. 如果人员 admin 5.15号是华北区,5.16号调到华南区,查询5月份华北区也要看到admin的销量,华南区也要看到admin的销量。

需要用sql server analysis service的cube来实现。需要知道具体的建ssas的过程。
vs2005中没有 维度属性关系 这个tab页签
vs2008中有。
谢谢!!
------最佳解决方案--------------------
维表加 代理键,有效开始日期,有效结束日期。
事实表 与 维表 用 代理键 关联。
那么 ssas如何建立cube呢?
------其他解决方案--------------------

不,懂;帮,顶;学,习;赚,分。
虽然这么回贴可能会被删除。
谁他妈的删除了就是个王八蛋。
强烈抗议CSDN这种即当婊子又立贞洁牌坊的恶劣行为!!!
有本事,就封杀我!!!

理由在这里:
他妈的一帮管理员有神经病啊???
http://topic.csdn.net/u/20110422/10/1a381057-7a7b-41d9-8969-ad1f5b77f24a.html?38665



------其他解决方案--------------------
该回复于2011-05-05 08:58:35被版主删除
------其他解决方案--------------------
确实有点麻烦。。。
------其他解决方案--------------------
网上说 把维表加上 有效开始日期 有效结束日期 。那么ssas的cube要如何实现呢??
------其他解决方案--------------------
网上说 把维表加上 有效开始日期 有效结束日期 。那么ssas的cube要如何实现呢??
------其他解决方案--------------------
在http://topic.csdn.net/u/20101008/15/505e0e0a-5651-404e-b435-13b3cc1f5718.html?seed=1067968344&r=73138755#r_73138755看到您回复的内容,在ssas的cube中,如何能 根据时间between and去新建关系?
如下建表后,ssas如何建cube?   期待您的解答。谢谢!! emmylee001@126.com

-- 维表
create table zu(
id int identity(1,1) primary key not null,
uids int null,-- 用户ID
uidsversion int null, -- 联合键
names varchar(50) null, -- 用户姓名
beginDate datetime null, -- 有效开始日期
endDate datetime null -- 有效结束日期
)
go
insert zu
select 1,101,'admin','2011-01-01','2011-01-15' union all
select 1,102,'admin','2011-01-15','2011-01-29'
go
-- 事实表
create table zf(
id int identity(1,1) primary key not null,
uids int null,-- 用户ID