Click here to Skip to main content
15,886,422 members
Articles / Database Development / SQL Server
Tip/Trick

Introduction to Named Calculations in SQL Server Analysis Services

Rate me:
Please Sign up or sign in to vote.
4.83/5 (3 votes)
30 Sep 2013CPOL1 min read 42.6K   7   1
Create Virtual Column Using Named Calculation in SQL Server Analysis Services

Introduction

In this Tips I will show you How can you create Virtual Column in Data Source View (DSV) of SQL Server Analysis Services Project in BIDS, How can it benifit to you.

Named Calculation provides you facility to create virtual Column in data source view of SSAS project without changing base table in SQL Server. You can extend your relational schema of the table using Named calculation. Named Calculation gets processed during processing of Cube.

You can Achive Various goals by defining Valid Expression in the box while creating Named Calculation.

Background

This Article is extension of My Previous Article Create First OLAP Cube in SQL Server Analysis Services (SSAS)

Using the code

Example 1: Concatination of Two fields from Customer Table

C++
FirstName +' '+ LastName

Example 2: Calculated Column on DimProduct Table (Profit= salescost-actualcost)

C++
ProductSalesCost - ProductActualCost

Example 3: Ignore Null Value in Character Field

C++
ISNULL(FirstName,'') + ISNULL(LastName,'')

Example 4: Apply various Condition on a Column Values and get MonthName

C++
Case [Month]
 
When 1 Then 'January'
 
When 2 Then 'February'
 
..
 
End

Creating Named Calculation

Open Your SQL Analysis Services Project in Business Intelligence Development Studio.

Step 1 :

Right Click On DimProduct Table In Data Source View --> Click New Named Calculation

Image 1

Step 2 :

Right Click On DimProduct Table In Data Source View --> Click New Named Calculation --> Assign Column Name --> Give Description of Column(optional)--> Specify Expression --> Click OK

Image 2

Step 3: You can see Calculated Column Created Using Named Calculation in Dim Store Table .

Image 3

If you find This Information is useful then do not forget to Book Mark this Tips.

Enjoy the Intelligence.

History

You Can Also Refer to My Previous Articles and Tips to Learn Data Warehouse Concepts and Creation of OLAP Cube using Microsoft SQL Server Analysis Services.


License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect Cybage Software Pvt. Ltd.
India India
Microsoft® Certified Professional (Microsoft Certification ID: 8918672).

Microsoft Certified Technology Specialist with more than 16+ years of expertise to architect and implement effective solutions for Data Analytics, Reporting and Data Visualization solutioning need on Azure Cloud or On-Premise

Technology :
Azure (Data Lake, Data Factory, Synapse Analytics, Databricks, SQL),
Microsoft BI (SSIS, SSAS, SSRS, SQL-Server), C#.Net, Pentaho,
Data Warehousing, Dimension modelling, Snowflake DW, SQL DW, MySQL
Data Visualization using (Tableau, Power BI, QlikView, Pentaho),
Domain : Sales, Retail, CRM, Public Transport, Media & Entertainment, Insurance
Data Integration and Analytics Experience with MS. Dynamic CRM, Salesforce CRM, Dataverse, SAP- FI, Dynamics AX etc.

Linked In Profile:
Click Here to View Linked In Profile

Change will not come if we keep waiting for some other person !!, or keep waiting for some other time !!, We are the one we are waiting for, We are the change that we are looking for.

Comments and Discussions

 
GeneralMy vote of 5 Pin
ssnasp20-Oct-13 2:02
ssnasp20-Oct-13 2:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.