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

MDX help for Named Set for Current Month, Last Month, Current Month Last Year

$
0
0

I need a named set to return Current Month, Last Month, and Current Month Last Year only. (i.e. March 2013, February 2013, March 2012) Can anyone help? My dimension is setup [Date].[Month]

EDIT: got this far...now need help trying to get it into proper format for a set in BIDS

WITH 
    SET [CurrentMonth] AS StrToMember('[Date].[Year -  Quarter -  Month -  Date].[Month].['+VBA!Format(now(), 'MMMMM yyyy')+ ']')
    SET [CurrentLastMonth] AS TAIL({NULL: [CurrentMonth].ITEM(0)}, 2)
    SET [CurrentMonthLastYear] AS TAIL({NULL: PARALLELPERIOD([Date].[Year -  Quarter -  Month -  Date].[Year], 1, [CurrentMonth].ITEM(0))})
SELECT
    {


    } ON COLUMNS,

    {
       [CurrentLastMonth]
       ,[CurrentMonthLastYear]

    } ON ROWS
FROM [Revenue]




Viewing all articles
Browse latest Browse all 14337

Trending Articles