none
MDX Case Statement RRS feed

  • Question

  • I have the following MDX query with a case statement:

    With
    Member [Call_Start_Date].[Call Start Month].[Month Name] as
    Case [Call_Start_Date].[Call Start Month].[Call Start Month].Name
    	when [Call_Start_Date].[Call Start Month].&['1'].Name then 'Jan'
    	when [Call_Start_Date].[Call Start Month].&[2].Name then 'Feb'
    	when [Call_Start_Date].[Call Start Month].&[3].Name then 'Mar'
    	when [Call_Start_Date].[Call Start Month].&[4].Name then 'Apr'
    	when [Call_Start_Date].[Call Start Month].&[5].Name then 'May'
    	when [Call_Start_Date].[Call Start Month].&[6].Name then 'Jun'
    	when [Call_Start_Date].[Call Start Month].&[7].Name then 'Jul'
    	when [Call_Start_Date].[Call Start Month].&[8].Name then 'Aug'
    	when [Call_Start_Date].[Call Start Month].&[9].Name then 'Sep'
    	when [Call_Start_Date].[Call Start Month].&[10].Name then 'Oct'
    	when [Call_Start_Date].[Call Start Month].&[11].Name then 'Nov'
    	when [Call_Start_Date].[Call Start Month].&[12].Name then 'Dec' 
    	else 'N/A'
    end
    
    SELECT
    { [Call_Start_Date].[Call Start Month].[Month Name]}
    ON COLUMNS,
    
    { [Call_Start_Date].[Call Start Year].[Call Start Year].ALLMEMBERS }
    ON ROWS
    
    FROM [MyCube]
    
    WHERE ( [Measures].[Total Calls] )

    It is always coming back with N/A as it is just summing the [Call Start Month].

    What I want to return is Jan Feb Mar.. etc for the columns and the count for each month of [Total Calls]

    Any ideas?

    Tuesday, August 21, 2012 2:36 PM

Answers

  • Try:

    Case [Call_Start_Date].[Call Start Month].[Call Start Month].Currentmember
    	when [Call_Start_Date].[Call Start Month].&[1] then 'Jan'


    http://dailyitsolutions.blogspot.com/

    • Marked as answer by JamesTJC Wednesday, September 20, 2017 5:49 PM
    Wednesday, August 22, 2012 4:38 PM