SSAS 中两个维度之间的关系

发布于 2024-12-18 15:17:39 字数 381 浏览 3 评论 0原文

我正在开发一个 ssas 数据库,并且有雪花维度,它有链接。例如,我有一个客户维度表、经销商维度表和一个区域维度表,其中其他两个维度表与后者之间存在关系。因此我可以将关系说明如下:

零售商 <-- 领土 分发者 <-- 区域

在数据库中的特定多维数据集中,我有与上述所有三个维度都有关系的度量。就这些措施而言,跨各个维度的浏览会顺利进行。

但当我尝试同时从两个维度浏览相关度量时,问题就出现了;例如:地区和分销商

所有分销商均显示在给定地区下。

当我将区域关键属性添加到分销商维度并且从分销商维度使用该特定属性时,它本身的关系会正确显示。但是,当我尝试从立方体中的领土维度出发时,这种关系不会像前面所解释的那样暴露出来。

非常感谢任何帮助。

I am developing an ssas database and have snowflaked dimensions to which it has links. For example I have a customer dimension table, distributor dimension table and a territory dimension table in which there is a relationship to the latter from the other two. Therefore I can illustrate the relationships as follows:

Retailer <-- Territory
Distributor <-- Territory

In a specific cube in the database, I have measures where all the three dimensions mentioned above have relationships to. As far as the measures are considered browsing across individual dimensions happen smoothly.

But the problem comes when I try to browse a related measure from two dimensions at the same time; eg: territory and distributor

All the distributors are shown under a given territory.

When I add the territory key attribute to the distributor dimension and that specific attribute is used from the distributor dimension it self the relationship is shown correctly. But when I try to go from the territory dimension in the cube this relationship does not get exposed as explained earlier.

Any help is deeply appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

So要识趣 2024-12-25 15:17:39

这可能无法直接回答您的问题,但如果您有几个密切相关且经常一起使用的维度,您可以将它们合并为一个“迷你维度" 拥有所有可能的地区、分销商和零售商组合(请参阅我对 另一个问题):

create table dbo.DIM_TerritorySalesChannels (
   TerritorySalesChannelID int not null primary key,
   TerritoryName nvarchar(100) not null,
   RetailerName nvarchar(100) not null,
   DistributorName nvarchar(100) not null,
   /* other attributes */
)

这最初可能看起来很尴尬,但实际上很容易填充并且 管理 它避免了维度之间关系的复杂性,这通常会变得混乱(正如您所发现的)。显然,您最终会得到一个非常大的维度,而不是三个较小的维度,但正如我在另一个答案中提到的,我们在一维中有数十万行,这对我们来说从来都不是问题。

This may not answer your question directly, but if you have several dimensions that are closely related and often used together, you could consolidate them into a "mini-dimension" that has every possible combination of territory, distributor and retailer (see my answer to another question):

create table dbo.DIM_TerritorySalesChannels (
   TerritorySalesChannelID int not null primary key,
   TerritoryName nvarchar(100) not null,
   RetailerName nvarchar(100) not null,
   DistributorName nvarchar(100) not null,
   /* other attributes */
)

This might initially seem awkward, but it's actually quite easy to populate and manage and it avoids the complexity of relationships between dimensions, which often gets messy (as you've discovered). Obviously you end up with one very large dimension instead of three smaller ones, but as I mentioned in the other answer, we have several hundred thousand rows in one dimension and it's never been an issue for us.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文