SSAS - 在一段时间内发生的事实 [英] SSAS - Facts that happened over a time range

查看:174
本文介绍了SSAS - 在一段时间内发生的事实的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的不知道如何处理一段时间内发生的事情。我自己处理在特定日期发生的事实。

I don't really know how to handle facts that happened over a period of time. I sually deal with facts that happened on a specific date.

很清楚,我的事实有一个start_date和一个end_date。因此,让我的start_date是01/01/2008,我的end_date是01/01/2011。我需要得到2009年发生的事实和今年发生的事实。同样的事实可能发生在两年。

In clear, my facts have a start_date and an end_date. So, let's say my start_date is 01/01/2008 and my end_date is 01/01/2011. I need to get the number of those facts that happened in 2009 and those that happened this year. The same fact can have happened on both years. The way to determine a fact is part of 2009 is to check for 12/31/2009.

我正在考虑一个StartDate和EndDate维度,使用日期范围(因此,从我的StartDate维度的第一个日期到12/31/2009和从12/31/2009到我的EndDate维度中的最后一个日期)。我会交叉加入那些。

I was thinking about a StartDate and EndDate dimensions, using date ranges (so from the first date of my StartDate dimension to 12/31/2009 and from 12/31/2009 to the last date in my EndDate dimension). I would cross join those.

我试过,它的工作,但它真的很慢。

I tried it, it works, but it's REALLY slow.

任何想法?

推荐答案

通缉。大卫和克里斯的肛门tho!这里是我想实现,但我缺乏MDX语法:

I found the solution to what I wanted. David and Chris for the anwsers tho! Here's what I wanted to achieve, but I was lacking MDX syntax :

SELECT  [Measures].[NumberX] ON COLUMNS
FROM    [MyCube]
WHERE   ([START DATE].[REFDATE].FirstMember:[START DATE].[REFDATE].&[2009-12-31T00:00:00],
        [END DATE].[REFDATE].&[2010-01-01T00:00:00]:[END DATE].[REFDATE].LastMember)

很简单。我想我的问题不清楚,这就是为什么我有不同的答案; - )

Pretty simple. I think my question was not clear, that's why I got different answers ;-)

这篇关于SSAS - 在一段时间内发生的事实的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆