SSAS – Negative total value

Standard

We encountered a strange issue when connecting to analysis services through Excel where all of the row level sums were correct, however the total value was a negative, as per below:

IntBarrier3.PNG

As you can see the row level sums are all positives, but the grand total is a negative, why?

The underlying data is all positive, however the underlying datatype in the database is a small int, however there are 6 billion rows in the table.

The issue is that when SSAS sums those 6 billion rows of small int values the total ends up breaking the INT barrier (2,147,483,647) which Excel displays as a negative.

The measure group will inherit its data type from the underlying view and attempt to use that:

IntBarrier1.PNG

To fix this issue you need to alter the data type in the Source and then either leave the DataType in Advanced as Inherit, or change it to BigInt:

IntBarrier.PNG

Now when you deploy and process your cube, the issue should be resolved!

Connecting to Analysis Services through Excel

Standard

Just a quick one with some pretty pictures..

Step 1: Select a nice blank cell in Excel (B4 for instance)

ExcelConnect1

Step 2: From the Data tab on the ribbon, select From Other Sources > From Analysis Services

ExcelConnect2

Step 3: Enter the name of the server you want to connect to

ExcelConnect3

Step 4: Click Next and then select the name of the Cube to which you want to connect from the dropdown

ExcelConnect4

Step 5: Select the location of your new pivot table

ExcelConnect5

Step 6: click OK and Robert’s your Mother’s brother.