MDX Current Month Problem
        Posted  
        
            by schone
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by schone
        
        
        
        Published on 2010-03-18T14:09:04Z
        Indexed on 
            2010/03/18
            14:11 UTC
        
        
        Read the original article
        Hit count: 406
        
Hi all,
I have the following MDX query:
WITH
   MEMBER [Measures].[TY Sales]
   AS 'SUM([Measures].[Sales])'
   MEMBER [Measures].[YTD Sales] 
   AS 'SUM(PERIODSTODATE([Time.Fiscals].[2009], [Time.Fiscals].CurrentMember), [Measures].[Sales])'
   MEMBER [Measures].[LY Sales]        
   AS 'SUM(PARALLELPERIOD([Time.Fiscals].[2009].[8], 1, [Time.Fiscals].CurrentMember),[Measures].[Sales])'
   MEMBER [Measures].[LYTD Sales]
   AS 'SUM(PERIODSTODATE([Time.Fiscals].[2009], PARALLELPERIOD([Time.Fiscals].[2009].[8], 1, [Time.Fiscals].CurrentMember)), [Measures].[Sales])'
SELECT
   {[Measures].[TY Sales],[Measures].[YTD Sales],[Measures].[LY Sales],[Measures].[LYTD Sales]} ON COLUMNS,
   [Time.Fiscals].[2009].[8] ON ROWS
FROM
   [Sales]
The above query displays sales for fiscal year 2009 and fiscal month 8 (Feb), I would like the fiscal year and fiscal month dynamic but I'm unsure on how to do this?
I'm using Mondrian.
Thanks!
© Stack Overflow or respective owner