I was recently asked by a SSAS developer about how to set up a role-playing dimension so I did a brief demo to show how to set it up. In this post, I am document the steps to help you get started:
What is role-playing dimension?
What if you want to see sales data by Order Date as well as Shipped Date? You can one date dimension that is used more than once for seeing sales data by order date and shipped date. In this case, date dimension becomes a Role Playing Dimension.
Steps:
1. Open SQL Server Data Tools and SSAS project that you are working on.
2. Go to Data Source Views from the solution explorer.
3. Make sure that the relationships are specified between dimension (e.g. date dimension) and Fact Table (e.g. Fact Sales). Example: If you’ve OrderDateSK and ShippedDateSK in your fact table, then establish a relationship between the both columns with the Primary Key of the Date dimension.
Note: If you do not have the relationships specified in the data source views, there’s an alternative to go to dimension usage for a cube and setup role playing dimensions. since this is targeted to get you started, I am not covering the steps for that.
4. Now go to the Dimensions section in the solution explorer and add a Dimension that uses the existing data source view from step #3.
5. switch to Cubes.
Now, if you don’t have a cube created yet then you can use the cube wizard if you want and as long as you have the relationships specified at DSV’s, it should create a role-playing dimension.
Alternatively, you can also create a new dimension. In the Design pane, lower left section, you’ll see dimensions.
select your dimension that you created in step #4 that’s a role-playing dimension from the list and click on OK. And it creates a role-playing dimension for you! So all you had to do was to make sure the relationships are created between the fact and (role-playing) dimension table and SSAS does the rest of the work for you
Note: for the demo I didin’t rename the dimension attributes but you do all that good stuff too when you are building the cube for users!
Conclusion:
In this post you got started on how to add a role-playing dimension in a SSAS cube.
I helped a user today to sort measure values in his excel based ad-hoc report using SSAS cubes & so I’m posting the tips here for note-keeping. There are two ways to do this & here they are:
#1: Select a cell that has a measure value > Right click > Sort > sort the values in ascending or descending from here:
#2: Alternatively, you can also do the same thing by: Select a value from the filed that needs sorting > go to Home Tab > Sort & Filter > from here you should be able to sort data in ascending for descending order:
Conclusion:
In this post, I shared two ways you can sort the measure values in an excel based ad-hoc report using SSAS cubes. Do you allow excel based ad-hoc reporting over SSAS cubes in your organization?
In my case, I had 64-bit excel so I’ll download the 64-bit version of OLAP Pivot Table extensions.
Close Excel and Install add-in
3) Add simple measure
Open Excel.
Connect to Cube.
Let’s add a simple measure that calculates the difference between two measures.
So I created a simple Pivot Table that looks like:
Now let’s add a calculated measure:
Select the Pivot Table > Right Click > OLAP Pivot Table Extensions
On the next screen, please enter the name Difference. and the simple formula:
[Measures].[Meausre1]-[Measures].[Measure2]
(please replace measure1 & measure2 with the measure names from your cube)
And click on Add to Pivot Table
You can now see that the calculated measure Difference got added to the Pivot Table!
Note
1) OLAP Pivot Table extensions is not supported by Microsoft. It’s a community software.
2) To maintain the single version of truth (after all that’s why you create cubes/Data-warehouse’s!), it’s recommended that calculated measures that end users want in the cube.
That’s about it for this post! Your feedback is most welcome!
There’s a Power Pivot Model. It imports some number of columns from a table. Now, there’s a need to import an additional column to this table. How do you do that?
Solution:
Here are the steps:
1. Open Power Pivot Model.
2. Go to Design Tab.
3. Click on Table Properties:
4. From here, You can add additional columns:
5. click on save and that should add the column to your model:
FAQ:
#1: I can’t see what you see inside Design Tab. What do I do?
#2: How about changing the data source & pointing to new cube/database? It’s very helpful when you switch between QA, Dev or PROD servers. Here are the steps:
you can do that too! Go to Design > Existing connections > Select Connection > Edit > Make changes > Test it! > Save > “Refresh”. Any Problems? No? Great. That’s Done!
In this blog post, we’ll see steps to Parametrize a SQL Server Reporting Services report where data source is Analysis services (SSAS) cube:
Step 1: Let’s say you have reached to a point with your SSRS report where you’ve configured your data source, data sets and data fields that you want to use for your report. For the purpose of this blog post, I’ll be starting with a SSRS report that shows Sales VS country names:
Step 2: Now, let’s say the requirement are such that you want to parametrize the report by a data field in the Analysis services cube: continents
Step 3: Switch to Design View. Now navigate to query designer: Select your Data-set > Right Click > DataSet Properties > Query > Query Designer
Step 4: Drag the field to the filter area. For the purpose of this blog post, I am going to select Continent Name and add it to Filter area.
To add a field to filter area, there are two options:
#1: Select the field > Right click > Add to Filter
#2: Select the field > use your mouse to drag it to filter area
Step 5: Once you’ve added your desired field to the filter area, we’ll have to add it as parameter.
Now chances are that you are not seeing the parameter check box for this field because the dialog box is minimized. You can either maximize the dialog box or scroll to the right side of the filter area.
Once you see it, check it > click ok
Step 6: Once you’re back on Design View. Try “preview” report. you should be able to see the option to select parameter value before the report gets populated with data:
I selected Europe and then clicked on view report:
Step 7: One last thing, Let me also point out how you can change the properties of the parameters.
Go Back to design view > from the report data pane > Expand parameters folders > select the parameter > Parameter Properties
I’ll leave you with exploring what you can do with parameter properties! And with that I conclude this blog post, Your comments are very welcome!
I was developing a SQL Server Reporting Services report from data that was coming from Analysis Services cube. And when I created the report having Month Names, it was not sorting it correctly.
It was:
April, August, February, Jan….
But It should have been:
Jan, Feb, Mar…
because I had correct sorting settings in the cube. So what was wrong? Or what can we fix?
Solution:
Turns out, the solution was pretty simple. Here are the steps:
1) Select the chart.
2) Select the Month Name category group
3) Go to Properties
4) Go to Sorting section
And delete the sorting property that sorts the Month Names by A to Z. seems this overrides over sorting properties that’s in the cube.
5) After deleting the sorting property in SSRS fixs the issue.
Please preview the report to see if the issue has been resolved for you.
In this blog post. I’ll help you get started w/ implementing dynamic security with row filters in Tabular Models.
Scenario:
We’ve users that connect to a Tabular Model via Excel for Data Analysis purposes. One of the analysis that they do is Countries VS. Total Margin:
What we want to do is restrict someone from Europe to see data only about France, Germany and United Kingdom
Solution:
1) Open Tabular Model in SSDT (SQL Server Data Tools)
2) Toolbar > Model > Roles
3) Role Manager > NEW > change Name to Europe and Permissions to Read
4) Under the Row Filters, for the Geography Table, enter the following code:
=[Country Region Name]=”France” || [Country Region Name]=”Germany” || [Country Region Name]=”United Kingdom”
How to edit code for your scenario? change the [country region name] to your column(s) and also change the values
5) Click OK
6) Now let’s test it!
7) Toolbar > Model > Analyze in Excel
8) Select the role Europe
9) Click ok.
10) From Pivot Table, Select Margin & Countries:
11) As you can see, since the role Europe was selected for testing purpose in step 8 – ONLY France, Germany and UK data is shown in our test! This means that our row filters are working perfectly!
I hope this tutorial helps you get started on implementing dynamic security in Tabular models.
In this blog post, we’ll see a step by step guide to install Data Mining Excel add-in in excel that would help you carry out data mining in Excel.For the purpose of this blog-post, I am going to install add-in for Excel 2010 and SQL Server Analysis services server 2012.
It’s important to note that this add-in acts as an interface between Excel and “SQL Server Analysis services (SSAS)”. So SSAS is the place where data mining wizardry takes place and EXCEL acts as a client.
Here are the steps:
1) Search for “Microsoft SQL Server 2012 Data Mining add-ins for Microsoft office 2010”. AND Download the add-in.
2) Run the Setup > To go forward you have to accept license agreement.
3) Select “Data Mining for Excel” as a feature that’s supposed to be installed:
4) Next > Install.
After it is successfully installed, open Excel.
5) Now in EXCEL 2010, can you see the Data Mining Tab?
6) There’s more. You’re not done yet.
Did you see a “Getting started” dialog box too. If not, click on “getting started” from the Start Menu:
7) Now, if you have SSAS – then select “Use an Existing Instance of Microsoft SQL Server 2008 or later analysis server that I administer ”
But if you do NOT have SSAS, then you could consider installing the Evaluation copy.
For this blog-post, we’ll go with the first option:
8) Now, can you see the instructions? They read like this:
You have chosen to download the Microsoft SQL Server 2012 Enterprise Evaluation Edition.
The Microsoft SQL Server 2012 Enterprise Evaluation Edition is fully-functional 180-day trial software.
Microsoft SQL Server 2012 is a data management and analysis solution that enables companies of all sizes to gain greater insight from their business information, apply that insight to enhance their decision-making process, and achieve faster business results for a competitive advantage.
You now have 2 more steps to complete to start using the Microsoft SQL Server 2012 Data Mining Add-ins for Office.
Step 1. Download the Microsoft SQL Server 2012 Enterprise Evaluation Edition The typical evaluation installation of SQL Server 2012 does not include the Analysis Services part of the product by default. When installing Microsoft SQL Server 2012, you must install Analysis Services.
Step 2. Configure SQL Server 2008 (or later) Analysis Services so that the Microsoft SQL Server 2012 Data Mining Add-ins for Office will work correctly You can now run the SQL Server 2012 Data Mining Add-ins for Office Configuration Utility that is part of the installation. This tool will do everything for you in order to get your SQL Server 2008 (or later) Analysis Services instance configured correctly for use with the Microsoft SQL Server 2012 Data Mining Add-ins for Office.
Click the link below to run the application that will allow you to configure SQL Server 2012: C:Program Files (x86)Microsoft SQL Server 2012 DM Add-InsMicrosoft.SqlServer.DataMining.Office.ServerConfiguration.exe
Once you have completed Steps 1 and 2, click the Finish button below.
Let’s follow the above steps:
9) Download SQL Server Enterprise Evaluation copy for yourselves.
10) After Downloading the copy – run the SQL Server Setup. These are the steps to install a SSAS:
step a – e
a. Installation > New SQL Server Stand-alone installation or add features to existing installation
b. Run Setup support rules > Ok.
c. In the “Specify a free edition”, select “Evaluation” > Next
d. To go forward, you’ll have to accept the terms.
e. Now, you’ll see the SQL Server setup. These are my screenshots while I installed the evaluation copy on my machine – refer to them while you are installing:
Note: I am installing it on my Demo Machine, This is NOT how it’s done in Enterprises. The goal of our demo machine is to get acquainted with the Data Mining features in Microsoft SQL Server.
Here are the screenshots
Click on Select All features. And I unchecked “Distributed replay controller” and “Display replay client”.
One of the task while building a PowerPivot Model is to create/Edit/Delete Relationships between tables. With SQL Server 2012 release of PowerPivot for Excel, we now have a Diagram view and this makes our task of defining relationships easier! Great addition. Any-who when you view your model in Diagram Model, This is how it looks:
To Edit a Relationship, You can click on the Relationship represented by the arrow and it would pop up an “Edit Relationship” Dialog Box.
But what if you wanted to Manage ALL relationships of this Model? You can do this!
GO TO Design Tab > Click On Manage Relationships.
Now here you can manage (create/edit/delete) relationships among tables. Very easy!
That’s about it for this post. Your feedback is welcome!
I got a chance to play with power-view which seems like great feature of SQL Server 2012! And I liked it that we can create Hans Rosling styled BI dashboard’s with Powerview. For those who do not know about Hans Rosling presentations, check these collection: All Hans Roslings Ted Videos.
And by studying modules in SQL server Training kit 2012, I was able to create a similar Dashboard, It was fun!
Now, Listing resources for you, If you are Interested to learn about Powerview: