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

Compare custom periods

$
0
0

Hello,

I am trying to compare revenue. My query works with hierarchies periods (year, month, day), but I don't know how to compare with custom periods.

For exemple, comparing the revenue from [2013-05-02] to [2013-05-25] with exactly the same days in 2012. How can I achieve this ?

Here my query to compare 2012 and 2011 :

with
set Hotels as
{
    [Hotels].[Hotel ID].&[1015],
    [Hotels].[Hotel ID].&[5640],
    [Hotels].[Hotel ID].&[8800]
}
set Period as [Arrival Date].[Date].[Month].&[2012]&[1]:[Arrival Date].[Date].[Month].&[2012]&[12]
member [Arrival Date].[Date].[0] as sum({ Period })
member [Total Amount N-1] as (PARALLELPERIOD([Arrival Date].[Date].[Year], 1, [Arrival Date].[Date].[Year].&[2012]), [Measures].[Total Amount])
select
{
    [Measures].[Total Amount],
    [Measures].[Total Amount N-1]
} on 0,
{
    nonemptycrossjoin
    (
        Hotels,
        Hotels.[Hotel].children,
    )
    *{[Arrival Date].[Date].[0]}
} on 1
from [Booking_Cube]

Here the result :


                                              Total Amount   Total Amount N-1
1015    Hotelname1015   0    1275810.51     1495742.72
5640    Hotelname5640   0    17603.3           1100
8800    Hotelname8800   0    406                  (null)

Thanks


Viewing all articles
Browse latest Browse all 14337

Trending Articles



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