+ Reply to Thread
Results 1 to 4 of 4

CUBE formula to find name based on initials

  1. #1
    Registered User
    Join Date
    08-12-2019
    Location
    Denmark
    MS-Off Ver
    Office 365
    Posts
    39

    CUBE formula to find name based on initials

    Hej everyone,

    I'm in need of some help with a CUBE formula.

    I have two sheets:
    Goal and Oversigt

    In the sheet "Oversigt" cell A2 I have the initials of a person - in this example we could say it was "JOJOH".
    In my Goal sheet, I need the formula to look into my data model and find the initials but it should return the name of the person instead.
    So in this case, it should return "John Johnson".

    I got a similar function to work when creating measures with numbers, but I can't get it to return a single value.
    My formula looks like this:

    =CUBEMEMBER("ThisWorkbookDataModel";"[Medarbejdere1].[Initialer].&["&Oversigt!$A2&"]")

    Medarbejdere1 is the datamodel data for all our co-workers and the column "Initialer" is the column with the lookup value (JOJOH). I need it to return the value in the column called "Navn" that matches the value in column "Initialer".

    Currently my formula is returning the value from initials, so basically the value is the exact same as the value in Oversigt A2. I have tried to change the formula to
    =CUBEMEMBER("ThisWorkbookDataModel";"[Medarbejdere1].[Navn].&["&Oversigt!$A2&"]")
    But it still does not work.


    Can you help me?


    Thanks in advance
    B

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: CUBE formula to find name based on initials

    I blogged about this 5 years ago , https://wessexbi.wordpress.com/2014/...th-powerpivot/

    You need some MDX in your CUBEMEMBER function

    Please Login or Register  to view this content.
    If you coud get multiple children, i.e. people with same initials, you need to add a CUBESET and CUBERANKEDMEMBER function into the mix.

  3. #3
    Registered User
    Join Date
    08-12-2019
    Location
    Denmark
    MS-Off Ver
    Office 365
    Posts
    39

    Re: CUBE formula to find name based on initials

    Hej Bob,

    Thank you so much for the formula. At first, I couldn't get it to work, since you use the english keys - and changing the keys didn't work.
    When trying one by one, and keeping the key "comma" after Children it now works!

    You are awesome!


    Final formula: =CUBEMEMBER("ThisWorkbookDataModel";"EXISTS([Medarbejdere1].[Navn].Children,[Medarbejdere1].[Initialer].&["&Oversigt!$A$2&"])")

    Thanks
    B

  4. #4
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: CUBE formula to find name based on initials

    Sorry about that B, I know that in Denmark you use semi-colons as separators not commas as we do. As you saw, and as Imke Feldman noted in a comment to my blog post, even if you do use semi-colons, the MDX part has to use commas, presumably the MDX authors didn't include localisation.

    BTW, I think it is useful to keep the IFERROR, just in case A2 contains an invalid set of initials, maybe add a meaningful error

    =IFERROR(CUBEMEMBER("ThisWorkbookDataModel";"EXISTS([Medarbejdere1].[Navn].Children,[Medarbejdere1].[Initialer].&["&Oversigt!$A$2&"])"),"Initials not found")

    localised for Denmark of course.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Cube functions - multiple cube members same value returns inaccurate total
    By emcfportal in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-03-2017, 10:59 AM
  2. [SOLVED] Automatically export columns to a separate sheet based on initials.
    By Starmusk10 in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 07-11-2016, 08:20 AM
  3. [SOLVED] If function excel 2003 based on initials.
    By goldfield in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-12-2014, 01:34 PM
  4. Find all initials in Full Name...?
    By question.maker in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-11-2013, 04:08 PM
  5. [SOLVED] Formula required for initials of names and combining initials with other text
    By iDarkAngel in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 07-07-2012, 11:22 AM
  6. Trying to populate labor rate based on initials
    By wchatx in forum Excel General
    Replies: 2
    Last Post: 08-12-2011, 03:33 PM
  7. [SOLVED] cube analysis add -in for excel and local cube
    By swetha in forum Excel General
    Replies: 0
    Last Post: 07-28-2006, 04:30 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1