![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
If we have a measure that is number of sales orders per day [Sales Order Count], how would we write an MDX statement that will return the sum of Sales Order Count for the last "X" days, such that if the cutrrent member is Monday 8/21/2006 and we want the last 7 days sun, we get sum of Sales Order Count from 8/15/2007 - 8/21/2006? Thanks! |
#3
| |||
| |||
|
|
If we have a measure that is number of sales orders per day [Sales Order Count], how would we write an MDX statement that will return the sum of Sales Order Count for the last "X" days, such that if the cutrrent member is Monday 8/21/2006 and we want the last 7 days sun, we get sum of Sales Order Count from 8/15/2007 - 8/21/2006? Thanks! |
#4
| |||
| |||
|
|
Steven, Please try LASTPERIODS function in case you are using AS2005. Here is a test script against Adventure Works DW in the samples. with member measures.x as sum( { lastperiods( 7, [Date].[Calendar].[Date].&[629] ) } , [Measures].[Internet Sales Amount] ) select { lastperiods( 7, [Date].[Calendar].[Date].&[629] ) } on 1 , { [Measures].[Internet Sales Amount] , measures.x } on 0 from [Adventure Works] HTH.. ZULFIQAR SYED HTTP://ZULFIQAR.TYPEPAD.COM Steven H wrote: If we have a measure that is number of sales orders per day [Sales Order Count], how would we write an MDX statement that will return the sum of Sales Order Count for the last "X" days, such that if the cutrrent member is Monday 8/21/2006 and we want the last 7 days sun, we get sum of Sales Order Count from 8/15/2007 - 8/21/2006? Thanks! |
![]() |
| Thread Tools | |
| Display Modes | |
| |