Quantcast
Channel: SQL Server Analysis Services forum
Viewing all articles
Browse latest Browse all 14337

Scope two different time hierachies

$
0
0

I have one time dimension with two hierachies.

(Time) Year-Month-Day
and
(Time Week) IsoYear-IsoWeek-Day

I'm trying to do the following scope statement:

--Calculation for YTD
scope   ([Measure Calculation].[Measure Calculation].&[2]
        ,[Measures].[Example]]);
this =  sum(YTD([Time].[Time].currentmember),[Measure Calculation].[Measure Calculation].&[1]);

scope   ([Time].[Time Week].[Week]);
this =  [Time].[Time Week].currentmember.lastchild;
end scope;

scope   ([Time].[Time].[Year]);
this =  [Measure Calculation].[Measure Calculation].&[1];
end scope;
end scope;

This works for the day level but not for Month and Week level. I tried to rebuild the hierachies
so they used the same year attribute and then it works.

I have also tried to add two scope statements DESCENDANTS([Time].[Time],,AFTER)

DESCENDANTS([Time].[Time Week],,AFTER) to force it to scope for only the specific hierachy, but that dosent seems to work.

Does anyone have a solution? I guess I have to scope for both levels in the beginning.

Thanks i advance!

AL


Viewing all articles
Browse latest Browse all 14337


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