Quantcast
Channel: SQL Server Analysis Services Forum
Viewing all articles
Browse latest Browse all 2472

Calculate last 30 days

$
0
0

Hello, 

I wan to calculate the sum of last 30 days and remove [down days] from them. I am using the following code:

I have a filter called down days in the time dimension, when if a day is down, I flag it "yes"

CREATE MEMBER CURRENTCUBE.[MEASURES].[Points - Last 30 days]as SUM({[Time ds].[Date].CurrentMember.Lag(30):[Time ds].[Date].CurrentMember}* {[Time Ds].[Down Days].&[No]},[MEASURES].[Points])), VISIBLE =1;

With this calculation, if i have 2 down days, then it calculates 30-2 = 28 days.

However, I want to sum up 30 days at any point of time, even after removing the down days.

the number of down days in any 30 day period can vary.

Is it possible to do this is SSAS?

Thanks



Viewing all articles
Browse latest Browse all 2472

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>