Include date in result

  • I am new to MDX queries and have an MDX query that runs fine:

    Select

    [Measures].[Total Patients Waiting] on columns,

    CrossJoin({[ReportDate].[ReportDate].[Report Date].&[20140401]},

    {[Facility].[Facility].ALLMEMBERS}) on rows

    From WaitTimeEWL

    The data updates periodically (currently maximum date is 20140701) and I would like to select the maximum date.

    Any suggestions would be appreciated.

  • Howard C. BAchtel-438731 (7/9/2014)


    I am new to MDX queries and have an MDX query that runs fine:

    Select

    [Measures].[Total Patients Waiting] on columns,

    CrossJoin({[ReportDate].[ReportDate].[Report Date].&[20140401]},

    {[Facility].[Facility].ALLMEMBERS}) on rows

    From WaitTimeEWL

    The data updates periodically (currently maximum date is 20140701) and I would like to select the maximum date.

    Any suggestions would be appreciated.

    You could try something like the following....

    Select

    [Measures].[Total Patients Waiting] on columns,

    CrossJoin({[ReportDate].[ReportDate].[Report Date].LastChild },

    {[Facility].[Facility].ALLMEMBERS}) on rows

    From WaitTimeEWL

    Depending on how you created the ReportDate dimension this should give you the right result. I tested against a dimension that included an Unknown member (a property of the dimension that you can enable if you need) and the member "Unknown" was the last child. if this happens to be the case for you, maybe the following will work

    Select

    [Measures].[Total Patients Waiting] on columns,

    CrossJoin({[ReportDate].[ReportDate].[Report Date].LastChild.Lag(1) },

    {[Facility].[Facility].ALLMEMBERS}) on rows

    From WaitTimeEWL

  • Thanks for your help. I tried this and it works well.

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

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