Quantcast
Channel: SQL Server Analysis Services Forum
Viewing all articles
Browse latest Browse all 2472

Last Fiscal Year to Date

$
0
0
Sum(PeriodsToDate([Time_WeekTest].[Reporting Year -  Reporting Month -  Reporting Week -  Reporting Day].[Reporting Year],ParallelPeriod(
    [Time_WeekTest].[Reporting Year -  Reporting Month -  Reporting Week -  Reporting Day].[Reporting Year],
    1,
    Tail(
        NonEmpty(
            Descendants(
                [Time_WeekTest].[Reporting Year -  Reporting Month -  Reporting Week -  Reporting Day].CurrentMember,
                ,
                Leaves
            ),
            [Measures].[SALES]
        ),
        1
    ).Item(0)
)),[Measures].[SALES])

I am using the code inserted as a calculated member in my cube to get "Last Years Fiscal Year to date" $$.

I am having the following issue:   I have a report putting this calc. on the columns and My "Account" & "product" dimensions on the rows.  The issue is that not every account buys every product every day of the year.  So, if account ABC has not bought product X since 7/1/2012,  it computes last-YTD only through 7/1/2011.  Whereas a customer buying every day (ie last SALE was yesterday) would have last-YTD ending 10/10/2011.

Therefore, I would like my previos YTD number to be based on the MAX Sale date (regardless of who & what was bought) -1 year.  All accounts/products would use 10/10/2011 as their endpoint for last-YTD.

Sorry if this is confusing (realtively new to SSAS). 

Thanks


Viewing all articles
Browse latest Browse all 2472

Trending Articles



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