Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


MDX Query Performance Tunning


MDX Query Performance Tunning

Author
Message
raghavag7
raghavag7
Grasshopper
Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)

Group: General Forum Members
Points: 15 Visits: 124
Hi ,

Below MDX Query its taking long time.Can you please help me, how to reduce time?.
Give me some points.

WITH MEMBER [Measures]. [CurrentDate] as 'NOW()'
MEMBER DateDif as vba!datediff("d",[Invoice Sent Date].[Date] .currentmember.member_value,
VBAMDX.Format(VBAMDX.Now(),"MM/dd/yy"))
Member [DueBucket] as IIF (DateDif > 180, "Above 180",
IIF(DateDif>120, "121-180",
IIF(DateDif>90, "91-120",
IIF(DateDif>60, "61-90",
IIF(DateDif>30, "31-60",
IIF(DateDif>=0, "0-30", "Not Due"))))))
SELECT NON EMPTY {[Measures].[Amount] ,CurrentDate,DateDif , [DueBucket] } ON COLUMNS,
NON EMPTY {([Customer].[Customer Name].[Customer Name].ALLMEMBERS *
[Lob].[Lob Code].[Lob Code].ALLMEMBERS *
[Date].[Month Name].[Month Name].ALLMEMBERS *
[Invoice Sent Date].[Date].[Date].ALLMEMBERS ) } ON ROWS
FROM [iWise]

Regards,
Raghav.
PB_BI
PB_BI
Ten Centuries
Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)Ten Centuries (1.3K reputation)

Group: General Forum Members
Points: 1291 Visits: 2404
Firstly, have a read of this article by Chris Webb about the performance of DateDiff: http://cwebbbi.wordpress.com/2014/06/09/calculating-ages-in-mdx/

Secondly,
It doesn't seem like you are doing anything that is particularly dynamic so, depending on your processing model, you may wish to take all of this:

WITH MEMBER [Measures]. [CurrentDate] as 'NOW()'
MEMBER DateDif as vba!datediff("d",[Invoice Sent Date].[Date] .currentmember.member_value,
VBAMDX.Format(VBAMDX.Now(),"MM/dd/yy"))
Member [DueBucket] as IIF (DateDif > 180, "Above 180",
IIF(DateDif>120, "121-180",
IIF(DateDif>90, "91-120",
IIF(DateDif>60, "61-90",
IIF(DateDif>30, "31-60",
IIF(DateDif>=0, "0-30", "Not Due"))))))



...and make it into an expression in your fact table dsv. Then you could join it to a DueBucket dimension which would make it both much faster and more flexible for people browsing the cube.

Again this second part depends on your processing model - for example this wouldn't work if you were processing your measure group incrementally. Have a read of the article though it should provide some pointers.




I'm on LinkedIn
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search