Member ID in MDX

Hi,
MDX question:  In SSAS 2005 I have a dimension.  this dimension has several members.
The attribute is designed to have key field (the ID in the source table) and a value field (the code in the source table)
Now I want to write a MDX statement that gives me the Key field of all members and the value of all members.
The last one is easy, but how do I get the ID via MDX,
Nico

 Nico V wrote:
How will I do it for all members?
Code Snippet
with member [Measures].[Keys] as '[Dim].[Hierarchy].currentmember.properties("key")'
select [Measures].[Keys] on columns,
[Dim].[Hierarchy].members on rows from
[Cube Name]

Similar Messages

  • Converting Member Formulas to MDX

    Hi Experts!
    I'm converting member formulas to MDX for an ASO cube I created and I'm having trouble with the ones that use @MDSHIFT. I'm new to MDX and trying to learn as I go. One of the formulas I'm struggling with is:
    IF( @ISMBR("Budget"))
    (("Operating Results"-
    (@MDSHIFT("Operating Results", -1, "Years", , 10,"Budget",)+
    "Reclassification Operating Results"))/
    (@MDSHIFT("Operating Results", -1, "Years", , 10,"Budget",)+
    "Reclassification Operating Results"))*100;
    ELSEIF( @ISMBR("Business Plan"))
    (("Operating Results"-
    (@MDSHIFT("Operating Results", -1, "Years", , -4,"Business Plan",)+
    "Reclassification Operating Results"))/
    (@MDSHIFT("Operating Results", -1, "Years", , -4,"Business Plan",)+
    "Reclassification Operating Results"))*100;
    ELSE
    (("Operating Results"-
    (@MDSHIFT("Operating Results", -1, "Years",)+
    "Reclassification Operating Results"))/
    (@MDSHIFT("Operating Results", -1, "Years",)+
    "Reclassification Operating Results"))*100;
    ENDIF;
    This is for a change year over year % member. Any help would be much appreciated! Thanks!
    -Cheers

    In all honesty - it looks like you should not just 'convert it.' I dont see any real need to use MDSHIFT here. I would just use PrevMember function for years, while hardcoding the scenario into the tuple.

  • How to extract Member Names in MDX script?

    I have a MDX script that by default gives me member aliases. How can I change it so it'd give me member names? I know I can use something like that:
    NON EMPTY [Employee].Levels(0).Members DIMENSION PROPERTIES [Employee].[Member_Name]ON AXIS(4)
    but then it gives me member aliases AND member names, and I need the names only.
    Thanks!

    The syntax you have is the way to get the member names, but as I said you wouldn't like the way it is displayed. MDX is not a reporting language and so it does not have the nice formatted selections. You will get both alias and member name by using the properties. you could run the output through some sort of parser (Perl perhaps) to get the format you want

  • Time dimension member selection via MDX

    Hello everybody.
    I'm working with SAP BW via XMLA-interface and select members of standard dimension with select expressions like this one:
    SELECT [GPTU_CA].Members DIMENSION PROPERTIES [GPTU_CA].[2CA_NAM], [GPTU_CA].[1CA_INN] ON 0 FROM [$GPTU_CA]
    where GPTU_CA is dimension.
    So, I want to know how to get members of time dimension via MDX. How can I do it?

    Problem solved. The method getMemberData() is what ia needed.

  • SSRS MDX Query Dimension Properties Missing

    I have been stumped on this for a few days thought I'd throw this out here. I've read every related article in the forum regarding MDX Queries and Dimension Properties in SSRS Report Developer and haven't found a case exactly like this with a solution that
    works.
    Environment is SQL 2012 SP1 Cum update 5
    I am doing a rather generic query out of MS Project Servers OLAP cube and I can't get the dimension properties to show up in the flattened output for my dataset. See below.
    SELECT
    NON EMPTY { [Measures].[FTE est] } ON COLUMNS,
    NON EMPTY {
    [Value_Stream_Project].[Value_Stream_Project].ALLMEMBERS *
    [Project Status_Project].[Project Status_Project].ALLMEMBERS *
    DESCENDANTS([Project List].[Project List Level 02].ALLMEMBERS)*
    DESCENDANTS([ProjectManager_Project].[ProjectManager_Project Level 02].ALLMEMBERS) *
    [Planner_Project].[Planner_Project].ALLMEMBERS *
    [Time].[Month].ALLMEMBERS
    DIMENSION PROPERTIES
    MEMBER_CAPTION,
    MEMBER_UNIQUE_NAME,
    PARENT_UNIQUE_NAME,
    LEVEL_NUMBER ,
    [Project List].[Project List Level 02].[Start Date],
    [Project List].[Project List Level 02].[Finish Date]
    ON ROWS
    FROM (
    SELECT ( STRTOMEMBER(@FromTime, CONSTRAINED) : STRTOMEMBER(@ToTime, CONSTRAINED) ) ON COLUMNS
    FROM (
    SELECT ( STRTOSET(@RBSResource, CONSTRAINED) ) ON COLUMNS
    FROM (
    SELECT ( STRTOSET(@ProjectStatusProject, CONSTRAINED) ) ON COLUMNS
    FROM (
    SELECT ( STRTOSET(@ValueStreamProject, CONSTRAINED) ) ON COLUMNS
    FROM [MSP_Portfolio_Analyzer]))))
    My issue is the [Project List Level 02] dimension Properties  (below) are not showing up in the Query designer output, aren't being generated as fields in the dataset and can't be referenced as a property in an expression (i.e. Fields!Project_List("Start
    Date") )
    [Project List].[Project List Level 02].[Start Date],
    [Project List].[Project List Level 02].[Finish Date]
    The odd part is if I change the above two rows in my query to this :
    [Project List].[Start Date],
    [Project List].[Finish Date]
    The Query designer shows the properties in the output but leads to  2 other issues,
    1) I have to modify the generated Dataset field values to remove the [Project list Level 02] in the Level unique name like this
    Before<?xml version="1.0" encoding="utf-8"?><Field xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:type="MemberProperty" PropertyName="Project List - Start Date" LevelUniqueName="[Project List].[Project List Level 02]" />
    After
    <?xml version="1.0" encoding="utf-8"?><Field xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:type="MemberProperty" PropertyName="Project List - Start Date" LevelUniqueName="[Project List]" />
    2) I have to restrict my cross join to only the current level (Level 02) or it expands the results to the parent hierarchy of the Project List dimension and skews my measure summaries.
    I've tested the query in SSMS directly and the properties are showing up just fine for those dimensions using the original syntax.
    Any help would be appreciated.

    Hi there,
    Which data source provider are you using?  Are the connection strings used in SSMS the same as SSRS? Doing a profiler trace against Analysis Services might point to differences in how the connection is made or query is parsed.
    This may help.
    http://www.sqlchick.com/entries/2011/10/23/pros-cons-of-using-the-ole-db-provider-for-ssas-100-when-rep.html
    Did you try using With clause to make a friendly name for the member properties?
    http://melick-rajee.blogspot.ca/2012/04/how-to-get-member-properties-in-mdx.html
    cheers,
    Andrew
    Andrew Sears, T4G Limited, http://www.performancepointing.com

  • Prior function in MDX

    HI,
    I am converting an BSO to ASO so need to change the Member furmula in MDX. I need to to change the following Prior function to MDX:
    @PRIOR( "Measure1" -> "EOPTIME" -> "DCAP001", 12, @LEVMBRS ("DLOS014", 0))
    my doubts are:
    1. How to use cross dimension in Prior function as comma (,) but it will take as an argument in function and even i cann't use braces also.
    2. in MDX we can't use range in lag function. so how to use range in lag function in MDX or any other approach?
    Thanks in advance.
    Regards,
    Abhishek

    to do the prior, you would use the lag function. It looks like you are lagging back 12 periods so you would have to add the periods dimension into the touple.
    To get the members you would use a tuple which would be something like ( [Measure1],[EOPTIME],[DCAP001],[Periods].currentmember.lag(12))
    Put that inside a case statment like Case When ISleaf([DLOS014].currentmember) then

  • MDX in NW

    Having a problem with dimension formula in SAP BPC for NW 7.0 sp8:
    Scenario 1:
    Account A5010a_I = A507_I is written as [A507_I] in the column formula in the account dimension. Works just fine.
    Scenario 2:
    Account  A5010a_I = A507_I for Periodic is written as ([A507_I],[MEASURES].[PERIODIC])
    Works just fine as well.
    Scenario 3:
    Account A5010a_I = A507_I for Periodic and member NO_ALDER in the dimension ALDER I written as ([A507_I],[ALDER].[NO_ALDER],[MEASURES].[PERIODIC])
    Gives me following error message:
    1: Failed to expand K2 function for dimension KONTO_HR's member formulas
    2: MDX statement error:"Unknown error when executing MDX"
    It seems to be a problem to specify more than two dimensions. Tired the same code in MS version without any problem. What am I doing wrong?

    Hi Marco,
    Can you please try:
    ([ACCOUNT].[A507_I],[ALDER].[NO_ALDER])
    Does this work?

  • Setting UDA in MDX

    Hi all:
    Is there any way to assign a UDA label to an ASO member via an MDX script? I have a script that uses the TOPPERCENT function to determine which sales reps contribute to 80% of total sales for a region. Once the sales rep have been determined, I want to be able to tag them for indentification on a report. I figured that setting a UDA would be one way, but not sure this is supported. If not, is there any other way I can tag or "isolate" the top 80% of sales reps?
    thanks,
    Axe

    MDX does not do outline changes just retrieve data from a cube. You could have a MDX extract create a file that is used to create UDAs

  • MDX Support for BPC on BW on HANA

    Hi All,
    I have the following queries on MDX support for BPC on BW on HANA -
    1. What is the current state of Dimension Member formulas (or MDX) with BPC on HANA. Are they natively being evaluated within HANA?
    2. Does BPC on HANA support the same MDX features and functionalities that BPC on any other database would ? Are there any limitations here ?
    Please advise. Thanks.

    Saurabh Diwakar,
    Does note 1714013 gives insight to any of your questions?
    BR
    Prabhith

  • HPCM Reporting Cube Error

    Hi everyone,
    I am hoping that some one is able to help me with this issue. When I deploy the reporting cube from HPCM into essbase I am always greated with a failure on the status. The error message in the log file contains the following : "Caused by: com.essbase.api.base.EssException: Errors found during outline verification.
    NoMember ()".
    The only confusion that I have is that I can successfully deploy the calculation cube? For anyone who is not familiar to HPCM, but might be able to help... is there a big difference in the outline verification of aggregated and block storage (the reporting cube is aggregated storage)?
    Thanks

    We needed to create an ASO cube for a similar use in the recent past. We have evaluated the partitoning option but at the end found it far too complicated than having it disconnected from the planning cube. We have written some maxl scripts which are updating the metadata and loading the data afterwards to the aso cube from bso. The most challenging in this was the conversion of member formulas to MDX but it's not hugely complex, unless you have some very complex member formulas.
    As for the documentation, I think essbase admin guide is quite decent.
    Cheers,
    Alp

  • QTD value in ASO

    Hi All,
    I have a ASO application with Time and Period dimension. The hierarchy of Time dimension is like:
    Time
    ------Total Year
    ------Q1
    ------Jan
    ------Feb
    ------Mar
    The hierarchy of Period dimension is like:
    Period
    -----FY11
    -----FY12
    ------QTD
    Now I write a MDX query as member formula for QTD. Which is:
    IIF
    (IsLevel([TIME].CurrentMember, 0),
    Sum(
    Parent([TIME].CurrentMember).FirstChild:[TIME].CurrentMember,
    [Actuals]),
    Missing
    Now when I retrieve the QTD for any month it always gives #Missing value.
    Can you please help me if I'm missing something?
    Thanks in advance

    garycris wrote:
    A couple of different approaches. If you want to have QTD member that needs to be part of "View Type" Dimension. As Glenn rightly pointed out you have not referenced the member of the Period dim where the data is loaded so your tuple is implied to sum the time members in your formula and their intersection with the QTD member itself.
    You need to add another dim to do these type of calcs, otherwise why not just create alternate hierarchies in Time dim to do QTD?As you suggested to do these type of calcs I need to add another dim, I already have that dim (Period). In my Period dim QTD is sibling of FY12, and Period dim is dynamic.
    Alternate hierarchy is very good solution but if Iwant to move with a member QTD having MDX formula then what should I need to do?

  • Error when processing dimensions

    Hello,
    I'm working with BPC 7.0 NW and I'm trying to process the dimension P_ACC (copied from the APSHELL directly) and I get the following errors:
    "Failed to expand K2 function for dimension P_ACCT's member formulas" and
    "MDX statement error:"You do not have the authorization for component !!"
    Any idea about how to solve this erros?
    Thanks and regards,
    Ana

    Hi Ana
    Its called MDXLib.lgl not MDX.lgl
    find that in the appset apshell and try to copy the same in similar path in your appset.
    I think it must be in logic files folder not sure of exact path.
    But that should not be issue here since you are using direct MDX Query, can you just remove that one formula and process dimension and then remove the cache
    Then add back the formula and then see how it works, then try using some other account for now as divisor (Denominator) and see what happens
    Thanks and Regards
    Harish B K

  • Show all dimension members

    I´m not an experienced user of ssas...
    I have a Dimension in a cube with more than 1000 members. Now I want to define a role where I only want to give access on a few of this members. Therefore I choose the register 'Dimension Data' in a role design and I plan to 'Deselect all members' and
    check the appropriate members which I want to give access in the treeview with all members. Unfortunately not all members are shown in the treeview but only about 1000 --- and the last entry in the treeview is 'Filter members'.
    Can anyone help me how I can show ALL members of the choosen dimension in the treeview so that I can choose my members by selecting them in the treeview.
    Thank you for any help.
    Karsten
    Karsten

    Hi Karsten,
    It's the very useful limit. Imagine that dimension contains over 100 000 or 1000 000 members. Will be easy to select the required members? And you could get the performance problem for this reason.
    So, you may use  Filter members or specify the required member set by MDX
    on Advansed tab.
    Best regards.

  • Many To Many relationship, Distinct Aggregate issue

    Hi, 
    I need some help pleeeaaase... 
    Ok, so i'm implementing a GL cube, and i have a bunch of accounts which can be aggregated to different levels of a parent child hierarchy, because i'm using a parent child hierarchy SSAS does a distinct "sum" to the Fact table, and so my Totals
    get a bit messed up... 
    So, i've tried looking for way to turn off this feature, but couldn't find one.
    The alternative which i'm also stuck on, which is to create a member which goes to the child level, for each total, and re-aggregates ALL the values that are there.
    I seem to have created a member in an MDX query that works perfectly... yay!, BUT when i put this into a calculated member... well it goes pear shaped, and i can't understand how it arrives at the number.. 
    Please shout if my explanation is a bit sketchy..
    Here is the code.
    MDX Query....
    WITH MEMBER [Measures].CurrentBalanceActualDecendants
    AS 
    SUM(
                           EXCEPT(
                                      DESCENDANTS([Dimension Report Detail].[Finance Report Hierachy].CurrentMember, 2, BEFORE),
                                      [Dimension Report Detail].[Finance Report Hierachy].CurrentMember
                         [Measures].[Current month Actual]
    MEMBER [Measures].[BalanceTestc]
    AS( IIF (
                         [Measures].CurrentBalanceActualDecendants = 0, 
                         [Measures].[Current month Actual],
                         [Measures].CurrentBalanceActualDecendants
    SELECT {[Measures].[Current month Actual],
    [Measures].[BalanceTestc]}
    on 0
    DESCENDANTS([Dimension Report Detail].[Finance Report Hierachy].&[4], 3, BEFORE)
    --[Dimension Report Detail].[Finance Report Hierachy].Allmembers
    )on 1
    FROM [opfinanceGLTransaction]
    WHERE { [Dimension Snapshot].[Date Value].&[2014-06-30T00:00:00],
    [Dimension Snapshot].[Date Value].&[2014-05-31T00:00:00],
    [Dimension Snapshot].[Date Value].&[2014-04-30T00:00:00],
    [Dimension Snapshot].[Date Value].&[2014-03-31T00:00:00],
    [Dimension Snapshot].[Date Value].&[2014-02-28T00:00:00],
    [Dimension Snapshot].[Date Value].&[2014-01-31T00:00:00]
    CALCULATED Measure.......
    CREATE MEMBER CURRENTCUBE.[Measures].[Current Month Actual]
     AS IIF(
                         [Measures].CurrentmonthActualDecendants = 0, 
                         [Measures].[Balance],
                         [Measures].CurrentmonthActualDecendants
    VISIBLE = 1 ,  ASSOCIATED_MEASURE_GROUP = 'Fact GL Transaction';   
    CREATE MEMBER CURRENTCUBE.[Measures].CurrentmonthActualDecendants
     AS AGGREGATE(
                           EXCEPT(
                                      DESCENDANTS([Dimension Report Detail].[Finance Report Hierachy].CurrentMember, 2, BEFORE),
                                      [Dimension Report Detail].[Finance Report Hierachy].CurrentMember
                         [Measures].[Balance]
    VISIBLE = 1 ,  ASSOCIATED_MEASURE_GROUP = 'Fact GL Transaction';        

    Have you seen the "Multiple Parent-Child Hierarchies" design pattern in this paper:
    http://www.sqlbi.com/articles/many2many/
    I'm wondering whether you really need such MDX.
    Marco Russo (Blog,
    Twitter,
    LinkedIn) - sqlbi.com:
    Articles, Videos,
    Tools, Consultancy,
    Training
    Format with DAX Formatter and design with
    DAX Patterns. Learn
    Power Pivot and SSAS Tabular.

  • Retriving Uniquenames using mdxquery

    Hi,
    In my requirement,i need unique names ,passing member names using mdx query.
     I have 4000 membernames(2005,2006,2007........4000),so i tried to run below mdxquery, retrive uniquenames.but i am getting error as 'query is too complex'.
    Please help me suitable mdxquery as for my requirement.
    MdxQuery(sample)
    with
    member [Measures].[Uniquenames]
    as [Date].[Calendar Year].currentmember.uniquename
    select {[Measures].[Uniquenames]}
    on columns,
    filter(([Date].[Calendar Year].children),
    ([Date].[Calendar Year].currentmember.name='CY 2005'
    or [Date].[Calendar Year].currentmember.name='CY 2006'
    or [Date].[Calendar Year].currentmember.name='CY 2007'
    or [Date].[Calendar Year].currentmember.name='CY 2008'
    or [Date].[Calendar Year].currentmember.name='CY
    2010')) on rows
    from [Adventure Works]
    PLease help me urgent.if any thing need,please let me know.
    indu

    In my requirement,
    I have names only (CY 2005),i d'not have keys.how can i give below keys.
    {[Date].[Date].&[20050103],[Date].[Date].&[20050104]
    Could you please help me.
    and also what is the limit? how many names should we pass in single query?
    PLease let me know.
    could you please give me suitable mdx query as for my requirement.
    indu
    Hi Sriindu,
    Could you please let us know your dimension structure, and aslo let us know why you can only get dimension member name in this case?
    Generally, we can directly drag the dimension attribute member into MDX design area. Please see the screenshot below:
     how many names should we pass in single query?
    I didn't get any limition information for this. But we will have MDX statement length limit in some scenarios, please see:
    msmdpump limitation on MDX statement length: http://social.msdn.microsoft.com/Forums/sqlserver/en-US/4b0c68ec-0ea1-4018-ba04-b5dfa21aadf0/msmdpump-limitation-on-mdx-statement-length?forum=sqlanalysisservices
    Overcome varchar(8000) or nvarchar(4000) limit in OpenQuery to SSAS:
    http://george-qiao.com/2013/03/13/over-come-varchar8000-or-nvarchar4000-limit-in-openquery-to-ssas/
    Regards,
    Elvis Long
    TechNet Community Support

Maybe you are looking for

  • Want to feel like an Oracle god?  Help a confused student...please!

    I'm three hours from an assignment deadline, and I'm stuck on something so simple that I'm embarrassed to post it here, but I'm desperate. One of my lab assignments is to create a procedure that calculates the tax owed by passing in state and subtota

  • Time Capsule PC Problem

    Help-I have a time capsule which I use to create a wireless network for my home which is located on the second floor. I have trouble connecting a windows vista PC to my network-It doesn't "See" my network as an option in many cases. Any suggestions?

  • Phone+SMS Filter

    Has anyone gotten this to work on their Lumia 928 or Lumia 822. I performed the GDR2/Amber Update to my Lumia with no issue whatsoever but numbers i add to the call block list on the device those numbers are still getting through.

  • Ie is not keeping the session in windows phone browser ie10

    Hi, I have been working on windows web application..App is not keeping the session once the app is closed..I am getting session expired error..I have to proceed the user even after user closed app for certain time.Please some body help me! Thanks

  • Difference bet SD_STO & MM_STO

    Hai, as we all know, that we can transfer the stock by SD route (STO -del- PGI & GR) & MM route ( with diff movement types ) in both process material doc & accounting doc's will be generated. is there any specific reason to create STO process in SD r