简体   繁体   English

SSAS - 如何创建地理维度?

[英]SSAS - How to create a geographical dimension?

I'm working on a SQL Server Analysis Services multidimensionnal cube. 我正在研究SQL Server Analysis Services多维度多维数据集。 I want to create a geaographical dimension to allow user to explore the data regarding to a specific country, region, department, city, store. 我想创建一个地理维度,以允许用户浏览有关特定国家,地区,部门,城市,商店的数据。

Country > Region > Department > City > Store > Sale

So I created a new dimension by selecting the Sale table including all cascading dependencies. 所以我通过选择Sale表创建了一个新维度,包括所有级联依赖项。 Then, I dragged items'name to create a hierachy as the screen capture bellow explains. 然后,我拖动了items'name来创建一个层次结构,因为屏幕截图下面会解释。

在此输入图像描述

This is the diagram of all relationships between attributes. 这是属性之间所有关系的图表。 在此输入图像描述

Finally, after processing I can browse the dimension. 最后,经过处理后我可以浏览维度。 However, there is something that scaring me, I can't browse stores, there are only country, region, department and city nodes. 然而,有些东西吓到我,我无法浏览商店,只有国家,地区,部门和城市节点。 So how to configure to display stores ? 那么如何配置显示商店?

在此输入图像描述

Is there a way to display only branches containing stores because it's not relevant to display 36 000 cities for only 80 stores. 有没有办法只显示包含商店的分店,因为只与80家商店展示36 000个城市无关。

As you can seen, there are three warnings : 如您所见,有三个警告:

Avertissement   10  AttributeRelationship [DimStore].[Sale].[Id_] : Le nom spécifié pour la relation d'attribut diffère du nom de l'attribut associé.       0   0   
Avertissement   11  AttributeRelationship [DimStore].[Store].[Name_] : Le nom spécifié pour la relation d'attribut diffère du nom de l'attribut associé.        0   0   
Avertissement   12  Dimension [DimStore] : Éviter les hiérarchies d'attributs visibles pour les attributs utilisés comme niveaux dans les hiérarchies définies par l'utilisateur.       0   0   

Any idea to solve that ? 有什么想法解决这个问题?

I would flatten all those tables into one using a SQL view or ETL into a Dimension table. 我会使用SQL视图或ETL将所有这些表拼成一个到Dimension表中。 Then I would add that to the Data Source View, then painfully repoint each attribute at that. 然后我将它添加到数据源视图,然后痛苦地重新指定每个属性。 This gives you the opportunity to shape the data to suit SSAS. 这使您有机会塑造数据以适应SSAS。

I would also return the Attribute Relationships to their original state - all related directly to the Key attribute. 我还将属性关系返回到其原始状态 - 所有这些都直接与Key属性相关。 There is little benefit in arranging them hierarchically and it relies on the input data being perfectly structured now and into the future. 按层次排列它们几乎没有什么好处,它依赖于输入数据现在和未来的完美结构。

使用数据库中的视图限制具有存储的城市以及mike建议的展平数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM