我正在尝试在Carrier维度上创建一个非常简单的地理层次结构。我的数据是这样的:
开利城州国家
Carrier A | Chicago | IL | USA
Carrier B | Aurora | IL | USA
Carrier C | Stockton | CA | USA
Carrier D | Winnipeg | MB | Canada
Carrier E | Richmond | BC | Canada
Carrier F | Valparaiso| ZAC| Mexico
Carrier G | Veracruz | VER |Mexioc
我的层次结构定义为
Country
State
City
Carrier
属性关系:
Carrier --> City Name --> State Name --> Country
我希望浏览器按如下方式显示层次结构:
USA
IL
Chicago
Carrier A
Aurora
Carrier B
CA
Stockton
Carrier C
Canada
MB
Winnipeg
Carrier D
BC
Richmond
Carrier E
Mexico
ZAC
Valparaiso
Carrier F
VER
Veracruz
Carrier G
而是重复层次结构中的每个级别:
USA
IL
Chicago
Carrier A
USA
IL
Aurora
Carrier B
USA
CA
Stockton
Carrier C
Canada
MB
Winnipeg
Carrier D
Canada
BC
Richmond
Carrier E
Mexico
ZAC
Valparaiso
Carrier F
Mexico
VER
Veracruz
Carrier G
答案 0 :(得分:0)
我做了同样的事情,一切都按预期工作:
create table Carrier (Carrier varchar(100),City varchar(100),State varchar(100),Country varchar(100))
insert Carrier (Carrier,City,State,Country)
select 'Carrier A','Chicago','IL','USA' union all
select 'Carrier B','Aurora','IL','USA' union all
select 'Carrier C','Stockton','CA','USA' union all
select 'Carrier D','Winnipeg','MB','Canada' union all
select 'Carrier E','Richmond','BC','Canada' union all
select 'Carrier F','Valparaiso','ZAC','Mexico' union all
select 'Carrier G','Veracruz','VER','Mexico'
和SSAS结构:
请检查下一步: