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

MDX Query for Previous Year YTD calculation for leap Year

$
0
0

Hi,

I have a calculated member for prior YTD calculation based on the user input of date, for example if user select Feb 20th and the calculated member give the last year YTD from Jan 1st to Feb 20 

SUM
(
YTD
(
ParallelPeriod
(
[Dim Date].[Hierarchy].[Year],1,
[Dim Date].[Hierarchy].CURRENTMEMBER
)
),
[Measures].InternetSales
)

I would like to do calculation factoring in the leap year so let's say user select Feb 28th, 2013 last year would be Feb 28, 2012 using above calculation since last year was a leap year I would like to get YTD until Feb 29th, 2012 not Feb 28th.

Any help/ideas are much appreciated.

Thanks 


Atif Yasin DATA/BI ENGINEER


Viewing all articles
Browse latest Browse all 14337

Trending Articles



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