ssas - Last Available value MDX -


i have requirement in extract data cube, within ssrs dataset using query builder ,with time dimension in result set, across range of dates. conditions

  1. the measures displayed each day of date range.
  2. the sub total row should have last available measures value time range.
  3. there time filter (currently single date filter multi select option).

my mdx below.

  1. the measure has 'sum' aggregation type.
  2. i have calculated measure scope defined below.

     scope([measures].[measure1]);        scope([date].[date].members);                    = tail(existing ([date].[date].members),1).item(0)  ;                 end scope;    end scope; 

this above scope statement works perfectly. however, when select in more 1 date member query slows wayyyyyyy down. performance numbers

  1. across 1 date - 4 seconds
  2. across 2 dates - 22 minutes
  3. across 3 dates - unknown (in hours)

this drastic degradation in performance goes away if remove scope statement, makes me thing there should better way same. final report query below.

select   non empty     {[measures].[measure1]} on columns     ,non empty     { [dimension1].[dimension1].[dimension1].allmembers*           [dimension2].[dimension2].[dimension2].allmembers*          [dimension3].[dimension3].[dimension3].allmembers*          [date].[date].[date].allmembers       } on rows (       select {[date].[date].&[2014-06-13t00:00:00]               ,[date].[date].&[2014-06-16t00:00:00] } on columns       [cube]       ) 

so question again is, is there way last available value part of scope statement have better performance? also, if there way write final mdx performance?.

please let me know if there anythings unclear regarding question.

thanks srikanth

the first optimization step change query to

select   non empty     {[measures].[measure1]} on columns     ,non empty     { [dimension1].[dimension1].[dimension1].allmembers*           [dimension2].[dimension2].[dimension2].allmembers*          [dimension3].[dimension3].[dimension3].allmembers*          {[date].[date].&[2014-06-13t00:00:00], [date].[date].&[2014-06-16t00:00:00] }     } on rows [cube]  

furthermore, not sure why added scope([date].[date].memeber); (probably date].[date].members, actually). maybe helps omit , corresponding end scope.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -