olap - SSAS: Percent of Total not working in hierarchy -


i have simple olap cube - 1 set of measures , unexciting dimensions.

i've add 1 calculation "percent of total" sales against gross sales measure. code calculation is:

 ([dim stores].[store name].currentmember, [measures].[gross sales])   /   ([dim stores].[store name].parent, [measures].[gross sales]) 

this works.

within store dimension, there hierarchy called 'by state' stores contained within.

two questions please: 1. idea why calculation not work when use the 'by state' hierarchy i.e. same calculation grouped next level up?

  1. the state problem aside, idea why grand total shows error when use store name?

tia!

in poking around, found template within "calculation tools" called "percentage of total". using it, translated calculation this:

case // test avoid division zero. when isempty      (          [measures].[gross sales]      )  null  else ( [dim stores].[by state].currentmember, [measures].[gross sales] )       /      (         // root function returns (all) value target dimension.        root             (            [dim stores]         ),          [measures].[gross sales]       )  end 

it worked!


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -