Search code examples
sql-serversql-server-2005ssasbusiness-intelligence

SSAS 2005 MDX expression with .all attributes


I have the following measure calculation:

            CREATE MEMBER CURRENTCUBE.[Measures].[SOR - Sold Out Rate]
            AS IIF(
                 ([Measures].[SOR - Quantity] = 0) 
                 ,NULL
                 ,[Measures].[SOR - Sold Out Positions]
                  /
                  ([Measures].[SOR - Quantity]
                     , [Dim Core].[Core].[All] 
                         , [Dim More].[More].[All]
                        , [Dim Extended].[Extended].[All]
                        , [Dim Point Of Sales].[Point Of Sales].[All]
                        , [Dim Point Of Sales Type].[POS Type].[All]
                        , [Dim Product].[Product].[All]
                        , [Dim Product AVA Status].[AVA Status].[All]
                        , [Dim Product AVA Type].[AVA Type].[All]
                        , [Dim Product Category].[Product Category].[All]
                     , [Dim Calendar].[Gregorian Calendar].CurrentMember
                   )
                ), 
            FORMAT_STRING = "Percent", 
            VISIBLE = 1 ,  ASSOCIATED_MEASURE_GROUP = 'Fact Sold Out Rate'  ;  

What is the [Dim ].[].[All] meaning? I am dividing by a quantity that is calculated previously okay, but I cannot manage to understand the use of the attributes with .all?

Thanks


Solution

  • I am currently learning DAX and I have just understood what .ALL is (saw something equivalent in DAX).

    It simply means create a context that includes ALL records or in other words; it means exclude any user selection through slicer or whatsoever to perform the calculation. Of course except for the date where we take the current member.

    So to translate:

    Divide the Sold-out-Position by the sum of the quantity on the current date for ALL products.