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

Measure aggregated from day one when filtered by time dimension attribute doesn't work

$
0
0

I have a measure (company headcount) which is defined as a calculated measure by aggregating from the start of my date dimension to the reporting date with an expression like this:

Sum(
    null : [Date].[By Calendar Year].CurrentMember,
    [Measures].[Starters] - [Measures].[Leavers]
)

I also have an attribute on my time dimension that indicates whether the date falls into one of the last 12 periods (calculated in the relational database as a Yes/No value). This attribute works fine for filtering "normal" measures but, when applied to the headcount measure it is clearly taking the sub-cube defined by those 12 periods and aggregating from the start of that instead. What is required is the same figures as if the entire time dimension were being displayed, but hiding everything outside of those 12 periods. This is the result you get if you use Excel to display the data and manually filter the periods to be displayed but, of course, you have to manually update the filtering after the next period has ended.

It's understandable that SSAS is reducing down the volume of data to be handled as much as possible but I need somehow to override that behaviour for this aggregated measure. I have tried replacing the null in the above SUM() function with the first sibling of the cousin of the current member in the first year but that made no difference. All I can think of now is to calculate the daily headcount in the relational database and base the measure on that instead but it seems a rather clunky solution.

Can anyone suggest something more elegant?


Viewing all articles
Browse latest Browse all 14337

Trending Articles



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