Quantcast
Channel: SQL Server Analysis Services Forum
Viewing all articles
Browse latest Browse all 2472

Aggregate + Case MDX query performance issue

$
0
0

When i drag  two dims with the measure down time the query works fine , when add another dim to the query the query freezes on excel and it is slow on the cube side . 

any help to enhance performance ? 

CREATE MEMBER CURRENTCUBE.[Measures].[Down Time]
 AS [Measures].[Down Time Reported], 
FORMAT_STRING = "#,##0.00;-#,##0.00", 
VISIBLE = 1 ,  DISPLAY_FOLDER = 'Machine Utilization';                          

Scope([Measures].[Down Time]);                      
    Scope([MACHINE].[Facilities].allmembers);               
this = Case

    when [MACHINE].[Facilities].Currentmember.level is [MACHINE].[Facilities].[Facility]
    then iif( not isError([MACHINE].[Department Constraint].&[True]), 
Aggregate([MACHINE].[Department Constraint].&[True], [MACHINE].[Facilities].Currentmember), null)    
    when [MACHINE].[Facilities].Currentmember.level is [MACHINE].[Facilities].[Department]
    then iif( not isError([MACHINE].[Department Constraint].&[True]), 
Aggregate([MACHINE].[Department Constraint].&[True], [MACHINE].[Facilities].Currentmember), null)
    when [MACHINE].[Facilities].Currentmember.level is [MACHINE].[Facilities].[Production Line No]
    then iif( not isError([MACHINE].[Production Line Constraint].&[True]), 
Aggregate([MACHINE].[Production Line Constraint].&[True], [MACHINE].[Facilities].Currentmember), null)
    when [MACHINE].[Facilities].Currentmember.level is [MACHINE].[Facilities].[Work Center]
    then iif( not isError([MACHINE].[Work Center Constraint].&[True]), 
Aggregate([MACHINE].[Work Center Constraint].&[True], [MACHINE].[Facilities].Currentmember), null)        
    else [Measures].[Down Time Reported] End;                           
    end scope;               
end scope;   

    

Viewing all articles
Browse latest Browse all 2472

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>