Monday, July 28, 2014

More dimensions on rows

Let’s add a second dimension to our query:

SELECT
    {
     [Measures].[Sales Amount]   
    } ON COLUMNS
    ,   
    NON EMPTY
    {
      [Date].[Calendar Year].Children
    , [Product].[Product Model Lines].Children
    }                    
    ON ROWS
FROM
    [Adventure Works]

Hmmmm, we get an error:

“Members, tuples or sets must use the same hierarchies in the  function.”

The problem is a couple of missing brackets “( )”

Try this:

SELECT
    {
     [Measures].[Sales Amount]   
    } ON COLUMNS
    ,   
    NON EMPTY
    {
      (
          [Date].[Calendar Year].Children
        , [Product].[Product Model Lines].Children
      )
    }                    
    ON ROWS
FROM
    [Adventure Works]

And we get:

image

Have Fun And Till Next Time

1 comment: