ssas - Effecient way to get NonEmpty members -
consider dimension_a , dimension_b , measure_amt require first 100 non-empty members cross-join between dimension_a , dimension_b measure_amt. following query works takes lot of time since these dimensions large(from million 20 million)
set subset(dimension_a.levels(1),0,100) set x subset(nonemptycrossjoin(a,dimension_b.levels(1)), 0, 100) select [measures].[measure_amt] on 0 , x on 1 my_cube
and clause,
with set subset(dimension_a.levels(1),0,100) set x subset(nonemptycrossjoin(a,dimension_b.levels(1)), 0, 100) select [measures].[measure_amt] on 0 , x on 1 my_cube dimension_c.member_c1
fetching first 100 members of single dimension quick, nonempty function accounts of time. since require first 100 non-empty members , not next subset, there way write better query.
when say, "i require first 100 non-empty members cross-join between dimension_a , dimension_b measure_amt", assume mean want top 100 results, measure_amt not null 2 cross-joined sets.
if so, believe way write query may improve performance.
with set [x] [dimension_a].levels(1) * [dimension_b].levels(1) select [measures].[measure_amt] on 0, subset( nonempty( [x] , [measures].[measure_amt] ) , 0 , 100 ) on 1 [my_cube] [dimension_c].[member_c1]
wiki
Comments
Post a Comment