ssas - Parent not include children if parrent is miss in another year in MDX -


i have data,

parentid    geo     customerid  sales   year 171       171     10  2014 171       172     20  2015 171       172     30  2014 171       173     40  2014 

query,

 select non empty { [measures].[sales] }  on columns, non empty { ([dimcustomer].[parentgeocode].[parentgeolcode].allmembers ) }   dimension properties member_caption, member_unique_name    on rows   ( select ( { [dimcustomer].[parentskid].[level 02].allmembers } )    on columns ( select ( { [dimcustomer].[hierarchycategory].&[hierarchy] } )   on columns ( select ( { [year].[year].&[2015], [year].[year].&[2014] } )   on columns [cube])))    ( [year].[year].currentmember, [dimcustomer].[hierarchycategory].&[hierarchy],   [dimcustomer].[parentskid].[level 02].allmembers) 

output- coming query 10 per requirment need 100 if select year 2014 , 2015

try taking [year].[year].currentmember out of where clause , replacing member of hierarchy [year].[year].[all]

by way: 1. not need nest sub-selects more readable if use other axes. 2. no need include .allmemeber functions in sub-select [dimcustomer].[parentskid].[level 02].allmembers

this simplified script:

select   non empty { [measures].[sales] } on 0,   non empty { ([dimcustomer].[parentgeocode].[parentgeolcode].allmembers ) } on 1   (     select           { [dimcustomer].[hierarchycategory].&[hierarchy] }   on 0,         { [year].[year].&[2015], [year].[year].&[2014] }     on 1     [cube]    )      (      [year].[year].[all],      [dimcustomer].[hierarchycategory].&[hierarchy],      [dimcustomer].[parentskid].[level 02].allmembers    ); 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -