MDX Help with prior 4 quarters

  • I have been pulling my hair out over this and would appreciate any suggestions one may have. I have attached a Word document with specifics. I am trying to construct an MDX statement that will return only the 4 prior (complete) quarters. In other words, I don't want the last quarter which is out current quarter (2011 Q2). I would like to get only 2010 Q2 thru 2011 Q1.

    Thanks for any help you can lend.

  • I think this query should return sales for prior 4 quarters:

    SELECT

    NON EMPTY { [Measures].[Net Sales] } ON COLUMNS,

    NON EMPTY { ([Calendar].[Quarter].currentmember.lag(4):[Calendar].[Quarter].currentmember.lag(1)) } ON ROWS

    FROM [Marketing]

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply