In SQL Server Analysis Services, a Named Calculation is nothing but creating new column and add it to a Table or View in Data Source View. Named Calculation is created based on the expression or some static value or combination of existing columns. Following are the important features of the Named Calculations
- Named Calculation allows you to add an extra column to the Tables or Views present in the SSAS Data Source View.
- All the Columns created using the Named Calculations belongs to Data Source View only and they are independent of underlying Data Source (Server).
- We can create Calculated Column by combining one or more columns from underlying data source View. For instance finding the Full Name by combining First Name and Last Name
- We can create Named Calculation to hold any static value also
- We can create Named Calculation using SQL Expressions. For instance calculating the profits, Tax, Product waste etc
- All the Named Calculations are calculated during the processing time, this may slow down the processing time.
Creating Named Calculations in SSAS
Click on the Data Source Views folder in Solution Explorer and then click on the created Data Source View. Please refer SSAS Data Source View article to understand, How to create Data Source View in SSAS.
Below screenshot will show you Data Source View
Right Click on DimEmployee Table in Data Source View will open the Context Menu with multiple options.
Select the New Named Calculation option from the context menu
When you click on the New named calculation option an Edit Named Calculation window form (as shown in below screenshot) will open to create the named calculation.
- Column name is the Name you want to display to the end-user
- Description is to describe what this Named Calculation will do. It is optional but very important in real-time.
- Expression is the place used to write SQL expression or any Static Value.
In this example we are creating Full Name by combining the FirstName and LastName Column in DimEmployee table.
Expression: FirstName + ‘ ‘ + LastName
Click ok button to finish creating Named Calculation and check the Data Source View. You can see the Calculated Column (Created by Named Calculation) in Dim Employee Table. You can also observe small tiff before the column name.
Thank you for Visiting Our Blog