HomeMDXTools to make creating MDX much easier

Comments

Tools to make creating MDX much easier — 4 Comments

  1. Hi James,
    I am new to MDX. I hope you can help me with a calculation of [Prev Month MTD]
    My query is like below. It works fine for most time, but It does not work when the current date is, say, 12/31/2011 because there is not Novermber 31. Should the ParallelPeriod function handle it gracefully?
    I am using SQL 2012. Is it a bug? Would you please tell me what is the right way to do it?
    with
    member [measures].[prv mon] as
    sum(
    MTD(
    ParallelPeriod( [Date].[Calendar].[Month],1,[Date].[Calendar].CurrentMember)
    ),
    [Measures].[sales amount USD]
    )
    select {[measures].[prv mon]} on 0,
    {
    [Business Unit].[Business Unit].[Division].members
    } on 1
    from [Invoice History]
    where [Date].[Date].&[20111231]

    Thanks
    HUa

Leave a Reply

Your email address will not be published. Required fields are marked *

HTML tags allowed in your comment: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>