sql - MDX filtering by multiple dimension members -


problem

i need create report list number of accounts match criteria - simulationdate, statisticperiod, region.

right query looks this:

with member [measures].[count] 1 select [measures].[count] on columns, non empty  crossjoin( [account].[account number].allmembers, {[simulationdate].[day].&[10010101]}, {[statisticperiod].[period].&[201201]}, {[region].[code].&[so]} ) on columns [mywh] 

is cross-dimensional filtering okay?

this more modern using * notation instead of crossjoin function:

with    member [measures].[count] 1  select    [measures].[count] on columns  ,non empty        [account].[account number].allmembers*       {[simulationdate].[day].&[10010101]}*       {[statisticperiod].[period].&[201201]}*       {[region].[code].&[so]} on columns [mywh]; 

i'm assuming custom measure [measures].[count] place-holder?

this table wide if have cross-join on columns might typo:

with    member [measures].[count] 1  select    [measures].[count] on columns,    non empty        [account].[account number].allmembers*       {[simulationdate].[day].&[10010101]}*       {[statisticperiod].[period].&[201201]}*       {[region].[code].&[so]} on rows [mywh]; 

you have added keywords non empty in front of rows cross-join. telling processor exclude rows empty - empty [measures].[count] ....but measure never empty equal 1. following without non empty should return same result:

with    member [measures].[count] 1  select    [measures].[count] on columns,        [account].[account number].allmembers*       {[simulationdate].[day].&[10010101]}*       {[statisticperiod].[period].&[201201]}*       {[region].[code].&[so]} on rows [mywh]; 

so in terms of filtering aren't doing - sort of filtering need? if replace [measures].[count] actual measure cube , use non empty should see lot less rows:

select    [measures].[replacewithactualmeasure] on columns,    non empty       [account].[account number].allmembers*       {[simulationdate].[day].&[10010101]}*       {[statisticperiod].[period].&[201201]}*       {[region].[code].&[so]} on rows [mywh]; 

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -