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

MDX to calculate Prior FY Year first 6 months revenue when we pass getdate() or todays date

$
0
0

I have a Daily report where I pass Currentdate,it has to generates /displays Prior Year  first 6 months (when we pass currentdate) using below mdx,Could you please confirm below code correct code?

WITH
 MEMBER [MEASURES].[x] AS

        (Sum
           (
            {
             Ancestor
                    (
                     [Calender FYDate].[FY Year - Quarter - Month - Date].CurrentMember           
                     ,[Calender FYDate].[FY Year - Quarter - Month - Date].[FY Year]          
                     ).Lag(1).FirstChild.FirstChild.FirstChild        
                     :           
               Cousin          
                     (            
                     [Calender FYDate].[FY Year - Quarter - Month - Date].CurrentMember           
              ,Ancestor            
                     (             
                      [Calender FYDate].[FY Year - Quarter - Month - Date].CurrentMember             
                      ,[Calender FYDate].[FY Year - Quarter - Month - Date].[FY Year]            
                      ).Parent.Lag(6)         
                       )      
                       }     
          ,[Measures].[Revenue]    
        )   
  )
SELECT  {
         [MEASURES].[x]                    

        } ON 0
        ,  
NON EMPTY
        ( [Internet Reseller].[Name].&[Bikes]
        )
ON ROWS
FROM SALES
    WHERE (
    [Calender FYDate].[FY Year - Quarter - Month - Date].&[20121205])

Thanks

Theus

                                       

Viewing all articles
Browse latest Browse all 14337

Trending Articles



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