Concatenating string to measures in MDX query

  • Hi,

    I have MDX Query which is

    select non empty { ORDER( TOPCOUNT(NonEmpty({ [Measures].[Date] },( [Measures].[Date] )),1,( [Measures].[Date] )), ( [Measures].[Date] ), BDESC ) } on columns

    from cube

    The output of query is 20121023

    I want output as

    [Date].[Date hierarchy].[Date].&[20121023]

    Is there any way to concatenate string to the date.

  • Try...

    member [Measures].[Date String] As

    "[Date].[Date hierarchy].[Date].&[" + CSTR([Measures].[Date].Value) + "]"

    ,non_empty_behavior = [Measures].[Date]

    Mack

  • I also do something similar with this sort of MDX

    TAIL(NONEMPTY({[Date].[Month].[All].Children},{[Measures].[Net Revenue]}),1).Item(0).UniqueName

    Mack

  • Thanks, I got error as

    Query (1, 36) Parser: The syntax for '"[Date].[Date hierarchy].[Date].&["' is incorrect.

  • Can you provide he entire query as the syntax looks okay (have tested it on my cube)? Or have you added this to the cube itself?

    Mack

  • it worked..sorry I made a mistake in my syntax.. Thanks!!

Viewing 6 posts - 1 through 5 (of 5 total)

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