Quantcast
Channel: SQL Server Analysis Services forum
Viewing all articles
Browse latest Browse all 14337

MDX Aggregate function

$
0
0

Hello,

My MDX query works fine comparing month by month current year vs prior. Now is month of March but when it comes to April last year all the numbers are jump up too high and I'm not sure what causing it.

Please help!!

here is my MDX:

WITH


MEMBER [Measures].[InvoiceAmountPY]as 

SUM(

{

PARALLELPERIOD (

[Date].[Calendar].[Year]

,1

,

OPENINGPERIOD([Date].[Calendar].[Date],[Date].[Calendar].CurrentMember)

)

:

PARALLELPERIOD (

[Date].[Calendar].[Year]

,1

,

TAIL(

NONEMPTY(

DESCENDANTS([Date].[Calendar].CurrentMember,[Date].[Calendar].[Date],LEAVES)

, [Measures].[Invoice Amount]

)

,1

).

Item(0)

)

}

, [Measures].[Invoice Amount]

)

,

FORMAT_STRING="Currency"

MEMBER [Measures].[InvoiceAmountCY]as


(

[Measures].[Invoice Amount]

),

FORMAT_STRING="Currency"


SELECT


{

[Measures].[InvoiceAmountCY]

,[Measures].[InvoiceAmountPY]

}

ON 0,

{

[Date].[Calendar].[Month]

}

ON 1


FROM

[Retail Sales]


where

  [Date].[Calendar Year].&[2013]


Viewing all articles
Browse latest Browse all 14337

Trending Articles



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