I have the following MDX query running on SQL Server 2016:
SELECT NON EMPTY(Measures.[Enrolments Count]) ON COLUMNS,
NON EMPTY FILTER ( [Term Record Creation].[Year].CHILDREN * [Term Record Creation].[Week].CHILDREN *
[Term Enrolments].[Term Year].CHILDREN ,
[Term Record Creation].[Week] <= 5)
DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS
FROM [Enrolments]
I am trying to only take enrolments where a term record was created before week 5 of the year (where the week is an ISO week).
The Term Year
is the year in which a term starts. It is a column in addition to the term record creation dimensions i.e. [Term Record Creation].[Year]
and [Term Record Creation].[Week]
.
The problem I am having is that the filter is doing some sort of filtering (because my measure column is low), but I am still getting all of the weeks of the year with a number against them e.g. I have a row like the following in the result set:
Creation Year Creation Week Term Year Enrolments Count
2012 16 2013 4
I would really appreciate if someone could explain what is going wrong and provide a solution.
Thanks.