Returing MDX Properties from Query

  • Hi,

    I've been scratching my head for sometime now trying to figure out a way to return a member property rather than the 'caption' in an MDX query.

    This is the working query that return the 'MEMBER_CAPTION':

    SELECT

    NON EMPTY {[ACCBI].[COST],[ACCBI].[VOLPROD_CASE]} ON 0,

    NONEMPTYCROSSJOIN({(Descendants([TIME].[2011.TOTAL],999,LEAVES))},{filter({(Descendants([PRODUCT].[H1].[ALL_BU],999,LEAVES))},[PRODUCT].CURRENTMEMBER.PROPERTIES('PROD_TYPE')='BOUGHTIN')},{[ACCBI].[COST],[ACCBI].[VOLPROD_CASE]} ,2) ON 1

    FROM [BOUGHTIN] WHERE

    ([CATEGORY].[Q0F],[DATASRC].[TOTALADJ],[ENTITY].[TOT_ENTITY],[MEASURES].[PERIODIC],[RPTCURRENCY].[GBP],[T_CURRENCY].[T_TOTAL],[BIELEMENTS.H2].[STD_COST])

    I seem to need the following WITH MEMBER to give me the property but I can't seem to get it to work:

    WITH MEMBER [PRODUCT].[H1].[RM] AS '[PRODUCT].CURRENTMEMBER.PROPERTIES("BIFG_RM_ITEM")'

    Hope this make some kind of sense 🙂

    Any help would be very much appreciated.

    Thanks Dean.

  • If you have the adventureworks cube - this may help:

    http://msdn.microsoft.com/en-us/library/ms145528.aspx">

    http://msdn.microsoft.com/en-us/library/ms145528.aspx

    WITH

    MEMBER Measures.CategoryCaption AS Product.Category.CurrentMember.MEMBER_CAPTION

    MEMBER Measures.SpanishCategoryCaption AS Product.Category.CurrentMember.Properties("LCID3082")

    MEMBER Measures.FrenchCategoryCaption AS Product.Category.CurrentMember.Properties("LCID1036")

    SELECT

    { Measures.CategoryCaption, Measures.SpanishCategoryCaption, Measures.FrenchCategoryCaption } ON 0

    ,[Product].[Category].MEMBERS ON 1

    FROM [Adventure Works]

    From your example - I would consider changing:

    WITH MEMBER [PRODUCT].[H1].[RM] AS '[PRODUCT].CURRENTMEMBER.PROPERTIES("BIFG_RM_ITEM")'

    to

    WITH MEMBER Measures.RMItemProduct AS [PRODUCT].[Subcategory].CURRENTMEMBER.PROPERTIES("BIFG_RM_ITEM")

    gsc_dba

  • Thanks thats great, I'll give it a go 😀

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

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