开发者

SSAS cube creation question - parent/child relationship

开发者 https://www.devze.com 2023-01-08 20:21 出处:网络
I\'m currently struggling with the creation of a cube. Below is a simplified version of my relational data...

I'm currently struggling with the creation of a cube.

Below is a simplified version of my relational data...

Race

Id  Type  Total 
1   A     3 
2   A     2

Result

Id  RaceId  Gender  Position
1   1       M       2
2   1       M       3
3   1       F       1
4   2       F       2
5   2       F       1

In some kind of pusedo language I would like to be able to run this query:

SELECT Sum(Total), Sum(Position) WHERE RaceType = A AND Gender = M

And I would expect to get the results: 开发者_高级运维3, 5

I have tried a couple of different configurations of dimensions and measures but always end up with the answer 5, 5.

I'm sure this is possible to achieve with the cube, I just don't currently have the knowledge to figure it out - any help would be appreciated.

Thanks


Not currently being able to see the dimensions/measures present in your cube, it would be roughly

SELECT
{
   [Measures].[Total],
   [Measures].[Position]
}
ON 0
FROM [YourCube]
WHERE(
  [Race].[RaceType].[A],
  [Result].[Gender].[M]
)

This is assuming you've chosen the default aggregation for your measures, which is SUM.

0

精彩评论

暂无评论...
验证码 换一张
取 消