Thursday, July 31, 2014

Except

The Except functionality is of the three Venn Collection functionality's (EXCEPT, INTERSECT, UNION).

Except will give all the members of SET1 which are not in SET2. By default it will remove any duplicates which are in SET1.

Cousin

The Cousin functionality will get you the member on same position as the starting based on a new toplevel member. Most of the time you use it in the same way you use ParallelPeriod.

If you look at a date or calendar dimension is might look like this: All ==> Year ==> Semester ==> Quarter ==> Month ==> Date.

image

If you use a query like this:

Tuesday, July 29, 2014

Descendants

The Descendants functionality although in name de reverse of the Ascendants functionality has a lot more options.

Before you read on just a reminder the Geography hierarchy in the Adventure Works sample is: All ==> Country ==> State-Province ==> City ==> Postal Code.

Let’s start with the base:

SELECT Descendants
   (
    [Geography].[Geography].[Country].&[United States]
   ) ON ROWS
   ,
    [Measures].[Reseller Order Count] on COLUMNS
FROM [Adventure Works]

Ascendants

The Ascendants functionality gives back all levels from and including the current level.
SELECT
   Measures.[Sales Amount] ON COLUMNS,
   Order(
      Ascendants(
      [Product].[Product Categories].[Product].&[448]
      ),
      DESC
   ) ON ROWS
FROM
   [Adventure Works]
where ([Date].[Calendar Year].&[2012])

Ancestor

The Ancestor functionality allows us to find, parents, grand parents, great grand parents etc.… The number of levels you want to go up can be a number or a dedicated level.
The Ancestor with a level of 1 is the same as the .Parent functionality
Let’s try:

AllMembers vs Children

Both do what their name implies Knipogende emoticon .
AllMembers will return All Members on the current level and all levels below.
SELECT
    {       
        ([Date].[Calendar Year].&[2013], [Measures].[Sales Amount])
    }
ON COLUMNS
,
    {
        ([Product].[Product Model Lines].AllMembers)
    } ON ROWS
FROM
   [Adventure Works]

Monday, July 28, 2014

Parent, FirstChild and LastChild

Using the Parent functionality you can get the First Child and Last Child within hierarchy level. 15-JAN-2011 ==> Parent = JAN-2011 ==> FirstChild = 1-JAN-2011 ==> LastChild = 31-JAN-2011.
Here is an example: