MDX

VBA Functions in MDX

Greg Galloway has done some really cool things on the Analysis Services Stored Procedure Project which I’ll be blogging about soon, but in the meantime as part of his research he’s found an interesting white paper by Irina Gorbach on the use of VBA functions in MDX and which ones have been implemented as internal MDX functions to improve performance. Here’s the MSDN Forums thread as background:
And here’s the paper itself:
 

7 thoughts on “VBA Functions in MDX

    1. Chris Webb – My name is Chris Webb, and I work on the Fabric CAT team at Microsoft. I blog about Power BI, Power Query, SQL Server Analysis Services, Azure Analysis Services and Excel.
      Chris Webb says:

      Send me an email (you can find my contact details at http://www.crossjoin.co.uk) and I’ll send you a copy of the paper.

  1. Do you still have the list and background information on VBA functions? I would be interested in because I got a strange behaviour with the datepart function in MDX.
    Example:
    with
    member test as vba!datepart(“w”,’2017-04-24′,2,2 )
    member test2 as vba!datepart(“w”,’2017-04-24′ )
    select
    {test,test2}
    on 0
    from
    [MyCube]

    The query returns on Server A
    test1 test2
    1 2
    and Server B
    test1 test2
    1 1

    where it should always be 1,2 in my Opinion

    Both servers are SSAS 2012

    1. Chris Webb – My name is Chris Webb, and I work on the Fabric CAT team at Microsoft. I blog about Power BI, Power Query, SQL Server Analysis Services, Azure Analysis Services and Excel.
      Chris Webb says:

      Are the servers set up to use different locales? Some countries start their weeks on different weekdays.

      1. My first guess were locals as well, but they are the same. At least the obvious locals settings.

        At second thought, my guess was locals do not make much sense because the VBA description stats the optional parameter FirstDayOfWeekValue has a default on Sunday and is not bound to any local settings.

        ref.:
        https://msdn.microsoft.com/de-de/library/20ee97hz(v=vs.90).aspx

        That is why I hoped to find more info here if mdx datepart is handled internally and if so maybe the implementation is a little different than the regular VB version?

  2. I figured it out it depends on the local settings of the “log on as” account of the SSAS services. Not my obvious choice 🙂

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.