Beruflich Dokumente
Kultur Dokumente
APPLIES TO: SQL Server Azure SQL Database Azure SQL Data Warehouse Parallel Data
Warehouse
SQL Server is a central part of the Microsoft data platform. SQL Server is an industry leader in operational
database management systems (ODBMS ). This documentation helps you install, configure, and use SQL Server on
both Windows and Linux. The content includes end-to-end examples, code samples, and videos. For SQL Server
language topics, see Language Reference.
SQL Server is a central part of the Microsoft data platform. SQL Server is an industry leader in operational
database management systems (ODBMS ). This documentation helps you install, configure, and use SQL Server on
Windows. The content includes end-to-end examples, code samples, and videos. For SQL Server language topics,
see Language Reference.
What's New in SQL Server 2019 SQL Server 2019 Release Notes
What's New in SQL Server 2017 SQL Server 2017 Release Notes
What's New in SQL Server 2016 SQL Server 2016 Release Notes
What's New in SQL Server 2019 SQL Server 2019 Release Notes
What's New in SQL Server 2017 SQL Server 2017 Release Notes
NOTE
SQL Server 2019 preview is now available. For more information, see What's New in SQL Server 2019.
What's New in SQL Server 2016 SQL Server 2016 Release Notes
Database Engine
Integration Services
Analysis Services
Replication
Samples
Wide World Importers sample database
AdventureWorks sample databases and scripts for SQL Server 2016
SQL Server samples on GitHub
Get Help
All the ways to get help
UserVoice - Suggestion to improve SQL Server?
Setup and Upgrade - MSDN Forum
SQL Server Data Tools - MSDN forum
Transact-SQL - MSDN forum
SQL Server Security - MSDN Forum
DBA Stack Exchange (tag sql-server) - ask SQL Server questions
Stack Overflow (tag sql-server) - also has some answers about SQL development
Reddit - general discussion about SQL Server
Microsoft SQL Server License Terms and Information
Support options for business users
Contact Microsoft
Edit SQL Docs
SQL Docs Feedback
SQL Docs Survey
Analysis Services is an analytical data engine used in decision support and business analytics. It provides
enterprise-grade semantic data models for business reports and client applications such as Power BI, Excel,
Reporting Services reports, and other data visualization tools.
A typical workflow includes creating a tabular or multidimensional data model project in Visual Studio, deploying
the model as a database to a server instance, setting up recurring data processing, and assigning permissions to
allow data access by end-users. When it's ready to go, your semantic data model can be accessed by client
applications supporting Analysis Services as a data source.
Analysis Services is available in two different platforms:
Azure Analysis Services - Supports tabular models at the 1200 and higher compatibility levels. DirectQuery,
partitions, row -level security, bi-directional relationships, and translations are all supported. To learn more, see
Azure Analysis Services.
SQL Server Analysis Services - Supports tabular models at all compatibility levels, multidimensional models,
data mining, and Power Pivot for SharePoint.
Documentation by area
In general, Azure Analysis Services documentation is included with Azure documentation. If you're interested in
having your tabular models in the cloud, it's best to start there. This article and documentation in this section is
mostly for SQL Server Analysis Services. However, at least for tabular models, how you create and deploy your
tabular model projects is much the same, regardless of the platform you're using. Check out these sections to learn
more:
Comparing Tabular and Multidimensional Solutions
Install SQL Server Analysis Services
Tabular models
Multidimensional models
Data Mining
Power Pivot for SharePoint
Tutorials
Server management
Developer documentation
Technical reference
See also
Azure Analysis Services documentation SQL Server Documentation
What's New in Analysis Services
12/10/2018 • 13 minutes to read • Edit Online
APPLIES TO: SQL Server 2016 Analysis Services Azure Analysis Services
SQL Server 2016 Analysis Services includes many new enhancements providing improved performance, easier
solution authoring, automated database management, enhanced relationships with bi-directional cross filtering,
parallel partition processing, and much more. At the heart of most enhancements for this release is the new 1200
compatibility level for tabular model databases.
What's new in SQL Server 2016 Service Pack 1 (SP1) Analysis Services
Download SQL Server 2016 SP1
SQL Server 2016 Service SP1 Analysis Services provides improved performance and scalability through Non-
Uniform Memory Access (NUMA) awareness and optimized memory allocation based on Intel Threading
Building Blocks (Intel TBB ). This new functionality helps lower Total Cost of Ownership (TCO ) by supporting
more users on fewer, more powerful enterprise servers.
In particular, SQL Server 2016 SP1 Analysis Services features improvements in these key areas:
NUMA awareness - For better NUMA support, the in-memory (VertiPaq) engine inside Analysis Services
now maintains a separate job queue on each NUMA node. This guarantees the segment scan jobs run on the
same node where the memory is allocated for the segment data. Note, NUMA awareness is only enabled by
default on systems with at least four NUMA nodes. On two-node systems, the costs of accessing remote
allocated memory generally doesn't warrant the overhead of managing NUMA specifics.
Memory allocation - Analysis Services has been accelerated with Intel Threading Building Blocks, a scalable
allocator that provides separate memory pools for every core. As the number of cores increases, the system
can scale almost linearly.
Heap fragmentation - The Intel TBB -based scalable allocator also helps to mitigate performance problems
due to heap fragmentation that have been shown to occur with the Windows Heap.
Performance and scalability testing showed significant gains in query throughput when running SQL Server 2016
SP1 Analysis Services on large multi-node enterprise servers.
Modeling
Improved modeling performance for tabular 1200 models
For tabular 1200 models, metadata operations in SSDT are much faster than tabular 1100 or 1103 models. By
comparison, on the same hardware, creating a relationship on a model set to the SQL Server 2014 compatibility
level (1103) with 23 tables takes 3 seconds, whereas the same relationship on a model created set to compatibility
level 1200 takes just under a second.
Project templates added for tabular 1200 models in SSDT
With this release, you no longer need two versions of SSDT for building relational and BI projects. SQL Server
Data Tools for Visual Studio 2015 adds project templates for Analysis Services solutions, including Analysis
Services Tabular Projects used for building models at the 1200 compatibility level. Other Analysis Services
project templates for multidimensional and data mining solutions are also included, but at the same functional
level (1100 or 1103) as in previous releases.
Display folders
Display folders are now available for tabular 1200 models. Defined in SQL Server Data Tools and rendered in
client applications like Excel or Power BI Desktop, display folders help you organize large numbers of measures
into individual folders, adding a visual hierarchy for easier navigation in field lists.
Bi-directional cross filtering
New in this release is a built-in approach for enabling bi-directional cross filters in tabular models, eliminating the
need for hand-crafted DAX workarounds for propagating filter context across table relationships. Filters are only
auto-generated when the direction can be established with a high degree of certainty. If there is ambiguity in the
form of multiple query paths across table relationships, a filter won't be created automatically. See Bi-directional
cross filters for tabular models in SQL Server 2016 Analysis Services for details.
Translations
You can now store translated metadata in a tabular 1200 model. Metadata in the model includes fields for Culture,
translated captions, and translated descriptions. To add translations, use the Model > Translations command in
SQL Server Data Tools. See Translations in tabular models (Analysis Services) for details.
Pasted tables
You can now upgrade an 1100 or 1103 tabular model to 1200 when the model contains pasted tables. We
recommend using SQL Server Data Tools. In SSDT, set CompatibilityLevel to 1200 and then deploy to a SQL
Server 2017 instance of Analysis Services. See Compatibility Level for Tabular models in Analysis Services for
details.
Calculated tables in SSDT
A calculated table is a model-only construction based on a DAX expression or query in SSDT. When deployed in a
database, a calculated table is indistinguishable from regular tables.
There are several uses for calculated tables, including the creation of new tables to expose an existing table in a
specific role. The classic example is a Date table that operates in multiple contexts (order date, ship date, and so
forth). By creating a calculated table for a given role, you can now activate a table relationship to facilitate queries
or data interaction using the calculated table. Another use for calculated tables is to combine parts of existing
tables into an entirely new table that exists only in the model. See Create a Calculated Table to learn more.
Formula fixup
With formula fixup on a tabular 1200 model, SSDT will automatically update any measures that is referencing a
column or table that was renamed.
Support for Visual Studio configuration manager
To support multiple environments, like Test and Pre-production environments, Visual Studio allows developers to
create multiple project configurations using the configuration manager. Multidimensional models already leverage
this but tabular models did not. With this release, you can now use configuration manager to deploy to different
servers.
Instance management
Administer Tabular 1200 models in SSMS
In this release, an Analysis Services instance in Tabular server mode can run tabular models at any compatibility
level (1100, 1103, 1200). The latest SQL Server Management Studio is updated to display properties and provide
database model administration for tabular models at the 1200 compatibility level.
Parallel processing for multiple table partitions in tabular models
This release includes new parallel processing functionality for tables with two or more partitions, increasing
processing performance. There are no configuration settings for this feature. For more information about
configuring partitions and processing tables, see Tabular Model Partitions.
Add computer accounts as Administrators in SSMS
Analysis Services administrators can now use SQL Server Management Studio to configure computer accounts to
be members of the Analysis Services administrators group. In the Select Users or Groups dialog, set the
Locations for the computers domain and then add the Computers object type. For more information, see Grant
server admin rights to an Analysis Services instance.
DBCC for Analysis Services
Database Consistency Checker (DBCC ) runs internally to detect potential data corruption issues on database load,
but can also be run on demand if you suspect problems in your data or model. DBCC runs different checks
depending on whether the model is tabular or multidimensional. See Database Consistency Checker (DBCC ) for
Analysis Services tabular and multidimensional databases for details.
Extended Events updates
This release adds a graphical user interface to SQL Server Management Studio to configure and manage Analysis
Services Extended Events. You can set up live data streams to monitor server activity in real time, keep session
data loaded in memory for faster analysis, or save data streams to a file for offline analysis. For more information,
see Monitor Analysis Services with SQL Server Extended Events and Using extended events with Analysis
Services (Guy in a Cube blog post and video).
Scripting
PowerShell for Tabular models
This release includes PowerShell enhancements for tabular models at compatibility level 1200. You can use all of
the applicable cmdlets, plus cmdlets specific to Tabular mode: Invoke-ProcessASDatabase and Invoke-
ProcessTable cmdlet.
SSMS scripting database operations
In the latest SQL Server Management Studio (SSMS ), script is now enabled for database commands, including
Create, Alter, Delete, Backup, Restore, Attach, Detach. Output is Tabular Model Scripting Language (TMSL ) in
JSON. See Tabular Model Scripting Language (TMSL ) Reference for more information.
Analysis Services Execute DDL Task
Analysis Services Execute DDL Task now also accepts Tabular Model Scripting Language (TMSL ) commands.
SSAS PowerShell cmdlet
SSAS PowerShell cmdlet Invoke-ASCmd now accepts Tabular Model Scripting Language (TMSL ) commands.
Other SSAS PowerShell cmdlets may be updated in a future release to use the new tabular metadata (exceptions
will be called out in the release notes).
See Analysis Services PowerShell Reference for details.
Tabular Model Scripting Language (TMSL ) supported in SSMS
Using the latest version of SSMS, you can now create scripts to automate most administrative tasks for tabular
1200 models. Currently, the following tasks can be scripted: Process at any level, plus CREATE, ALTER, DELETE at
the database level.
Functionally, TMSL is equivalent to the XMLA ASSL extension that provides multidimensional object definitions,
except that TMSL uses native descriptors like model, table, and relationship to describe tabular metadata. See
Tabular Model Scripting Language (TMSL ) Reference for details about the schema.
A generated JSON -based script for a tabular model might look like the following:
{
"create": {
"database": {
"name": "AdventureWorksTabular1200",
"id": "AdventureWorksTabular1200",
"compatibilityLevel": 1200,
"readWriteMode": "readWrite",
"model": {}
}
}
}
The payload is a JSON document that can be as minimal as the example shown above, or highly embellished with
the full set of object definitions. Tabular Model Scripting Language (TMSL ) Reference describes the syntax.
At the database level, CREATE, ALTER, and DELETE commands will output TMSL script in the familiar XMLA
window. Other commands, such as Process, can also be scripted in this release. Script support for many other
actions may be added in a future release.
DAX
Improved DAX formula editing
Updates to the formula bar help you write formulas with more ease by differentiating functions, fields and
measures using syntax coloring, it provides intelligent function and field suggestions and tells you if parts of your
DAX expression are wrong using error squiggles. It also allows you to use multiple lines (Alt + Enter) and
indentation (Tab). The formula bar now also allows you to write comments as part of your measures, just type "//"
and everything after these characters on the same line will be considered a comment.
DAX variables
This release now includes support for variables in DAX. Variables can now store the result of an expression as a
named variable, which can then be passed as an argument to other measure expressions. Once resultant values
have been calculated for a variable expression, those values do not change, even if the variable is referenced in
another expression. For more information, see VAR Function.
New DAX functions
With this release, DAX introduces over fifty new functions to support faster calculations and enhanced
visualizations in Power BI. To learn more, see New DAX Functions.
Save incomplete measures
You can now save incomplete DAX measures directly in a tabular 1200 model project and pick it up again when
you are ready to continue.
Additional DAX enhancements
Non empty calculation - Reduces the number of scans needed for non empty.
Measure Fusion - Multiple measures from the same table will be combined into a single storage engine -
query.
Grouping sets - When a query asks for measures at multiple granularities (Total/Year/Month), a single - query
is sent at the lowest level and the rest of the granularities are derived from the lowest level.
Redundant join elimination - A single query to the storage engine returns both the dimension columns and the
measure values.
Strict evaluation of IF/SWITCH - A branch whose condition is false will no longer result in storage engine
queries. Previously, branches were eagerly evaluated but results discarded later on.
Developer
Microsoft.AnalysisServices.Tabular namespace for Tabular 1200 programmability in AMO
Analysis Services Management Objects (AMO ) is updated to include a new tabular namespace for managing a
Tabular Mode instance of SQL Server 2016 Analysis Services, as well as provide the data definition language for
creating or modifying tabular 1200 models programmatically. Visit Microsoft.AnalysisServices.Tabular to read up
on the API.
Analysis Services Management Objects (AMO ) updates
Analysis Services Management Objects (AMO ) has been re-factored to include a second assembly,
Microsoft.AnalysisServices.Core.dll. The new assembly separates out common classes like Server, Database, and
Role that have broad application in Analysis Services, irrespective of server mode.
Previously, these classes were part of the original Microsoft.AnalysisServices assembly. Moving them to a new
assembly paves the way for future extensions to AMO, with clear division between generic and context-specific
APIs.
Existing applications are unaffected by the new assemblies. However, should you choose to rebuild applications
using the new AMO assembly for any reason, be sure to add a reference to Microsoft.AnalysisServices.Core.
Similarly, PowerShell scripts that load and call into AMO must now load Microsoft.AnalysisServices.Core.dll. Be
sure to update any scripts.
JSON editor for BIM files
Code View in Visual Studio 2015 now renders the BIM file in JSON format for tabular 1200 models. The version
of Visual Studio determines whether the BIM file is rendered in JSON via the built-in JSON Editor, or as simple
text.
To use the JSON editor, with the ability to expand and collapse sections of the model, you will need the latest
version of SQL Server Data Tools plus Visual Studio 2015 (any edition, including the free Community edition). For
all other versions of SSDT or Visual Studio, the BIM file is rendered in JSON as simple text. At a minimum, an
empty model will contain the following JSON:
```
{
"name": "SemanticModel",
"id": "SemanticModel",
"compatibilityLevel": 1200,
"readWriteMode": "readWrite",
"model": {}
}
```
WARNING
Avoid editing the JSON directly. Doing so can corrupt the model.
New elements in MS-CSDLBI 2.0 schema
The following elements have been added to the TProperty complex type defined in the [MS-CSDLBI] 2.0 schema:
ELEMENT DEFINITION
DefaultValue A property that specifies the value used when evaluating the
query. The DefaultValue property is optional, but it is
automatically selected if the values from the member cannot
be aggregated.
DirectQuery
New DirectQuery implementation
This release sees significant enhancements in DirectQuery for tabular 1200 models. Here's a summary:
DirectQuery now generates simpler queries that provide better performance.
Extra control over defining sample datasets used for model design and testing.
Row level security (RLS ) is now supported for tabular 1200 models in DirectQuery mode. Previously, the
presence of RLS prevented deploying a tabular model in DirectQuery mode.
Calculated columns are now supported for tabular 1200 models in DirectQuery mode. Previously, the presence
of calculated columns prevented deploying a tabular model in DirectQuery mode.
Performance optimizations include redundant join elimination for VertiPaq and DirectQuery.
New data sources for DirectQuery mode
Data sources supported for tabular 1200 models in DirectQuery mode now include Oracle, Teradata and
Microsoft Analytics Platform (formerly known as Parallel Data Warehouse).
To learn more, see DirectQuery Mode.
See Also
Analysis Services team blog
What's New in SQL Server 2016
What's new in SQL Server 2017 Analysis Services
11/28/2018 • 10 minutes to read • Edit Online
APPLIES TO: SQL Server 2017 Analysis Services Azure Analysis Services
SQL Server 2017 Analysis Services see some of the most important enhancements since SQL Server 2012.
Building on the success of Tabular mode (first introduced in SQL Server 2012 Analysis Services), this release
makes tabular models more powerful than ever.
Multidimensional mode and Power Pivot for SharePoint mode are a staple for many Analysis Services
deployments. In the Analysis Services product lifecycle, these modes are mature. There are no new features for
either of these modes in this release. However, bug fixes and performance improvements are included.
The features described here are included in SQL Server 2017 Analysis Services. But in order to take advantage of
them, you must also use the latest versions of SQL Server Data Tools (SSDT) and SQL Server Management Studio
(SSMS ). SSDT and SSMS are updated monthly with new and improved features that typically coincide with new
functionality in SQL Server.
While it's important to learn about all the new features, it's also important to know what is being deprecated and
discontinued in this release and future releases. Be sure to check out Backward compatibility (SQL Server 2017
Analysis Services).
Let's take a look at some of the key new features in this release.
It's important to keep in mind, once you upgrade an existing model to 1400, you can't downgrade. Be sure to keep
a backup of your 1200 model database.
The modern Get Data experience and M mashup capabilities do not apply to existing tabular models upraded from
the 1200 compatibility level to 1400. The new experience only applies to new models created at the 1400
compatibility level.
Encoding hints
This release introduces encoding hints, an advanced feature used to optimize processing (data refresh) of large in-
memory tabular models. To better understand encoding, see Performance Tuning of Tabular Models in SQL Server
2012 Analysis Services whitepaper to better understand encoding.
Value encoding provides better query performance for columns that are typically only used for
aggregations.
Hash encoding is preferred for group-by columns (often dimension-table values) and foreign keys. String
columns are always hash encoded.
Numeric columns can use either of these encoding methods. When Analysis Services starts processing a table, if
either the table is empty (with or without partitions) or a full-table processing operation is being performed,
samples values are taken for each numeric column to determine whether to apply value or hash encoding. By
default, value encoding is chosen when the sample of distinct values in the column is large enough - otherwise
hash encoding usually provides better compression. It is possible for Analysis Services to change the encoding
method after the column is partially processed based on further information about the data distribution, and
restart the encoding process; however, this increases processing time and is inefficient. The performance-tuning
whitepaper discusses re-encoding in more detail and describes how to detect it using SQL Server Profiler.
Encoding hints allow the modeler to specify a preference for the encoding method given prior knowledge from
data profiling and/or in response to re-encoding trace events. Since aggregation over hash-encoded columns is
slower than over value-encoded columns, value encoding may be specified as a hint for such columns. It is not
guaranteed that the preference is applied. It is a hint as opposed to a setting. To specify an encoding hint, set the
EncodingHint property on the column. Possible values are "Default", "Value" and "Hash". The following snippet of
JSON -based metadata from the Model.bim file specifies value encoding for the Sales Amount column.
{
"name": "Sales Amount",
"dataType": "decimal",
"sourceColumn": "SalesAmount",
"formatString": "\\$#,0.00;(\\$#,0.00);\\$#,0.00",
"sourceProviderType": "Currency",
"encodingHint": "Value"
}
Ragged hierarchies
In tabular models, you can model parent-child hierarchies. Hierarchies with a differing number of levels are often
referred to as ragged hierarchies. By default, ragged hierarchies are displayed with blanks for levels below the
lowest child. Here's an example of a ragged hierarchy in an organizational chart:
This release introduces the Hide Members property. You can set the Hide Members property for a hierarchy to
Hide blank members.
NOTE
Blank members in the model are represented by a DAX blank value, not an empty string.
When set to Hide blank members, and the model deployed, an easier to read version of the hierarchy is shown in
reporting clients like Excel.
Detail Rows
You can now define a custom row set contributing to a measure value. Detail Rows is similar to the default
drillthrough action in multidimensional models. This allows end-users to view information in more detail than the
aggregated level.
The following PivotTable shows Internet Total Sales by year from the Adventure Works sample tabular model. You
can right-click a cell with an aggregated value from the measure and then click Show Details to view the detail
rows.
By default, the associated data in the Internet Sales table is displayed. This limited behavior is often not meaningful
for the user because the table may not have the necessary columns to show useful information such as customer
name and order information. With Detail Rows, you can specify a Detail Rows Expression property for measures.
Detail Rows Expression property for measures
The Detail Rows Expression property for measures allows model authors to customize the columns and rows
returned to the end-user.
The SELECTCOLUMNS DAX function is commonly used in a Detail Rows Expression. The following example
defines the columns to be returned for rows in the Internet Sales table in the sample Adventure Works tabular
model:
SELECTCOLUMNS(
'Internet Sales',
"Customer First Name", RELATED( Customer[Last Name]),
"Customer Last Name", RELATED( Customer[First Name]),
"Order Date", 'Internet Sales'[Order Date],
"Internet Total Sales", [Internet Total Sales]
)
With the property defined and the model deployed, a custom row set is returned when the user selects Show
Details. It automatically honors the filter context of the cell that was selected. In this example, only the rows for
2010 value are displayed:
Default Detail Rows Expression property for tables
In addition to measures, tables also have a property to define a detail rows expression. The Default Detail Rows
Expression property acts as the default for all measures within the table. Measures that do not have their own
expression defined inherits the expression from the table and show the row set defined for the table. This allows
reuse of expressions, and new measures added to the table later automatically inherits the expression.
Object-level security
This release introduces object-level security for tables and columns. In addition to restricting access to table and
column data, sensitive table and column names can be secured. This helps prevent a malicious user from
discovering such a table exists.
Object-level security must be set using the JSON -based metadata, Tabular Model Scripting Language (TMSL ), or
Tabular Object Model (TOM ).
For example, the following code helps secure the Product table in the sample Adventure Works tabular model by
setting the MetadataPermission property of the TablePermission class to None.
//Find the Users role in Adventure Works and secure the Product table
ModelRole role = db.Model.Roles.Find("Users");
Table productTable = db.Model.Tables.Find("Product");
if (role != null && productTable != null)
{
TablePermission tablePermission;
if (role.TablePermissions.Contains(productTable.Name))
{
tablePermission = role.TablePermissions[productTable.Name];
}
else
{
tablePermission = new TablePermission();
role.TablePermissions.Add(tablePermission);
tablePermission.Table = productTable;
}
tablePermission.MetadataPermission = MetadataPermission.None;
}
db.Update(UpdateOptions.ExpandFull);
DAX enhancements
This release includes support for new DAX functions and functionality. In order to take advantage, you need to use
the latest version of SSDT. To learn more, see New DAX functions.
One of the most important pieces of new DAX functionality is the new IN Operator / CONTAINSROW Function
for DAX expressions. This is similar to the TSQL IN operator commonly used to specify multiple values in a WHERE
clause.
Previously, it was common to specify multi-value filters using the logical OR operator, like in the following
measure expression:
Filtered Sales:=CALCULATE (
[Internet Total Sales],
'Product'[Color] = "Red"
|| 'Product'[Color] = "Blue"
|| 'Product'[Color] = "Black"
)
In this case, the IN operator refers to a single-column table with 3 rows; one for each of the specified colors. Note
the table constructor syntax uses curly braces.
The IN operator is functionally equivalent to the CONTAINSROW function:
Filtered Sales:=CALCULATE (
[Internet Total Sales], CONTAINSROW({ "Red", "Blue", "Black" }, 'Product'[Color])
)
The IN operator can also be used effectively with table constructors. For example, the following measure filters by
combinations of product color and category:
Filtered Sales:=CALCULATE (
[Internet Total Sales],
FILTER( ALL('Product'),
( 'Product'[Color] = "Red" && Product[Product Category Name] = "Accessories" )
|| ( 'Product'[Color] = "Blue" && Product[Product Category Name] = "Bikes" )
|| ( 'Product'[Color] = "Black" && Product[Product Category Name] = "Clothing" )
)
)
By using the new IN operator, the measure expression above is now equivalent to the one below:
Filtered Sales:=CALCULATE (
[Internet Total Sales],
FILTER( ALL('Product'),
('Product'[Color], Product[Product Category Name]) IN
{ ( "Red", "Accessories" ), ( "Blue", "Bikes" ), ( "Black", "Clothing" ) }
)
)
Additional improvements
In addition to all the new features, Analysis Services, SSDT, and SSMS also include the following improvements:
Hierarchy and column reuse surfaced in more helpful locations in the Power BI field list.
Date relationships to easily create relationships to date dimensions based on date fields.
Default installation option for Analysis Services is now for tabular mode.
New Get Data (Power Query) data sources.
DAX Editor for SSDT.
Existing DirectQuery data sources support for M queries.
SSMS improvements, such as viewing, editing, and scripting support for structured data sources.
See also
SQL Server 2017 Release Notes
What's new in SQL Server 2017
Tools and applications used in Analysis Services
12/10/2018 • 2 minutes to read • Edit Online
Administrative tools
SQL Server Management Studio (SSMS ) is the primary administration tool for all SQL Server features, including
Analysis Services. SSMS is a free web download updated monthly.
Download SQL Server Management Studio
SSMS includes extended events (xEvents), providing a lightweight alternative to SQL Server Profiler traces used
for monitoring activity and diagnosing problems on SQL Server 2016 and Azure Analysis Services servers. See
Monitor Analysis Services with SQL Server Extended Events to learn more.
SQL Server Profiler
Although it's officially deprecated in favor of xEvents, SQL Server Profiler provides a familiar approach for
monitoring connections, MDX query execution, and other server operations. SQL Server Profiler is installed by
default. You can find it with SQL Server applications on Apps in Windows.
PowerShell
You can use PowerShell commands to perform many administrative tasks. See PowerShell reference for more
information.
Community and Third-party tools
Check the Analysis Services codeplex page for community code samples. Forums can be helpful when seeking
recommendations for third-party tools that support Analysis Services.
See Also
Compatibility Level of a Multidimensional Database
Compatibility Level for Tabular models
Comparing tabular and multidimensional solutions
12/7/2018 • 10 minutes to read • Edit Online
NOTE
Azure Analysis Services supports tabular models at the 1200 and higher compatibility levels. However, not all tabular
modeling functionality described in this topic is supported in Azure Analysis Services. While creating and deploying tabular
models to Azure Analysis Services is much the same as it is for on-premises, it's important to understand the differences. To
learn more , see What is Azure Analysis Services?
Tabular Relational modeling constructs (model, SQL Server 2012 and later
tables, columns). Internally, metadata is (compatibility levels 1050 - 1103) 1
inherited from OLAP modeling
constructs (cubes, dimensions,
measures). Code and script use OLAP
metadata.
Tabular in SQL Server 2016 Relational modeling constructs (model, SQL Server 2016 (compatibility level
tables, columns), articulated in tabular 1200)
metadata object definitions in Tabular
Model Scripting Language (TMSL) and
Tabular Object Model (TOM) code.
Tabular in SQL Server 2017 Relational modeling constructs (model, SQL Server 2017 (compatibility level
tables, columns), articulated in tabular 1400)
metadata object definitions in Tabular
Model Scripting Language (TMSL) and
Tabular Object Model (TOM) code.
Multidimensional OLAP modeling constructs (cubes, SQL Server 2000 and later
dimensions, measures).
Power Pivot Originally an add-in, but now fully via Excel and Power Pivot BI Desktop
integrated into Excel. Visual modeling
only, over an internal Tabular
infrastructure. You can import a Power
Pivot model into SSDT to create a new
Tabular model that runs on an Analysis
Services instance.
Model Features
The following table summarizes feature availability at the model level. Review this list to ensure that the feature
you want to use is available in the type of model you plan to build.
Multidimensional Tabular
Actions Yes No
Aggregations Yes No
M expressions No Yes1
Writeback Yes No
1 See CompatibilityLevel for Tabular models in Analysis Services for information about functional differences
between compatibility levels.
Data Considerations
Tabular and multidimensional models use imported data from external sources. The amount and type of data you
need to import can be a primary consideration when deciding which model type best fits your data.
Compression
Both tabular and multidimensional solutions use data compression that reduces the size of the Analysis Services
database relative to the data warehouse from which you are importing data. Because actual compression will vary
based on the characteristics of the underlying data, there is no way to know precisely how much disk and memory
will be required by a solution after data is processed and used in queries.
An estimate used by many Analysis Services developers is that primary storage of a multidimensional database
will be about one third size of the original data. Tabular databases can sometimes get greater amounts of
compression, about one tenth the size, especially if most of the data is imported from fact tables.
Size of the model and resource bias (in-memory or disk)
The size of an Analysis Services database is constrained only by the resources available to run it. The model type
and storage mode will also play a role in how large the database can grow.
Tabular databases run either in-memory or in DirectQuery mode that offloads query execution to an external
database. For tabular in-memory analytics, the database is stored entirely in memory, which means you must have
sufficient memory to not only load all the data, but also additional data structures created to support queries.
DirectQuery, revamped in SQL Server 2016, has fewer restrictions than before, and better performance.
Leveraging the backend relational database for storage and query execution makes building a large scale Tabular
model more feasible than was previously possible.
Historically, the largest databases in production are multidimensional, with processing and query workloads
running independently on dedicated hardware, each one optimized for its respective use. Tabular databases are
catching up quickly, and new advancements in DirectQuery will help close the gap even further.
For multidimensional offloading data storage and query execution is available via ROLAP. On a query server,
rowsets can be cached, and stale ones paged out. Efficient and balanced use of memory and disk resources often
guide customers to multidimensional solutions.
Under load, both disk and memory requirements for either solution type can be expected to increase as Analysis
Services caches, stores, scans, and queries data. For more information about memory paging options, see
Memory Properties. To learn more about scale, see High availability and Scalability in Analysis Services.
Power Pivot for Excel has an artificial file size limit of 2 gigabytes, which is imposed so that workbooks created in
Power Pivot for Excel can be uploaded to SharePoint, which sets maximum limits on file upload size. One of the
main reasons for migrating a Power Pivot workbook to a tabular solution on a standalone Analysis Services
instance is to get around the file size limitation. For more information about configuring maximum file upload size,
see Configure Maximum File Upload Size (Power Pivot for SharePoint).
Supported Data Sources
Tabular models can import data from relational data sources, data feeds, and some document formats. You can
also use OLE DB for ODBC providers with tabular models. Tabular models at the 1400 compatibility level offer a
significant increase in the variety of data sources from which you can import from. This is due to the introduction
of the modern Get Data data query and import features in SSDT utilizing the M formula query language.
Multidimensional solutions can import data from relational data sources using OLE DB native and managed
providers.
To view the list of external data sources that you can import to each model, see the following topics:
Data Sources Supported
Supported Data Sources (SSAS - Multidimensional)
Security Features
All Analysis Services solutions can be secured at the database level. More granular security options vary by mode.
If granular security settings are requirement for your solution, review the following list to ensure the level of
security you want is supported in the type of solution you want to build:
Tabular model databases can use row -level security, using role-based permissions.
Multidimensional model databases can use dimension and cell-level security, using role-based permissions.
Power Pivot workbooks are secured at the file level, using SharePoint permissions.
Power Pivot workbooks can be restored to a Tabular mode server. Once the file is restored, it is decoupled from
SharePoint, allowing you to use all tabular modeling features, including row -level security.
Design Tools
Data modeling skills and technical expertise can vary widely among users who are tasked with building analytical
models. If tool familiarity or user expertise is a consideration for your solution, compare the following experiences
for model creation.
SQL Server Data Tools (SSDT) Use to create tabular, multidimensional, and data mining
solutions. This authoring environment uses the Visual Studio
shell to provide workspaces, property panes, and object
navigation. Technical users who already use Visual Studio will
most likely prefer this tool for building business intelligence
applications.
Power Pivot for Excel Use to create a Power Pivot workbook that you later deploy
to a SharePoint farm that has an installation of Power Pivot
for SharePoint. Power Pivot for Excel has a separate
application workspace that opens over Excel. It uses the same
visual metaphors (tabbed pages, grid layout, and formula bar)
as Excel. Users who are proficient in Excel will prefer this tool
over SQL Server Data Tools (SSDT).
See Also
Analysis Services Instance Management
What's New in Analysis Services
Analysis Services Features and Tasks
12/10/2018 • 2 minutes to read • Edit Online
In This Section
Comparing Tabular and Multidimensional Solutions
Tools and applications used in Analysis Services
Analysis Services Instance Management
Tabular Models
Multidimensional Models
Data Mining
Power Pivot for SharePoint
See Also
Analysis Services
What's New in Analysis Services
Analysis Services features supported by SQL Server
editions
5/16/2018 • 3 minutes to read • Edit Online
APPLIES TO: SQL Server Analysis Services (starting with 2016) Azure Analysis Services
This topic provides details of features supported by the different editions of SQL Server 2016 Analysis Services.
For features supported by Evaluation and Developer editions, see Enterprise edition.
Tabular models
EXPRESS
WITH
ADVANCED EXPRESS
FEATURE ENTERPRISE STANDARD WEB SERVICES WITH TOOLS EXPRESS DEVELOPER
Multidimensional models
EXPRESS
WITH
ADVANCED EXPRESS
FEATURE ENTERPRISE STANDARD WEB SERVICES WITH TOOLS EXPRESS DEVELOPER
databases or instances.
Data Mining
EXPRESS
WITH
FEATURE ADVANCED EXPRESS
NAME ENTERPRISE STANDARD WEB SERVICES WITH TOOLS EXPRESS DEVELOPER
APPLIES TO: SQL Server 2016 Analysis Services Azure Analysis Services
This article describes changes in feature availability and behavior between the current version and the previous
version.
Deprecated features
A deprecated feature will be discontinued from the product in a future release, but is still supported and included
in the current release to maintain backward compatibility. It's recommended you discontinue using deprecated
features in new and existing projects to maintain compatibility with future releases.
The following features are deprecated in this release:
Mode/Category Feature
Tabular Tabular model 1100 and 1103 compatibility levels will not be
supported in a future release. The replacement is to set
models at compatibility level 1200 or higher, converting
model definitions to tabular metadata. See Compatibility Level
for Tabular models in Analysis Services.
Trace Management Objects and Trace APIs Microsoft.AnalysisServices.Trace objects (contains the APIs for
Analysis Services Trace and Replay objects). The replacement is
multi-part:
- Trace Configuration:
Microsoft.SqlServer.Management.XEvent
- Trace Reading: Microsoft.SqlServer.XEvent.Linq
- Trace Replay: None
NOTE
Previously deprecated feature announcements from SQL Server 2014 (12.x) remain in effect. Because the code supporting
those features has not yet been cut from the product, many of these features are still present in this release. While previously
deprecated features might be accessible, they are still considered deprecated and could be physically removed from the
product at any time.
Discontinued features
A discontinued feature was deprecated in an earlier release. It may continue to be included in the current release,
but is no longer supported. Discontinued features may be removed entirely in a future release or update.
The following features were deprecated in an earlier release and are no longer supported in this release.
CalculationPassValue (MDX) None. This feature was deprecated in SQL Server 2005.
CalculationCurrentPass (MDX) None. This feature was deprecated in SQL Server 2005.
NON_EMPTY_BEHAVIOR query optimizer hint None. This feature was deprecated in SQL Server 2008.
COM assemblies None. This feature was deprecated in SQL Server 2008.
CELL_EVALUATION_LIST intrinsic cell property None. This feature was deprecated in SQL Server 2005.
NOTE
Previously deprecated feature announcements from SQL Server 2014 (12.x) remain in effect. Because the code supporting
those features has not yet been cut from the product, many of these features are still present in this release. While previously
deprecated features might be accessible, they are still considered deprecated and could be physically removed from the
product at any time.
Breaking changes
A breaking change causes a data model, application code, or script to no longer function after upgrading either the
model or the server.
.NET 4.0 version upgrade
Analysis Services Management Objects (AMO ), ADOMD.NET, and Tabular Object Model (TOM ) client libraries
now target the .NET 4.0 runtime. This can be a breaking change for applications that target .NET 3.5. Applications
using newer versions of these assemblies must now target .NET 4.0 or later.
AMO version upgrade
This release is a version upgrade for Analysis Services Management Objects (AMO ) and is a breaking change
under certain circumstances. Existing code and scripts that call into AMO will continue to run as before if you
upgrade from a previous version. However, if you need to recompile your application and you are targeting a SQL
Server 2016 Analysis Services instance, you must add the following namespace to make your code or script
operational:
using Microsoft.AnalysisServices;
using Microsoft.AnalysisServices.Core;
DISCOVER_XEVENT_PACKAGES
DISCOVER_XEVENT_OBJECT
DISCOVER_XEVENT_OBJECT_COLUMNS
DISCOVER_XEVENT_SESSION_TARGETS
Behavior changes
A behavior change affects how features work or interact in the current version as compared to earlier versions of
SQL Server.
Revisions to default values, manual configuration required to complete an upgrade or restore functionality, or a
new implementation of an existing feature are all examples of a behavior change in the product.
Feature behaviors that changed in this release, yet do not break an existing model or code post-upgrade, are listed
here.
Analysis Services in SharePoint mode
Running the Power Pivot Configuration wizard is no longer required as a post-installation task. This is true for all
supported versions of SharePoint that load models from the current SQL Server 2016 Analysis Services.
DirectQuery mode for Tabular models
DirectQuery is a data access mode for tabular models, where query execution is performed on a backend relational
database, retrieving a result set in real time. It's often used for very large datasets that cannot fit in memory or
when data is volatile and you want the most recent data returned in queries against a tabular model.
DirectQuery has existed as a data access mode for the last several releases. In SQL Server 2016 Analysis Services,
the implementation has been slightly revised, assuming the tabular model is at compatibility level 1200 or higher.
DirectQuery has fewer restrictions than before. It also has different database properties.
If you are using DirectQuery in an existing tabular model, you can keep the model at its currently compatibility
level of 1100 or 1103 and continue to use DirectQuery as its implemented for those levels. Alternatively, you can
upgrade to 1200 or higher to benefit from enhancements made to DirectQuery.
There is no in-place upgrade of a DirectQuery model because the settings from older compatibility levels do not
have exact counterparts in the newer 1200 and higher compatibility levels. If you have an existing tabular model
that runs in DirectQuery mode, you should open the model in SQL Server Data Tools, turn DirectQuery off, set the
Compatibility Level property to 1200 or higher, and then reconfigure the DirectQuery properties. See
DirectQuery Mode for details.
See also
Analysis Services backward compatibility (SQL Server 2017)
Analysis Services backward compatibility (SQL 2017)
1/9/2019 • 2 minutes to read • Edit Online
APPLIES TO: SQL Server 2017 Analysis Services Azure Analysis Services
This article describes changes in feature availability and behavior between the current release and the previous
release.
Deprecated features
A deprecated feature will be discontinued from the product in a future release, but is still supported and included
in the current release to maintain backward compatibility. It's recommended you discontinue using deprecated
features in new and existing projects to maintain compatibility with future releases. Documentation is not updated
for deprecated features.
The following features are deprecated in this release:
Mode/Category Feature
Trace Management Objects and Trace APIs Microsoft.AnalysisServices.Trace objects (contains the APIs for
Analysis Services Trace and Replay objects). The replacement is
multi-part:
- Trace Configuration:
Microsoft.SqlServer.Management.XEvent
- Trace Reading: Microsoft.SqlServer.XEvent.Linq
- Trace Replay: None
Discontinued features
A discontinued feature was deprecated in an earlier release. It may continue to be included in the current release,
but is no longer supported. Discontinued features may be removed entirely in a future release or update.
The following features were deprecated in an earlier release and are no longer supported in this release.
Mode/Category Feature
Breaking changes
A breaking change causes a feature, data model, application code, or script to no longer function after upgrading
to the current release.
There are no breaking changes in this release.
Behavior changes
A behavior change affects how the same feature works in the current release as compared to the previous release.
Only significant behavior changes are described. Changes in user interface are not included.
Changes to MDSCHEMA_MEASUREGROUP_DIMENSIONS and DISCOVER_CALC_DEPENDENCY, detailed in
the What's new in SQL Server 2017 CTP 2.1 for Analysis Services announcement.
See also
Analysis Services backward compatibility (SQL Server 2016)
Globalization scenarios for Analysis Services
12/10/2018 • 4 minutes to read • Edit Online
Languages and Collations (Analysis Inherited from the operating system. Inherited, but with the ability to
Services) override both language and collation
for major objects in the model
hierarchy.
Scope of translation support Captions and descriptions. Translations can be created for object
names, captions, identifiers, and
descriptions, can also be in any Unicode
language and script. This is true even
when the tools and environment are in
another language. For example, in a
development environment that uses
English language and a Latin collation
throughout the stack, you can include
in your model an object that uses
Cyrillic characters in its name.
Implementing translation support Create using SQL Server Data Tools Create usingSQL Server Data Tools
(SSDT) to generate translation files that (SSDT) to define the translations for the
you fill in and then import back into the caption, description, and account types
model. for cubes and measures, dimension and
attributes.
See Translations in Tabular models
(Analysis Services) for details. See Translations in Multidimensional
Models (Analysis Services) for more
information. A lesson on how to use
this feature can be found in Lesson 9:
Defining Perspectives and Translations
of the Analysis Services tutorial.
NOTE
When deciding on a collation, you should go with the same collation used by the underlying database. However, if
you can choose, the _100 version is more up-to-date and offers a more linguistically accurate cultural sorting
convention.
Binary (_BIN) or BIN2 (_BIN2) There are two types of binary collations in SQL Server; the
older BIN collations and the newer BIN2 collations. In a BIN2
collation all characters are sorted according to their code
points. In a BIN collation only the first character is sorted
according to the code point, and remaining characters are
sorted according to their byte values. (Because the Intel
platform is a little endian architecture, Unicode code
characters are always stored byte-swapped.)
See Also
Globalization scenarios for Analysis Services
Globalization Tips and Best Practices (Analysis Services)
Collation and Unicode Support
Translation support in Analysis Services
1/9/2019 • 2 minutes to read • Edit Online
TIP
You can use client applications such as Excel, SQL Server Management Studio, and SQL Server Profiler to return translated
strings. See Globalization Tips and Best Practices (Analysis Services) for details.
See also
Globalization scenarios for Analysis Services
Languages and Collations (Analysis Services)
Set or Change the Column Collation
Globalization Tips and Best Practices (Analysis Services)
Currency Conversions (Analysis Services)
12/10/2018 • 10 minutes to read • Edit Online
NOTE
For many-to-one currency conversions, the pivot currency and reporting currency are the same.
Currency dimension
A database dimension defined with the following settings:
The Type property of the dimension is set to Currency.
The Type property of one attribute for the dimension is set to CurrencyName.
IMPORTANT
The values of this attribute must be used in all columns that should contain a currency identifier.
n sample currency to 1 Divide the measure to be Multiply the measure to be Divide the measure to be
pivot currency converted by the exchange converted by the exchange converted by the exchange
rate measure for the local rate measure for the rate measure for the local
currency in order to convert reporting currency in order currency in order to convert
the measure into the pivot to convert the measure into the measure into the pivot
currency. the reporting currency. currency, then multiply the
converted measure by the
exchange rate measure for
the reporting currency in
order to convert the
measure into the reporting
currency.
You choose the exchange rate direction on the Set currency conversion options page of the Business
Intelligence Wizard. For more information about setting conversion direction, see Set Currency Conversion
Options (Business Intelligence Wizard).
Converted Members
You can use the Business Intelligence Wizard to specify which measures from the rate measure group are used to
convert values for:
Measures in other measure groups.
Members of an attribute hierarchy for an account attribute in a database dimension.
Account types, used by members of an attribute hierarchy for an account attribute in a database dimension.
The Business Intelligence Wizard uses this information within the MDX script generated by the wizard to
determine the scope of the currency conversion calculation. For more information about specifying members for
currency conversion, see Select Members (Business Intelligence Wizard).
Conversion Types
The Business Intelligence Wizard supports three different types of currency conversion:
One-to-many
Transactions are stored in the fact table in the pivot currency, and then converted to one or more other
reporting currencies.
For example, the pivot currency can be set to United States dollars (USD ), and the fact table stores
transactions in USD. This conversion type converts these transactions from the pivot currency to the
specified reporting currencies. The result is that transactions can be stored in the specified pivot currency
and viewed either in the specified pivot currency or in any of the reporting currencies specified in the
reporting currency dimension defined for the currency conversion.
Many-to-one
Transactions are stored in the fact table in local currencies, and then converted into the pivot currency. The
pivot currency serves as the only specified reporting currency in the reporting currency dimension.
For example, the pivot currency can be set to United States dollars (USD ), and the fact table stores
transactions in euros (EUR ), Australian dollars (AUD ), and Mexican pesos (MXN ). This conversion type
converts these transactions from their specified local currencies to the pivot currency. The result is that
transactions can be stored in the specified local currencies and viewed in the pivot currency, which is
specified in the reporting currency dimension defined for the currency conversion.
Many-to-many
Transactions are stored in the fact table in local currencies. The currency conversion functionality converts
such transactions into the pivot currency, and then to one or more other reporting currencies.
For example, the pivot currency can be set to United States dollars (USD ), and the fact table stores
transactions in euros (EUR ), Australian dollars (AUD ), and Mexican pesos (MXN ). This conversion type
converts these transactions from their specified local currencies to the pivot currency, and then the
converted transactions are converted again from the pivot currency to the specified reporting currencies.
The result is that transactions can be stored in the specified local currencies and viewed either in the
specified pivot currency or in any of the reporting currencies that are specified in the reporting currency
dimension defined for the currency conversion.
Specifying the conversion type allows the Business Intelligence Wizard to define the named query and dimension
structure of the reporting currency dimension, as well as the structure of the MDX script defined for the currency
conversion.
Local Currencies
If you choose a many-to-many or many-to-one conversion type for your currency conversion, you need to specify
how to identify the local currencies from which the MDX script generated by the Business Intelligence Wizard
performs the currency conversion calculations. The local currency for a transaction in a fact table can be identified
in one of two ways:
The measure group contains a regular dimension relationship to the currency dimension. For example, in
the Adventure Works DW Multidimensional 2012 sample Analysis Services database, the Internet Sales
measure group has a regular dimension relationship to the Currency dimension. The fact table for that
measure group contains a foreign key column that references the currency identifiers in the dimension
table for that dimension. In this case, you can select the attribute from the currency dimension that is
referenced by the measure group to identify the local currency for transactions in the fact table for that
measure group. This situation most often occurs in banking applications, where the transaction itself
determines the currency used within the transaction.
The measure group contains a referenced dimension relationship to the currency dimension, through
another dimension that directly references the currency dimension. For example, in the Adventure Works
DW Multidimensional 2012 sample Analysis Services database, the Financial Reporting measure group has
a referenced dimension relationship to the Currency dimension through the Organization dimension. The
fact table for that measure group contains a foreign key column that references members in the dimension
table for the Organization dimension. The dimension table for the Organization dimension, in turn,
contains a foreign key column that references the currency identifiers in the dimension table for the
Currency dimension. This situation most often occurs in financial reporting applications, where the location
or subsidiary for a transaction determines the currency for the transaction. In this case, you can select the
attribute that references the currency dimension from the dimension for the business entity.
Reporting Currencies
If you choose a many-to-many or one-to-many conversion type for your currency conversion, you need to specify
the reporting currencies for which the MDX script generated by the Business Intelligence Wizard performs the
currency conversion calculations. You can either specify all the members of the currency dimension related to the
rate measure group, or select individual members from the dimension.
The Business Intelligence Wizard creates a reporting currency dimension, based on a named query constructed
from the dimension table for the currency dimension using the selected reporting currencies.
NOTE
If you select the one-to-many conversion type, a reporting currency dimension is also created. The dimension contains only
one member representing the pivot currency, because the pivot currency is also used as the reporting currency for a one-
to-many currency conversion.
A separate reporting currency dimension is defined for each currency conversion defined in a cube. You can
change the name of the reporting currency dimensions after creation, but if you do so you must also update the
MDX script generated for that currency conversion to ensure that the correct name is used by the script command
when referencing the reporting currency dimension.
...
...
//</Currency conversion>
If you change or remove these comments, the Business Intelligence Wizard is unable to detect the currency
conversion, so you should not change these comments.
The wizard also stores metadata in comments within these comments, including the creation date and time, the
user, and the conversion type. These comments should also not be changed because the Business Intelligence
Wizard uses this metadata when displaying existing currency conversions.
You can change the script commands contained in a currency conversion as needed. If you overwrite the currency
conversion, however, your changes will be lost.
See Also
Globalization scenarios for Analysis Services
Globalization Tips and Best Practices (Analysis
Services)
12/10/2018 • 7 minutes to read • Edit Online
Basic Latin alphabet Object identifiers expressed in Latin script (any of the 26
English upper or lower case letters) are treated as case-
insensitive, regardless of collation. For example, the following
object IDs are considered identical: 54321abcdef,
54321ABCDEF, 54321AbCdEf. Internally, Analysis Services
treats the characters in the string as if all are uppercase, and
then performs a simple byte comparison that is independent
of language.
Cyrillic, Greek, Coptic, Armenian Object identifiers in non-Latin bicameral script, such as
Cyrillic, are always case-sensitive. For example, Измерение
and измерение are considered two distinct values, even
though the only difference is the case of the first letter.
Locale testing using Excel, SQL Server Profiler and SQL Server
Management Studio
When testing translations, the connection must specify the LCID of the translation. As documented in Get
Different Language from SSAS into Excel, you can use Excel to test your translations.
You can do this by hand editing the .odc file to include the locale identifier connection string property. Try this out
with the Adventure Works sample multidimensional database.
Search for existing .odc files. When you find the one for Adventure Works multidimensional, right-click
the file to open it in Notepad.
Add Locale Identifier=1036 to the connection string. Save and close the file.
Open Excel | Data | Existing Connections. Filter the list to just connections files on this computer. Find
the connection for Adventure Works (look at the name carefully; you might have more than one). Open
the connection.
You should see the French translations from the Adventure Works sample database.
As a follow up, you can use SQL Server Profiler to confirm the locale. Click a Session Initialize event and then
look at the property list in the text area below to find <localeidentifier>1036</localeidentifier> .
In Management Studio, you can specify Locale Identifier on a server connection.
In Object Explorer | Connect | Analysis Services | Options, click the Additional Connection
Parameters tab.
Enter Local Identifier=1036 and then click Connect.
Execute an MDX query against the Adventure Works database. The query results should be the French
translations.
Writing MDX queries in a solution containing Translations
Translations provide display information for the names of Analysis Services objects, but the identifiers for the
same objects are not translated. Whenever possible, use the identifiers and keys for Analysis Services objects
instead of the translated captions and names. For example, use member keys instead of member names for
Multidimensional Expressions (MDX) statements and scripts to ensure portability across multiple languages.
NOTE
Recall that tabular object names are always case-insensitive, regardless of collation. Multidimensional object names, on the
other hand, follow the case sensitivity of the collation. Since only multidimensional object names are case-sensitive make
sure that all MDX queries referencing multidimensional objects are cased correctly.
See Also
Globalization scenarios for Analysis Services
Write International Transact-SQL Statements
Analysis Services tutorials
5/16/2018 • 2 minutes to read • Edit Online
Samples
Project and completed model database samples
Sample data modeling projects and completed sample model databases are available at Adventure Works for
Analysis Services on GitHub.
Code samples
Open source code samples and community projects available at Analysis Services repo on GitHub.
SQL Server Database and SQL Server Data Warehouse samples
Adventure Works and Wide World Importers sample databases are available at SQL Server Sample Repository on
GitHub.
Tabular modeling (1400 compatibility level)
8/27/2018 • 3 minutes to read • Edit Online
APPLIES TO: SQL Server Analysis Services (starting with 2017) Azure Analysis Services
This tutorial provides lessons on how to create and deploy a tabular model at the 1400 compatibility level. If you're
new to Analysis Services and tabular modeling, completing this tutorial is the quickest way to learn how to create
and deploy a basic tabular model by using Visual Studio. Once you have the prerequisites in-place, it should take
two to three hours to complete.
Prerequisites
To complete this tutorial, you need:
An Azure Analysis Services server or a SQL Server 2017 Analysis Services server in Tabular mode. Sign up
for a free Azure Analysis Services trial and create a server or download a free SQL Server 2017 Developer
Edition.
An Azure SQL Data Warehouse with the sample AdventureWorksDW database, or an on-premises SQL
Server Data Warehouse with an AdventureWorksDW sample database. When installing an
AdventureWorksDW database to an on-premises SQL Server Data Warehouse, use the sample datbase
version that corresponds with your server version.
Important: If you install the sample database to an on-premises SQL Server Data Warehouse, and deploy
your model to an Azure Analysis Services server, an On-premises data gateway is required.
The latest version of SQL Server Data Tools (SSDT). Or, if you already have Visual Studio 2017, you can
download and install Microsoft Analysis Services Projects (VSIX) package. For this tutorial, references to
SSDT and Visual Studio are synonymous.
The latest version of SQL Server Management Studio (SSMS ).
A client application such as Power BI Desktop or Excel.
Scenario
This tutorial is based on Adventure Works Cycles, a fictitious company. Adventure Works is a large, multinational
manufacturing company that produces and distributes bicycles, parts, and accessories for commercial markets in
North America, Europe, and Asia. The company employs 500 workers. Additionally, Adventure Works employs
several regional sales teams throughout its market base. Your project is to create a tabular model for sales and
marketing users to analyze Internet sales data in the AdventureWorksDW database.
To complete the tutorial, you must complete various lessons. In each lesson, there are tasks. Completing each task
in order is necessary for completing the lesson. While in a particular lesson there may be several tasks that
accomplish a similar outcome, but how you complete each task is slightly different. This method shows there is
often more than one way to complete a task, and to challenge you by using skills you've learned in previous
lessons and tasks.
The purpose of the lessons is to guide you through authoring a basic tabular model by using many of the features
included in SSDT. Because each lesson builds upon the previous lesson, you should complete the lessons in order.
This tutorial does not provide lessons about managing a server in Azure portal, managing a server or database by
using SSMS, or using a client application to browse model data.
Lessons
This tutorial includes the following lessons:
13 - Deploy 5 minutes
Supplemental lessons
These lessons are not required to complete the tutorial, but can be helpful in better understanding advanced
tabular model authoring features.
Next steps
To get started, see Lesson 1: Create a new tabular model project.
Create a tabular model project
11/27/2018 • 3 minutes to read • Edit Online
APPLIES TO: SQL Server Analysis Services (starting with 2017) Azure Analysis Services
In this lesson, you use Visual Studio with SQL Server Data Tools (SSDT) or Visual Studio 2017 with Microsoft
Analysis Services Projects VSIX to create a new tabular model project at the 1400 compatibility level. Once your
new project is created, you can begin adding data and authoring your model. This lesson also gives you a brief
introduction to the tabular model authoring environment in Visual Studio.
Estimated time to complete this lesson: 10 minutes
Prerequisites
This article is the first lesson in a tabular model authoring tutorial. To complete this lesson, there are several
prerequisites you need to have in-place. To learn more, see Analysis Services - Adventure Works tutorial.
Click the Solution Explorer tab. Here, you see your Model.bim file. If you don't see the designer window to the
left (the empty window with the Model.bim tab), in Solution Explorer, under AW Internet Sales Project,
double-click the Model.bim file. The Model.bim file contains the metadata for your model project.
Click Model.bim. In the Properties window, you see the model properties, most important of which is the
DirectQuery Mode property. This property specifies if the model is deployed in In-Memory mode (Off) or
DirectQuery mode (On). For this tutorial, you author and deploy your model in In-Memory mode.
When you create a model project, certain model properties are set automatically according to the Data Modeling
settings that can be specified in the Tools menu > Options dialog box. Data Backup, Workspace Retention, and
Workspace Server properties specify how and where the workspace database (your model authoring database) is
backed up, retained in-memory, and built. You can change these settings later if necessary, but for now, leave these
properties as they are.
In Solution Explorer, right-click AW Internet Sales (project), and then click Properties. The AW Internet
Sales Property Pages dialog box appears. You set some of these properties later when you deploy your model.
When you installed SSDT, several new menu items were added to the Visual Studio environment. Click the Model
menu. From here, you can import data, refresh workspace data, browse your model in Excel, create perspectives
and roles, select the model view, and set calculation options. Click the Table menu. From here, you can create and
manage relationships, specify date table settings, create partitions, and edit table properties. If you click the
Column menu, you can add and delete columns in a table, freeze columns, and specify sort order. SSDT also adds
some buttons to the bar. Most useful is the AutoSum feature to create a standard aggregation measure for a
selected column. Other toolbar buttons provide quick access to frequently used features and commands.
Explore some of the dialogs and locations for various features specific to authoring tabular models. While some
items are not yet active, you can get a good idea of the tabular model authoring environment.
What's next?
Lesson 2: Get data.
Get data
8/27/2018 • 3 minutes to read • Edit Online
APPLIES TO: SQL Server Analysis Services (starting with 2017) Azure Analysis Services
In this lesson, you use Get Data to connect to the AdventureWorksDW sample database, select data, preview and
filter, and then import into your model workspace.
Under the hood, Get Data is Power Query, which provides a vast array of tools for connecting to and reshaping
data for modeling and analysis. To learn more, see Power Query Documentation.
NOTE
Tasks and images in this tutorial show connecting to an AdventureWorksDW2014 database on an on-premises server. In
some cases, an AdventureWorksDW database on Azure SQL Data Warehouse may show different objects; however, they are
fundamentally the same.
Prerequisites
This article is part of a tabular modeling tutorial, which should be completed in order. Before performing the tasks
in this lesson, you should have completed the previous lesson: Lesson 1: Create a new tabular model project.
Create a connection
To create a connection to the AdventureWorksDW database
1. In Tabular Model Explorer, right-click Data Sources > Import from Data Source.
This launches Get Data, which guides you through connecting to a data source. If you don't see Tabular
Model Explorer, in Solution Explorer, double-click Model.bim to open the model in the designer.
2. In Get Data, click Database > SQL Server Database > Connect.
3. In the SQL Server Database dialog, in Server, type the name of the server where you installed the
AdventureWorksDW database, and then click Connect.
4. When prompted to enter credentials, you need to specify the credentials Analysis Services uses to connect to
the data source when importing and processing data. In Impersonation Mode, select Impersonate
Account, then enter credentials, and then click Connect. It's recommended you use an account where the
password doesn't expire.
NOTE
Using a Windows user account and password provides the most secure method of connecting to a data source.
5. In Navigator, select the AdventureWorksDW database, and then click OK.This creates the connection to
the database.
6. In Navigator, select the check box for the following tables: DimCustomer, DimDate, DimGeography,
DimProduct, DimProductCategory, DimProductSubcategory, and FactInternetSales.
After you click OK, Query Editor opens. In the next section, you select only the data you want to import.
TIP
If you make a mistake, you can backup by deleting a step in APPLIED STEPS.
3. Filter the remaining tables by removing the following columns in each table:
DimDate
COLUMN
DateKey
SpanishDayNameOfWeek
FrenchDayNameOfWeek
SpanishMonthName
FrenchMonthName
DimGeography
COLUMN
SpanishCountryRegionName
FrenchCountryRegionName
IpAddressLocator
DimProduct
COLUMN
SpanishProductName
FrenchProductName
FrenchDescription
ChineseDescription
ArabicDescription
HebrewDescription
ThaiDescription
GermanDescription
JapaneseDescription
TurkishDescription
DimProductCategory
COLUMN
SpanishProductCategoryName
FrenchProductCategoryName
DimProductSubcategory
COLUMN
SpanishProductSubcategoryName
FrenchProductSubcategoryName
FactInternetSales
No columns removed.
2. Click Close.
What's next?
Lesson 3: Mark as Date Table.
Mark as Date Table
8/27/2018 • 2 minutes to read • Edit Online
APPLIES TO: SQL Server Analysis Services (starting with 2017) Azure Analysis Services
In Lesson 2: Get data, you imported a dimension table named DimDate. While in your model this table is named
DimDate, it can also be known as a Date table, in that it contains date and time data.
Whenever you use DAX time-intelligence functions, like when you create measures later, you must specify
properties which include a Date table and a unique identifier Date column in that table.
In this lesson, you mark the DimDate table as the Date table and the Date column (in the Date table) as the Date
column (unique identifier).
Before you mark the date table and date column, it's a good time to do a little housekeeping to make your model
easier to understand. Notice in the DimDate table a column named FullDateAlternateKey. This column contains
one row for every day in each calendar year included in the table. You use this column a lot in measure formulas
and in reports. But, FullDateAlternateKey isn't really a good identifier for this column. You rename it to Date,
making it easier to identify and include in formulas. Whenever possible, it's a good idea to rename objects like
tables and columns to make them easier to identify in SSDT and client reporting applications.
Estimated time to complete this lesson: Three minutes
Prerequisites
This article is part of a tabular modeling tutorial, which should be completed in order. Before performing the tasks
in this lesson, you should have completed the previous lesson: Lesson 2: Get data.
To rename the FullDateAlternateKey column
1. In the model designer, click the DimDate table.
2. Double-click the header for the FullDateAlternateKey column, and then rename it to Date.
To set Mark as Date Table
1. Select the Date column, and then in the Properties window, under Data Type, make sure Date is selected.
2. Click the Table menu, then click Date, and then click Mark as Date Table.
3. In the Mark as Date Table dialog box, in the Date listbox, select the Date column as the unique identifier.
It's usually selected by default. Click OK.
What's next?
Lesson 4: Create relationships.
Create relationships
11/27/2018 • 4 minutes to read • Edit Online
APPLIES TO: SQL Server Analysis Services (starting with 2017) Azure Analysis Services
In this lesson, you verify the relationships that were created automatically when you imported data and add new
relationships between different tables. A relationship is a connection between two tables that establishes how the
data in those tables should be correlated. For example, the DimProduct table and the DimProductSubcategory
table have a relationship based on the fact that each product belongs to a subcategory. To learn more, see
Relationships.
Estimated time to complete this lesson: 10 minutes
Prerequisites
This article is part of a tabular modeling tutorial, which should be completed in order. Before performing the tasks
in this lesson, you should have completed the previous lesson: Lesson 3: Mark as Date Table.
Include as many of the tables as possible by using minimap controls in the lower-right corner of the model
designer. You can also click and drag tables to different locations, bringing tables closer together, or putting
them in a particular order. Moving tables does not affect the relationships between the tables. To view all
the columns in a particular table, click and drag on a table edge to expand or make it smaller.
2. Click the solid line between the DimCustomer table and the DimGeography table. The solid line between
these two tables shows this relationship is active, that is, it is used by default when calculating DAX
formulas.
Notice the GeographyKey column in the DimCustomer table and the GeographyKey column in the
DimGeography table now both each appear within a box. These columns are used in the relationship. The
relationship's properties now also appear in the Properties window.
TIP
You can also use the Manage Relationships dialog box to show the relationships between all tables in a table format.
In Tabular Model Explorer, right-click Relationships > Manage Relationships.
3. Verify the following relationships were created when each of the tables were imported from the
AdventureWorksDW database:
If any of the relationships are missing, verify your model includes the following tables: DimCustomer,
DimDate, DimGeography, DimProduct, DimProductCategory, DimProductSubcategory, and
FactInternetSales. If tables from the same datasource connection are imported at separate times, any
relationships between those tables are not be created and must be created manually. If no relationships
appear, it means there are no relationships at the datasource. You can create them manually in the data
model.
Take a closer look
In Diagram View, notice an arrow, an asterisk, and a number on the lines that show the relationship between
tables.
The arrow shows the filter direction. The asterisk shows this table is the many side in the relationship's cardinality,
and the one shows this table is the one side of the relationship. If you need to edit a relationship; for example,
change the relationship's filter direction or cardinality, double-click the relationship line to open the Edit
Relationship dialog.
These features are meant for advanced data modeling and are outside the scope of this tutorial. To learn more, see
Bi-directional cross filters for tabular models in Analysis Services.
In some cases, you may need to create additional relationships between tables in your model to support certain
business logic. For this tutorial, you need to create three additional relationships between the FactInternetSales
table and the DimDate table.
To add new relationships between tables
1. In the model designer, in the FactInternetSales table, click, and hold on the OrderDate column, then drag
the cursor to the Date column in the DimDate table, and then release.
A solid line appears showing you have created an active relationship between the OrderDate column in
the Internet Sales table, and the Date column in the Date table.
NOTE
When creating relationships, the cardinality and filter direction between the primary table and the related lookup
table is automatically selected.
2. In the FactInternetSales table, click and hold on the DueDate column, then drag the cursor to the Date
column in the DimDate table, and then release.
A dotted line appears showing you have created an inactive relationship between the DueDate column in
the FactInternetSales table, and the Date column in the DimDate table. You can have multiple
relationships between tables, but only one relationship can be active at a time. Inactive relationships can be
made active to perform special aggregations in custom DAX expressions.
3. Finally, create one more relationship. In the FactInternetSales table, click and hold on the ShipDate
column, then drag the cursor to the Date column in the DimDate table, and then release.
What's next?
Lesson 5: Create calculated columns.
Create calculated columns
8/27/2018 • 3 minutes to read • Edit Online
APPLIES TO: SQL Server Analysis Services (starting with 2017) Azure Analysis Services
In this lesson, you create data in your model by adding calculated columns. You can create calculated columns (as
custom columns) when using Get Data, by using the Query Editor, or later in the model designer like you do here.
To learn more, see Calculated columns.
You create five new calculated columns in three different tables. The steps are slightly different for each task
showing there are several ways to create columns, rename them, and place them in various locations in a table.
This lesson is also where you first use Data Analysis Expressions (DAX). DAX is a special language for creating
highly customizable formula expressions for tabular models. In this tutorial, you use DAX to create calculated
columns, measures, and role filters. To learn more, see DAX in tabular models.
Estimated time to complete this lesson: 15 minutes
Prerequisites
This article is part of a tabular modeling tutorial, which should be completed in order. Before performing the tasks
in this lesson, you should have completed the previous lesson: Lesson 4: Create relationships.
Values are then populated for all the rows in the calculated column. If you scroll down through the table,
you see rows can have different values for this column, based on the data in each row.
5. Rename this column to MonthCalendar.
The MonthCalendar calculated column provides a sortable name for Month.
Create a DayOfWeek calculated column in the DimDate table
1. With the DimDate table still active, click the Column menu, and then click Add Column.
2. In the formula bar, type the following formula:
When you've finished building the formula, press ENTER. The new column is added to the far right of the
table.
3. Rename the column to DayOfWeek.
4. Click the column heading, and then drag the column between the EnglishDayNameOfWeek column and
the DayNumberOfMonth column.
TIP
Moving columns in your table makes it easier to navigate.
The DayOfWeek calculated column provides a sortable name for the day of week.
Create a ProductSubcategoryName calculated column in the DimProduct table
1. In the DimProduct table, scroll to the far right of the table. Notice the right-most column is named Add
Column (italicized), click the column heading.
2. In the formula bar, type the following formula:
=RELATED('DimProductSubcategory'[EnglishProductSubcategoryName])
=RELATED('DimProductCategory'[EnglishProductCategoryName])
The Margin calculated column is used to analyze profit margins for each sale.
What's next?
Lesson 6: Create measures.
Create measures
8/27/2018 • 3 minutes to read • Edit Online
APPLIES TO: SQL Server Analysis Services (starting with 2017) Azure Analysis Services
In this lesson, you create measures to be included in your model. Similar to the calculated columns you created, a
measure is a calculation created by using a DAX formula. However, unlike calculated columns, measures are
evaluated based on a user selected filter. For example, a particular column or slicer added to the Row Labels field
in a PivotTable. A value for each cell in the filter is then calculated by the applied measure. Measures are powerful,
flexible calculations that you want to include in almost all tabular models to perform dynamic calculations on
numerical data. To learn more, see Measures.
To create measures, you use the Measure Grid. By default, each table has an empty measure grid; however, you
typically do not create measures for every table. The measure grid appears below a table in the model designer
when in Data View. To hide or show the measure grid for a table, click the Table menu, and then click Show
Measure Grid.
You can create a measure by clicking an empty cell in the measure grid, and then typing a DAX formula in the
formula bar. When you click ENTER to complete the formula, the measure then appears in the cell. You can also
create measures using a standard aggregation function by clicking a column, and then clicking the AutoSum
button (∑) on the toolbar. Measures created using the AutoSum feature appear in the measure grid cell directly
beneath the column, but can be moved.
In this lesson, you create measures by both entering a DAX formula in the formula bar, and by using the AutoSum
feature.
Estimated time to complete this lesson: 30 minutes
Prerequisites
This article is part of a tabular modeling tutorial, which should be completed in order. Before performing the tasks
in this lesson, you should have completed the previous lesson: Lesson 5: Create calculated columns.
Create measures
To create a DaysCurrentQuarterToDate measure in the DimDate table
1. In the model designer, click the DimDate table.
2. In the measure grid, click the top-left empty cell.
3. In the formula bar, type the following formula:
Notice the top-left cell now contains a measure name, DaysCurrentQuarterToDate, followed by the
result, 92. The result is not relevant at this point because no user filter has been applied.
Unlike calculated columns, with measure formulas you can type the measure name, followed by a colon,
followed by the formula expression.
To create a DaysInCurrentQuarter measure in the DimDate table
1. With the DimDate table still active in the model designer, in the measure grid, click the empty cell below
the measure you created.
2. In the formula bar, type the following formula:
When creating a comparison ratio between one incomplete period and the previous period. The formula
must calculate the proportion of the period that has elapsed and compare it to the same proportion in the
previous period. In this case, [DaysCurrentQuarterToDate]/[DaysInCurrentQuarter] gives the proportion
elapsed in the current period.
To create an InternetDistinctCountSalesOrder measure in the FactInternetSales table
1. Click the FactInternetSales table.
2. Click the SalesOrderNumber column heading.
3. On the toolbar, click the down-arrow next to the AutoSum (∑) button, and then select DistinctCount.
The AutoSum feature automatically creates a measure for the selected column using the DistinctCount
standard aggregation formula.
4. In the measure grid, click the new measure, and then in the Properties window, in Measure Name,
rename the measure to InternetDistinctCountSalesOrder.
To create additional measures in the FactInternetSales table
1. By using the AutoSum feature, create and name the following measures:
2. By clicking an empty cell in the measure grid, and by using the formula bar, create, the following custom
measures in order:
InternetPreviousQuarterMargin:=CALCULATE([InternetTotalMargin],PREVIOUSQUARTER('DimDate'[Date]))
InternetCurrentQuarterMargin:=TOTALQTD([InternetTotalMargin],'DimDate'[Date])
InternetPreviousQuarterMarginProportionToQTD:=[InternetPreviousQuarterMargin]*
([DaysCurrentQuarterToDate]/[DaysInCurrentQuarter])
InternetPreviousQuarterSales:=CALCULATE([InternetTotalSales],PREVIOUSQUARTER('DimDate'[Date]))
InternetCurrentQuarterSales:=TOTALQTD([InternetTotalSales],'DimDate'[Date])
InternetPreviousQuarterSalesProportionToQTD:=[InternetPreviousQuarterSales]*
([DaysCurrentQuarterToDate]/[DaysInCurrentQuarter])
Measures created for the FactInternetSales table can be used to analyze critical financial data such as sales, costs,
and profit margin for items defined by the user selected filter.
What's next?
Lesson 7: Create Key Performance Indicators.
Create Key Performance Indicators
8/27/2018 • 2 minutes to read • Edit Online
APPLIES TO: SQL Server Analysis Services (starting with 2017) Azure Analysis Services
In this lesson, you create Key Performance Indicators (KPIs). KPIs are used to gauge performance of a value
defined by a Base measure, against a Target value also defined by a measure, or by an absolute value. In reporting
client applications, KPIs can provide business professionals a quick and easy way to understand a summary of
business success or to identify trends. To learn more, see KPIs
Estimated time to complete this lesson: 15 minutes
Prerequisites
This article is part of a tabular modeling tutorial, which should be completed in order. Before performing the tasks
in this lesson, you should have completed the previous lesson: Lesson 6: Create measures.
InternetCurrentQuarterSalesPerformance
:=DIVIDE([InternetCurrentQuarterSales]/[InternetPreviousQuarterSalesProportionToQTD],BLANK())
InternetCurrentQuarterMarginPerformance :=IF([InternetPreviousQuarterMarginProportionToQTD]<>0,
([InternetCurrentQuarterMargin]-
[InternetPreviousQuarterMarginProportionToQTD])/[InternetPreviousQuarterMarginProportionToQTD],BLANK())
What's next?
Lesson 8: Create perspectives.
Create perspectives
8/27/2018 • 2 minutes to read • Edit Online
APPLIES TO: SQL Server Analysis Services (starting with 2017) Azure Analysis Services
In this lesson, you create an Internet Sales perspective. A perspective defines a viewable subset of a model that
provides focused, business-specific, or application-specific viewpoints. When a user connects to a model by using
a perspective, they see only those model objects (tables, columns, measures, hierarchies, and KPIs) as fields
defined in that perspective. To learn more, see Perspectives.
The Internet Sales perspective you create in this lesson excludes the DimCustomer table object. When you create a
perspective that excludes certain objects from view, that object still exists in the model. However, it is not visible in
a reporting client field list. Calculated columns and measures either included in a perspective or not can still
calculate from object data that is excluded.
The purpose of this lesson is to describe how to create perspectives and become familiar with the tabular model
authoring tools. If you later expand this model to include additional tables, you can create additional perspectives
to define different viewpoints of the model, for example, Inventory and Sales.
Estimated time to complete this lesson: Five minutes
Prerequisites
This article is part of a tabular modeling tutorial, which should be completed in order. Before performing the tasks
in this lesson, you should have completed the previous lesson: Lesson 7: Create Key Performance Indicators.
Create perspectives
To create an Internet Sales perspective
1. Click the Model menu > Perspectives > Create and Manage.
2. In the Perspectives dialog box, click New Perspective.
3. Double-click the New Perspective column heading, and then rename Internet Sales.
4. Select the all the tables except DimCustomer.
In a later lesson, you use the Analyze in Excel feature to test this perspective. The Excel PivotTable Fields List
includes each table except the DimCustomer table.
What's next?
Lesson 9: Create hierarchies.
Create hierarchies
8/27/2018 • 2 minutes to read • Edit Online
APPLIES TO: SQL Server Analysis Services (starting with 2017) Azure Analysis Services
In this lesson, you create hierarchies. Hierarchies are groups of columns arranged in levels. For example, a
Geography hierarchy might have sublevels for Country, State, County, and City. Hierarchies can appear separate
from other columns in a reporting client application field list, making them easier for client users to navigate and
include in a report. To learn more, see Hierarchies
To create hierarchies, use the model designer in Diagram View. Creating and managing hierarchies is not
supported in Data View.
Estimated time to complete this lesson: 20 minutes
Prerequisites
This article is part of a tabular modeling tutorial, which should be completed in order. Before performing the tasks
in this lesson, you should have completed the previous lesson: Lesson 8: Create perspectives.
Create hierarchies
To create a Category hierarchy in the DimProduct table
1. In the model designer (diagram view ), right-click the DimProduct table > Create Hierarchy. A new
hierarchy appears at the bottom of the table window. Rename the hierarchy Category.
2. Click and drag the ProductCategoryName column to the new Category hierarchy.
3. In the Category hierarchy, right-click ProductCategoryName > Rename, and then type Category.
NOTE
Renaming a column in a hierarchy does not rename that column in the table. A column in a hierarchy is just a
representation of the column in the table.
4. Click and drag the ProductSubcategoryName column to the Category hierarchy. Rename it
Subcategory.
5. Right-click the ModelName column > Add to hierarchy, and then select Category. Rename it Model.
6. Finally, add EnglishProductName to the Category hierarchy. Rename it Product.
To create hierarchies in the DimDate table
1. In the DimDate table, create a hierarchy named Calendar.
2. Add the following columns in-order:
CalendarYear
CalendarSemester
CalendarQuarter
MonthCalendar
DayNumberOfMonth
3. In the DimDate table, create a Fiscal hierarchy. Include the following columns in-order:
FiscalYear
FiscalSemester
FiscalQuarter
MonthCalendar
DayNumberOfMonth
4. Finally, in the DimDate table, create a ProductionCalendar hierarchy. Include the following columns in-
order:
CalendarYear
WeekNumberOfYear
DayNumberOfWeek
What's next?
Lesson 10: Create partitions.
Create partitions
11/27/2018 • 3 minutes to read • Edit Online
APPLIES TO: SQL Server Analysis Services (starting with 2017) Azure Analysis Services
In this lesson, you create partitions to divide the FactInternetSales table into smaller logical parts that can be
processed (refreshed) independent of other partitions. By default, every table you include in your model has one
partition, which includes all the table's columns and rows. For the FactInternetSales table, we want to divide the
data by year; one partition for each of the table's five years. Each partition can then be processed independently. To
learn more, see Partitions.
Estimated time to complete this lesson: 15 minutes
Prerequisites
This article is part of a tabular modeling tutorial, which should be completed in order. Before performing the tasks
in this lesson, you should have completed the previous lesson: Lesson 9: Create Hierarchies.
Create partitions
To create partitions in the FactInternetSales table
1. In Tabular Model Explorer, expand Tables, and then right-click FactInternetSales > Partitions.
2. In Partition Manager, click Copy, and then change the name to FactInternetSales2010.
Because you want the partition to include only those rows within a certain period, for the year 2010, you
must modify the query expression.
3. Click Design to open Query Editor, and then click the FactInternetSales2010 query.
4. In preview, click the down arrow in the OrderDate column heading, and then click Date/Time Filters >
Between.
5. In the Filter Rows dialog box, in Show rows where: OrderDate, leave is after or equal to, and then in the
date field, enter 1/1/2010. Leave the And operator selected, then select is before, then in the date field,
enter 1/1/2011, and then click OK.
Notice in Query Editor, in APPLIED STEPS, you see another step named Filtered Rows. This filter is to
select only order dates from 2010.
6. Click Import.
In Partition Manager, notice the query expression now has an additional Filtered Rows clause.
This statement specifies this partition should include only the data in those rows where the OrderDate is in
the 2010 calendar year as specified in the filtered rows clause.
To create a partition for the 2011 year
1. In the partitions list, click the FactInternetSales2010 partition you created, and then click Copy. Change
the partition name to FactInternetSales2011.
You do not need to use Query Editor to create a new filtered rows clause. Because you created a copy of the
query for 2010, all you need to do is make a slight change in the query for 2011.
2. In Query Expression, in-order for this partition to include only those rows for the 2011 year, replace the
years in the Filtered Rows clause with 2011 and 2012, respectively, like:
let
Source = #"SQL/localhost;AdventureWorksDW2014",
dbo_FactInternetSales = Source{[Schema="dbo",Item="FactInternetSales"]}[Data],
#"Removed Columns" = Table.RemoveColumns(dbo_FactInternetSales,{"OrderDateKey", "DueDateKey",
"ShipDateKey"}),
#"Filtered Rows" = Table.SelectRows(#"Removed Columns", each [OrderDate] >= #datetime(2011, 1, 1,
0, 0, 0) and [OrderDate] < #datetime(2012, 1, 1, 0, 0, 0))
in
#"Filtered Rows"
Process partitions
In Partition Manager, notice the Last Processed column for each of the new partitions you created shows these
partitions have never been processed. When you create partitions, you should run a Process Partitions or Process
Table operation to refresh the data in those partitions.
To process the FactInternetSales partitions
1. Click OK to close Partition Manager.
2. Click the FactInternetSales table, then click the Model menu > Process > Process Partitions.
3. In the Process Partitions dialog box, verify Mode is set to Process Default.
4. Select the checkbox in the Process column for each of the five partitions you created, and then click OK.
If you're prompted for Impersonation credentials, enter the Windows user name and password you
specified in Lesson 2.
The Data Processing dialog box appears and displays process details for each partition. Notice that a
different number of rows for each partition are transferred. Each partition includes only those rows for the
year specified in the WHERE clause in the SQL Statement. When processing is finished, go ahead and close
the Data Processing dialog box.
What's next?
Go to the next lesson: Lesson 11: Create Roles.
Create roles
11/28/2018 • 3 minutes to read • Edit Online
APPLIES TO: SQL Server Analysis Services (starting with 2017) Azure Analysis Services
In this lesson, you create roles. Roles provide model database object and data security by limiting access to only
those users that are role members. Each role is defined with a single permission: None, Read, Read and Process,
Process, or Administrator. Roles can be defined during model authoring by using Role Manager. After a model
has been deployed, you can manage roles by using SQL Server Management Studio (SSMS ). To learn more, see
Roles.
NOTE
Creating roles is not necessary to complete this tutorial. By default, the account you are currently logged in with has
Administrator privileges on the model. However, for other users in your organization to browse by using a reporting client,
you must create at least one role with Read permissions and add those users as members.
Prerequisites
This article is part of a tabular modeling tutorial, which should be completed in order. Before performing the tasks
in this lesson, you should have completed the previous lesson: Lesson 10: Create partitions.
Create roles
To create a Sales Manager user role
1. In Tabular Model Explorer, right-click Roles > Roles.
2. In Role Manager, click New.
3. Click the new role, and then in the Name column, rename the role to Sales Manager.
4. In the Permissions column, click the dropdown list, and then select the Read permission.
5. Optional: Click the Members tab, and then click Add. In the Select Users or Groups dialog box, enter the
Windows users or groups from your organization you want to include in the role.
To create a Sales Analyst US user role
1. In Role Manager, click New.
2. Rename the role to Sales Analyst US.
3. Give this role Read permission.
4. Click the Row Filters tab, and then for the DimGeography table only, in the DAX Filter column, type the
following formula:
=DimGeography[CountryRegionCode] = "US"
A Row Filter formula must resolve to a Boolean (TRUE/FALSE ) value. With this formula, you are specifying
that only rows with the Country Region Code value of "US" are visible to the user.
5. Optional: Click the Members tab, and then click Add. In the Select Users or Groups dialog box, enter the
Windows users or groups from your organization you want to include in the role.
To create an Administrator user role
1. Click New.
2. Rename the role to Administrator.
3. Give this role Administrator permission.
4. Optional: Click the Members tab, and then click Add. In the Select Users or Groups dialog box, enter the
Windows users or groups from your organization you want to include in the role.
What's next?
Lesson 12: Analyze in Excel.
Analyze in Excel
8/27/2018 • 2 minutes to read • Edit Online
APPLIES TO: SQL Server Analysis Services (starting with 2017) Azure Analysis Services
In this lesson, you use the Analyze in Excel feature to open Microsoft Excel, automatically create a connection to
the model workspace, and automatically add a PivotTable to the worksheet. The Analyze in Excel feature is meant
to provide a quick and easy way to test the efficacy of your model design prior to deploying your model. You do
not perform any data analysis in this lesson. The purpose of this lesson is to familiarize you, the model author, with
the tools you can use to test your model design.
To complete this lesson, Excel must be installed on the same computer as Visual Studio.
Estimated time to complete this lesson: 5 minutes
Prerequisites
This article is part of a tabular modeling tutorial, which should be completed in order. Before performing the tasks
in this lesson, you should have completed the previous lesson: Lesson 11: Create roles.
What's next?
Go to the next lesson: Lesson 13: Deploy.
Deploy
8/27/2018 • 2 minutes to read • Edit Online
APPLIES TO: SQL Server Analysis Services (starting with 2017) Azure Analysis Services
In this lesson, you configure deployment properties; specifying a server to deploy to and a name for the model.
You then deploy the model to the server. After your model is deployed, users can connect to it by using a reporting
client application. To learn more, see Deploy to Azure Analysis Services and Tabular model solution deployment.
Estimated time to complete this lesson: 5 minutes
Prerequisites
This article is part of a tabular modeling tutorial, which should be completed in order. Before performing the tasks
in this lesson, you should have completed the previous lesson: Lesson 12: Analyze in Excel.
IMPORTANT
If deploying to Azure Analysis Services, you must have Administrator permissions on the serever.
IMPORTANT
If you installed the AdventureWorksDW sample database on an on-premises SQL Server, and you're deploying your model
to an Azure Analysis Services server, an On-premises data gateway is required.
Conclusion
Congratulations! You're finished authoring and deploying your first Analysis Services Tabular model. This tutorial
has helped guide you through completing the most common tasks in creating a tabular model. Now that your
Adventure Works Internet Sales model is deployed, you can use SQL Server Management Studio to manage the
model; create process scripts and a backup plan. Users can also now connect to the model using a reporting client
application such as Microsoft Excel or Power BI.
What's next?
Connect with Power BI Desktop
Supplemental Lesson - Dynamic security
Supplemental Lesson - Detail rows
Supplemental Lesson - Ragged hierarchies
Supplemental lesson - Detail Rows
8/27/2018 • 2 minutes to read • Edit Online
APPLIES TO: SQL Server Analysis Services (starting with 2017) Azure Analysis Services
In this supplemental lesson, you use the DAX Editor to define a custom Detail Rows Expression. A Detail Rows
Expression is a property on a measure, providing end-users more information about the aggregated results of a
measure.
Estimated time to complete this lesson: 10 minutes
Prerequisites
This supplemental lesson article is part of a tabular modeling tutorial. Before performing the tasks in this
supplemental lesson, you should have completed all previous lessons or have a completed Adventure Works
Internet Sales sample model project.
3. In the PivotTable, double-click an aggregated value for a year and a region name. Here we double-clicked
the value for Australia and the year 2014. A new sheet opens containing data, but not useful data.
What we want to see here is a table containing columns and rows of data that contribute to the aggregated result
of the InternetTotalSales measure. To do that, we can add a Detail Rows Expression as a property of the measure.
SELECTCOLUMNS(
FactInternetSales,
"Sales Order Number", FactInternetSales[SalesOrderNumber],
"Customer First Name", RELATED(DimCustomer[FirstName]),
"Customer Last Name", RELATED(DimCustomer[LastName]),
"City", RELATED(DimGeography[City]),
"Order Date", FactInternetSales[OrderDate],
"Internet Total Sales", [InternetTotalSales]
)
This expression specifies names, columns, and measure results from the FactInternetSales table and related
tables are returned when a user double-clicks an aggregated result in a PivotTable or report.
4. Back in Excel, delete the sheet created in Step 3, then double-click an aggregated value. This time, with a
Detail Rows Expression property defined for the measure, a new sheet opens containing a lot more useful
data.
5. Redeploy your model.
See also
SELECTCOLUMNS Function (DAX)
Supplemental lesson - Dynamic security
Supplemental lesson - Ragged hierarchies
Supplemental lesson - Dynamic security
11/27/2018 • 9 minutes to read • Edit Online
APPLIES TO: SQL Server Analysis Services (starting with 2017) Azure Analysis Services
In this supplemental lesson, you create an additional role that implements dynamic security. Dynamic security
provides row -level security based on the user name or login id of the user currently logged on.
To implement dynamic security, you add a table to your model containing the user names of those users that can
connect to the model and browse model objects and data. The model you create using this tutorial is in the context
of Adventure Works; however, to complete this lesson, you must add a table containing users from your own
domain. You do not need the passwords for the user names that are added. To create an EmployeeSecurity table,
with a small sample of users from your own domain, you use the Paste feature, pasting employee data from an
Excel spreadsheet. In a real-world scenario, the table containing user names would typically be a table from an
actual database as a data source; for example, a real DimEmployee table.
To implement dynamic security, you use two DAX functions: USERNAME Function (DAX) and LOOKUPVALUE
Function (DAX). These functions, applied in a row filter formula, are defined in a new role. By using the
LOOKUPVALUE function, the formula specifies a value from the EmployeeSecurity table. The formula then passes
that value to the USERNAME function, which specifies the user name of the user logged on belongs to this role.
The user can then browse only data specified by the role's row filters. In this scenario, you specify that sales
employees can only browse Internet sales data for the sales territories in which they are a member.
Those tasks that are unique to this Adventure Works tabular model scenario, but would not necessarily apply to a
real-world scenario are identified as such. Each task includes additional information describing the purpose of the
task.
Estimated time to complete this lesson: 30 minutes
Prerequisites
This supplemental lesson article is part of a tabular modeling tutorial, which should be completed in order. Before
performing the tasks in this supplemental lesson, you should have completed all previous lessons.
|EmployeeId|SalesTerritoryId|FirstName|LastName|LoginId|
|---------------|----------------------|--------------|-------------|------------|
|1|2|<user first name>|<user last name>|\<domain\username>|
|1|3|<user first name>|<user last name>|\<domain\username>|
|2|4|<user first name>|<user last name>|\<domain\username>|
|3|5|<user first name>|<user last name>|\<domain\username>|
3. Replace the first name, last name, and domain\username with the names and login ids of three users in
your organization. Put the same user on the first two rows, for EmployeeId 1, showing this user belongs to
more than one sales territory. Leave the EmployeeId and SalesTerritoryId fields as they are.
4. Save the worksheet as SampleEmployee.
5. In the worksheet, select all the cells with employee data, including the headers, then right-click the selected
data, and then click Copy.
6. In SSDT, click the Edit menu, and then click Paste.
If Paste is grayed out, click any column in any table in the model designer window, and try again.
7. In the Paste Preview dialog box, in Table Name, type EmployeeSecurity.
8. In Data to be pasted, verify the data includes all the user data and headers from the SampleEmployee
worksheet.
9. Verify Use first row as column headers is checked, and then click Ok.
A new table named EmployeeSecurity with employee data copied from the SampleEmployee worksheet is
created.
NOTE
The Sales Employees by Territory role you create in this lesson restricts members to browse (or query) only sales data for the
sales territory to which they belong. If you add a user as a member to the Sales Employees by Territory role that also exists
as a member in a role created in Lesson 11: Create Roles, you get a combination of permissions. When a user is a member of
multiple roles, the permissions, and row filters defined for each role are cumulative. That is, the user has the greater
permissions determined by the combination of roles.
This formula specifies that all columns resolve to the false Boolean condition. No columns for the
EmployeeSecurity table can be queried by a member of the Sales Employees by Territory user role.
9. For the DimSalesTerritory table, type the following formula:
In this formula, the LOOKUPVALUE function returns all values for the
DimEmployeeSecurity[SalesTerritoryId] column, where the EmployeeSecurity[LoginId] is the same as the
current logged on Windows user name, and EmployeeSecurity[SalesTerritoryId] is the same as the
DimSalesTerritory[SalesTerritoryId].
The set of sales territory IDs returned by LOOKUPVALUE is then used to restrict the rows shown in the
DimSalesTerritory table. Only rows where the SalesTerritoryID for the row is in the set of IDs returned by
the LOOKUPVALUE function are displayed.
10. In Role Manager, click Ok.
See Also
USERNAME Function (DAX)
LOOKUPVALUE Function (DAX)
CUSTOMDATA Function (DAX)
Supplemental lesson - Ragged hierarchies
8/27/2018 • 2 minutes to read • Edit Online
APPLIES TO: SQL Server Analysis Services (starting with 2017) Azure Analysis Services
In this supplemental lesson, you resolve a common problem when pivoting on hierarchies that contain blank
values (members) at different levels. For example, an organization where a high-level manager has both
departmental managers and non-managers as direct reports. Or, geographic hierarchies composed of Country-
Region-City, where some cities lack a parent State or Province, such as Washington D.C., Vatican City. When a
hierarchy has blank members, it often descends to different, or ragged, levels.
Tabular models at the 1400 compatibility level have an additional Hide Members property for hierarchies. The
Default setting assumes there are no blank members at any level. The Hide blank members setting excludes
blank members from the hierarchy when added to a PivotTable or report.
Estimated time to complete this lesson: 20 minutes
Prerequisites
This supplemental lesson article is part of a tabular modeling tutorial. Before performing the tasks in this
supplemental lesson, you should have completed all previous lessons or have a completed Adventure Works
Internet Sales sample model project.
If you've created the AW Internet Sales project as part of the tutorial, your model does not yet contain any data or
hierarchies that are ragged. To complete this supplemental lesson, you first have to create the problem by adding
some additional tables, create relationships, calculated columns, a measure, and a new Organization hierarchy.
That part takes about 15 minutes. Then, you get to solve it in just a few minutes.
=PATH([EmployeeKey],[ParentEmployeeKey])
FullName
=[FirstName] & " " & [MiddleName] & " " & [LastName]
Level1
=LOOKUPVALUE(DimEmployee[FullName],DimEmployee[EmployeeKey],PATHITEM([Path],1,1))
Level2
=LOOKUPVALUE(DimEmployee[FullName],DimEmployee[EmployeeKey],PATHITEM([Path],2,1))
Level3
=LOOKUPVALUE(DimEmployee[FullName],DimEmployee[EmployeeKey],PATHITEM([Path],3,1))
Level4
=LOOKUPVALUE(DimEmployee[FullName],DimEmployee[EmployeeKey],PATHITEM([Path],4,1))
Level5
=LOOKUPVALUE(DimEmployee[FullName],DimEmployee[EmployeeKey],PATHITEM([Path],5,1))
6. In the DimEmployee table, create a hierarchy named Organization. Add the following columns in-order:
Level1, Level2, Level3, Level4, Level5.
7. In the FactResellerSales table, create the following measure:
ResellerTotalSales:=SUM([SalesAmount])
As you can see in the PivotTable, the hierarchy displays rows that are ragged. There are many rows where
blank members are shown.
See Also
Lesson 9: Create hierarchies
Supplemental Lesson - Dynamic security
Supplemental Lesson - Detail rows
Tabular Modeling (1200 compatibility level)
12/7/2018 • 4 minutes to read • Edit Online
APPLIES TO: SQL Server Analysis Services (starting with 2016) Azure Analysis Services
This tutorial provides lessons on how to create an Analysis Services tabular model at the 1200 compatibility level
by using SQL Server Data Tools (SSDT), and deploy your model to an Analysis Services server on-premises or in
Azure.
If you're using SQL Server 2017 or Azure Analysis Services, and you want to create your model at the 1400
compatibility level, use the Tabular modeling (1400 compatibility level). This updated version uses the modern Get
Data feature to connect and import source data, uses the M language to configure partitions, and includes
additional supplemental lessons.
IMPORTANT
You should create your tabular models at the latest compatibility level supported by your server. Later compatibility level
models provide improved performance, additional features, and will upgrade to future compatibility levels more seamlessly.
Scenario
This tutorial is based on Adventure Works Cycles, a fictitious company. Adventure Works is a large, multinational
manufacturing company that produces bicycles, parts, and accessories for commercial markets in North America,
Europe, and Asia. With headquarters in Bothell, Washington, the company employs 500 workers. Additionally,
Adventure Works employs several regional sales teams throughout its market base.
To better support the data analysis needs of sales and marketing teams and of senior management, you are tasked
with creating a tabular model for users to analyze Internet sales data in the AdventureWorksDW sample database.
In order to complete the tutorial, and the Adventure Works Internet Sales tabular model, you must complete a
number of lessons. In each lesson is a number of tasks; completing each task in order is necessary for completing
the lesson. While in a particular lesson there may be several tasks that accomplish a similar outcome, but how you
complete each task is slightly different. This is to show that there is often more than one way to complete a
particular task, and to challenge you by using skills you've learned in previous tasks.
The purpose of the lessons is to guide you through authoring a basic tabular model running in In-Memory mode
by using many of the features included in SSDT. Because each lesson builds upon the previous lesson, you should
complete the lessons in order. Once you've completed all of the lessons, you have authored and deployed the
Adventure Works Internet Sales sample tabular model on an Analysis Services server.
This tutorial does not provide lessons or information about managing a deployed tabular model database by using
SQL Server Management Studio, or using a reporting client application to connect to a deployed model to browse
model data.
Prerequisites
In order to complete this tutorial, you need the following prerequisites:
The latest version of SSDT.
The latest version of SQL Server Management Studio. Get the latest version.
A client application such as Power BI Desktop or Excel.
A SQL Server instance with the Adventure Works DW sample database. This sample database includes the
data necessary to complete this tutorial. Get the latest version.
An Azure Analysis Services or SQL Server 2016 or later Analysis Services instance to deploy your model
to. Sign up for a free Azure Analysis Services trial.
Lessons
This tutorial includes the following lessons:
Supplemental lessons
This tutorial also includes Supplemental Lessons. Topics in this section are not required to complete the tutorial,
but can be helpful in better understanding advanced tabular model authoring features.
Next step
To begin the tutorial, continue to the first lesson: Lesson 1: Create a New Tabular Model Project.
Lesson 1: Create a New Tabular Model Project
11/27/2018 • 4 minutes to read • Edit Online
APPLIES TO: SQL Server Analysis Services (starting with 2016) Azure Analysis Services
In this lesson, you will create a new, blank tabular model project in SQL Server Data Tools (SSDT). Once your new
project is created, you can begin adding data by using the Table Import Wizard. This lesson also gives you a brief
introduction to the tabular model authoring environment in SSDT.
Estimated time to complete this lesson: 10 minutes
Prerequisites
This topic is the first lesson in a tabular model authoring tutorial. To complete this lesson, you must have the
AdventureWorksDW sample database installed on a SQL Server instance. To learn more, see Tabular Modeling
(Adventure Works Tutorial).
Click the Solution Explorer tab. Here, you'll see your Model.bim file. If you don't see the designer window to
the left (the empty window with the Model.bim tab), in Solution Explorer, under AW Internet Sales Project,
double-click the Model.bim file. The Model.bim file contains all of the metadata for your model project.
Let's look at the model properties. Click Model.bim. In the Properties window, you'll see the model properties,
most important of which is the DirectQuery Mode property. This property specifies whether or not the model is
deployed in In-Memory mode (Off) or DirectQuery mode (On). For this tutorial, you will author and deploy your
model in In-Memory mode.
When you create a new model, certain model properties are set automatically according to the Data Modeling
settings that can be specified in the Tools > Options dialog box. Data Backup, Workspace Retention, and
Workspace Server properties specify how and where the workspace database (your model authoring database) is
backed up, retained in-memory, and built. You can change these settings later if necessary, but for now, just leave
these properties as they are.
In Solution Explorer, right-click AW Internet Sales (project), and then click Properties. The AW Internet
Sales Property Pages dialog box appears. These are the advanced project properties. You will set some of these
properties later when you are ready to deploy your model.
When you installed SSDT, several new menu items were added to the Visual Studio environment. Let's look at
those specific to authoring tabular models. Click on the Model menu. From here, you can launch the Table Import
Wizard, view and edit existing connections, refresh workspace data, browse your model in Excel with the Analyze
in Excel feature, create perspectives and roles, select the model view, and set calculation options.
Click on the Table menu. Here, you can create and manage relationships between tables, create and manage,
specify date table settings, create partitions, and edit table properties.
Click on the Column menu. Here, you can add and delete columns in a table, freeze columns, and specify sort
order. You can also use the AutoSum feature to create a standard aggregation measure for a selected column.
Other toolbar buttons provide quick access to frequently used features and commands.
Explore some of the dialogs and locations for various features specific to authoring tabular models. While some
items will not yet be active, you can get a good idea of the tabular model authoring environment.
Additional resources
To learn more about the different types of tabular model projects, see Tabular Model Projects. To learn more about
the tabular model authoring environment, see Tabular Model Designer .
What's next?
Go to the next lesson: Lesson 2: Add data.
Lesson 2: Add Data
2/26/2019 • 4 minutes to read • Edit Online
APPLIES TO: SQL Server Analysis Services (starting with 2016) Azure Analysis Services
In this lesson, you'll use the Table Import Wizard in SSDT to connect to the AdventureWorksDW SQL sample
database, select data, preview and filter the data, and then import the data into your model workspace.
By using the Table Import Wizard, you can import data from a variety of relational sources: Access, SQL, Oracle,
Sybase, Informix, DB2, Teradata, and more. The steps for importing data from each of these relational sources are
very similar to what is described below. Data can also be selected using a stored procedure. To learn more about
importing data and the different types of data sources you can import from, see Data Sources.
Estimated time to complete this lesson: 20 minutes
Prerequisites
This topic is part of a tabular modeling tutorial, which should be completed in order. Before performing the tasks
in this lesson, you should have completed the previous lesson: Lesson 1: Create a New Tabular Model Project.
Create a connection
To create a connection to a the AdventureWorksDW2014 database
1. In Tabular Model Explorer, right-click Data Sources > Import from Data Source.
This launches the Table Import Wizard, which guides you through setting up a connection to a data source.
If you don't see Tabular Model Explorer, double click Model.bim in Solution Explorer to open the model
in the designer.
Note: If you're creating your model at the 1400 compatibility level, you'll see the new Get Data experience
instead of the Table Import Wizard. The dialogs will appear a little different from the steps below, but you'll
still be able to follow along.
2. In the Table Import Wizard, under Relational Databases, click Microsoft SQL Server > Next.
3. In the Connect to a Microsoft SQL Server Database page, in Friendly Connection Name, type
Adventure Works DB from SQL.
4. In Server name, type the name of the server where you installed the AdventureWorksDW database.
5. In the Database name field, select AdventureWorksDW, and then click Next.
6. In the Impersonation Information page, you need to specify the credentials Analysis Services will use to
connect to the data source when importing and processing data. Verify Specific Windows user name
and password is selected, and then in User Name and Password, enter your Windows logon credentials,
and then click Next.
NOTE
Using a Windows user account and password provides the most secure method of connecting to a data source. For
more information, see Impersonation.
7. In the Choose How to Import the Data page, verify Select from a list of tables and views to choose
the data to import is selected. You want to select from a list of tables and views, so click Next to display a
list of all the source tables in the source database.
8. In the Select Tables and Views page, select the check box for the following tables: DimCustomer,
DimDate, DimGeography, DimProduct, DimProductCategory, DimProductSubcategory, and
FactInternetSales.
DO NOT click Finish.
Since the values for these columns are not relevant to Internet sales analysis, there is no need to import
these columns. Eliminating unnecessary columns will make your model smaller and more efficient.
3. Verify that all other columns are checked, and then click OK.
Notice the words Applied filters are now displayed in the Filter Details column in the DimCustomer
row; if you click on that link you'll see a text description of the filters you just applied.
4. Filter the remaining tables by clearing the checkboxes for the following columns in each table:
DimDate
COLUMN
DateKey
SpanishDayNameOfWeek
FrenchDayNameOfWeek
SpanishMonthName
FrenchMonthName
DimGeography
COLUMN
SpanishCountryRegionName
FrenchCountryRegionName
IpAddressLocator
DimProduct
COLUMN
SpanishProductName
FrenchProductName
FrenchDescription
ChineseDescription
ArabicDescription
HebrewDescription
ThaiDescription
GermanDescription
JapaneseDescription
TurkishDescription
DimProductCategory
COLUMN
SpanishProductCategoryName
FrenchProductCategoryName
DimProductSubcategory
COLUMN
SpanishProductSubcategoryName
FrenchProductSubcategoryName
FactInternetSales
COLUMN
OrderDateKey
DueDateKey
ShipDateKey
TIP
To see the relationships that were automatically created between the imported tables, on the Data preparation row,
click Details.
2. Click Close.
The wizard closes and the model designer now shows your imported tables.
What's next?
Go to the next lesson: Lesson 3: Mark as Date Table.
Lesson 3: Mark as Date Table
8/23/2018 • 2 minutes to read • Edit Online
APPLIES TO: SQL Server Analysis Services (starting with 2016) Azure Analysis Services
In Lesson 2: Add Data, you imported a dimension table named DimDate. While in your model this table is named
DimDate, it can also be known as a Date table, in that it contains date and time data.
Whenever you use DAX time-intelligence functions in calculations, as you'll do when you create measures a little
later, you must specify date table properties, which include a Date table and a unique identifier Date column in
that table.
In this lesson, you'll mark the DimDate table as the Date table and the Date column (in the Date table) as the Date
column (unique identifier).
Before we mark the date table and date column, we need to do a little housekeeping to make our model easier to
understand. You'll notice in the DimDate table a column named FullDateAlternateKey. It contains one row for
every day in each calendar year included in the table. We'll be using this column a lot in measure formulas and in
reports. But, FullDateAlternateKey is not really a good identifier for this column. We'll rename it to Date, making it
easier to identify and include in formulas. Whenever possible, it's a good idea to rename objects like tables and
columns to make them easier to identify in client reporting applications like Power BI and Excel.
Estimated time to complete this lesson: 3 minutes
Prerequisites
This topic is part of a tabular modeling tutorial, which should be completed in order. Before performing the tasks
in this lesson, you should have completed the previous lesson: Lesson 2: Add data.
To rename the FullDateAlternateKey column
1. In the model designer, click the DimDate table.
2. Double click the header for the FullDateAlternateKey column, and then rename it to Date.
To set Mark as Date Table
1. Select the Date column, and then in the Properties window, under Data Type, make sure Date is selected.
2. Click the Table menu, then click Date, and then click Mark as Date Table.
3. In the Mark as Date Table dialog box, in the Date listbox, select the Date column as the unique identifier.
It will usually be selected by default. Click OK.
What's next?
Go to the next lesson: Lesson 4: Create Relationships.
Lesson 4: Create Relationships
11/27/2018 • 4 minutes to read • Edit Online
APPLIES TO: SQL Server Analysis Services (starting with 2016) Azure Analysis Services
In this lesson, you will verify the relationships that were created automatically when you imported data and add
new relationships between different tables. A relationship is a connection between two tables that establishes how
the data in those tables should be correlated. For example, the DimProduct table and the DimProductSubcategory
table have a relationship based on the fact that each product belongs to a subcategory. To learn more, see
Relationships.
Estimated time to complete this lesson: 10 minutes
Prerequisites
This topic is part of a tabular modeling tutorial, which should be completed in order. Before performing the tasks
in this lesson, you should have completed the previous lesson: Lesson 3: Mark as Date Table.
Use the minimap controls in the lower-right corner of the model designer to adjust the view to include as
many of the tables as possible. You can also click, and drag tables to different locations, bringing tables
closer together, or putting them in a particular order. Moving tables does not affect the relationships already
between the tables. To view all of the columns in a particular table, click, and drag on a table edge to expand
or make it smaller.
2. Click the solid line between the DimCustomer table and the DimGeography table. The solid line between
these two tables show this relationship is active, that is, it is used by default when calculating DAX formulas.
Notice the GeographyKey column in the DimCustomer table and the GeographyKey column in the
DimGeography table now both each appear within a box. This show these are the columns used in the
relationship. The relationship's properties now also appear in the Properties window.
TIP
In addition to using the model designer in diagram view, you can also use the Manage Relationships dialog box to
show the relationships between all tables in a table format. Right-click Relationships in Tabular Model Explorer, and
then click Manage Relationships. The Manage Relationships dialog box show the relationships that were
automatically created when you imported data.
3. Use the model designer in diagram view, or the Manage Relationships dialog box, to verify the following
relationships were created when each of the tables were imported from the AdventureWorksDW database:
If any of the relationships in the table above are missing, verify that your model includes the following
tables: DimCustomer, DimDate, DimGeography, DimProduct, DimProductCategory,
DimProductSubcategory, and FactInternetSales. If tables from the same data source connection are
imported at separate times, any relationships between those tables will not be created and must be created
manually.
Take a closer look
In Diagram View, you'll notice an arrow, an asterisk, and a number on the lines that show the relationship between
tables.
The arrow shows the filter direction, the asterisk shows this table is the many side in the relationship's cardinality,
and the 1 shows this table is the one side of the relationship. If you need to edit a relationship; for example, change
the relationship's filter direction or cardinality, double-click the relationship line in Diagram View to open the Edit
Relationship dialog.
Most likely, you will never need to edit a relationship. These features are meant for advanced data modeling and
are outside the scope of this tutorial. To learn more, see Bi-directional cross filters for tabular models in SQL
Server 2016 Analysis Services.
In some cases, you may need to create additional relationships between tables in your model to support certain
business logic. For this tutorial, you need to create three additional relationships between the FactInternetSales
table and the DimDate table.
To add new relationships between tables
1. In the model designer, in the FactInternetSales table, click, and hold on the OrderDate column, then drag
the cursor to the Date column in the DimDate table, and then release.
A solid line appears showing you have created an active relationship between the OrderDate column in the
Internet Sales table and the Date column in the Date table.
NOTE
When creating relationships, the cardinality and filter direction between the primary table and the related lookup
table is automatically selected.
2. In the FactInternetSales table, click, and hold on the DueDate column, then drag the cursor to the Date
column in the DimDate table, and then release.
A dotted line appears showing you have created an inactive relationship between the DueDate column in
the FactInternetSales table and the Date column in the DimDate table. You can have multiple
relationships between tables, but only one relationship can be active at a time.
3. Finally, create one more relationship; in the FactInternetSales table, click, and hold on the ShipDate
column, then drag the cursor to the Date column in the DimDate table, and then release.
What's next?
Go to the next lesson: Lesson 5: Create Calculated Columns.
Lesson 5: Create Calculated Columns
8/23/2018 • 3 minutes to read • Edit Online
APPLIES TO: SQL Server Analysis Services (starting with 2016) Azure Analysis Services
In this lesson, you will create new data in your model by adding calculated columns. A calculated column is based
on data that already exists in the model. To learn more, see Calculated Columns.
You will create five new calculated columns in three different tables. The steps are slightly different for each task.
This is to show you there are several ways to create new columns, rename them, and place them in various
locations in a table.
Estimated time to complete this lesson: 15 minutes
Prerequisites
This topic is part of a tabular modeling tutorial, which should be completed in order. Before performing the tasks
in this lesson, you should have completed the previous lesson: Lesson 4: Create Relationships.
Values are then populated for all the rows in the calculated column. If you scroll down through the table,
you will see that rows can have different values for this column, based on the data that is in each row.
5. Rename this column to MonthCalendar.
When you've finished building the formula, press ENTER. The new column is added to the far right of the
table.
3. Rename the column to DayOfWeek.
4. Click on the column heading, and then drag the column between the EnglishDayNameOfWeek column
and the DayNumberOfMonth column.
TIP
Moving columns in your table makes it easier to navigate.
The DayOfWeek calculated column provides a sortable name for the day of week.
Create a ProductSubcategoryName calculated column in the DimProduct table
1. In the DimProduct table, scroll to the far right of the table. Notice the right-most column is named Add
Column (italicized), click the column heading.
2. In the formula bar, type the following formula.
=RELATED('DimProductSubcategory'[EnglishProductSubcategoryName])
=RELATED('DimProductCategory'[EnglishProductCategoryName])
=[SalesAmount]-[TotalProductCost]
4. Rename the column to Margin.
5. Drag the column between the SalesAmount column and the TaxAmt column.
The Margin calculated column is used to analyze profit margins for each sale.
What's next?
Go to the next lesson: Lesson 6: Create Measures.
Lesson 6: Create Measures
8/23/2018 • 3 minutes to read • Edit Online
APPLIES TO: SQL Server Analysis Services (starting with 2016) Azure Analysis Services
In this lesson, you will create measures to be included in your model. Similar to the calculated columns you
created in the previous lesson, a measure is a calculation created by using a DAX formula. However, unlike
calculated columns, measures are evaluated based on a user selected filter; for example, a particular column or
slicer added to the Row Labels field in a PivotTable. A value for each cell in the filter is then calculated by the
applied measure. Measures are powerful, flexible calculations that you will want to include in almost all tabular
models to perform dynamic calculations on numerical data. To learn more, see Measures.
To create measures, you will use the Measure Grid. By default, each table has an empty measure grid; however, you
typically will not create measures for every table. The measure grid appears below a table in the model designer
when in Data View. To hide or show the measure grid for a table, click the Table menu, and then click Show
Measure Grid.
You can create a measure by clicking on an empty cell in the measure grid, and then typing a DAX formula in the
formula bar. When you click ENTER to complete the formula, the measure will then appear in the cell. You can also
create measures using a standard aggregation function by clicking on a column, and then clicking on the AutoSum
button (∑) on the toolbar. Measures created using the AutoSum feature will appear in the measure grid cell
directly beneath the column, but can be moved.
In this lesson, you will create measures by both entering a DAX formula in the formula bar and by using the
AutoSum feature.
Estimated time to complete this lesson: 30 minutes
Prerequisites
This topic is part of a tabular modeling tutorial, which should be completed in order. Before performing the tasks
in this lesson, you should have completed the previous lesson: Lesson 5: Create Calculated Columns.
Create measures
To create a DaysCurrentQuarterToDate measure in the DimDate table
1. In the model designer, click the DimDate table.
2. In the measure grid, click the top-left empty cell.
3. In the formula bar, type the following formula:
Notice the top-left cell now contains a measure name, DaysCurrentQuarterToDate, followed by the
result, 92.
Unlike calculated columns, with measure formulas you can type the measure name, followed by a comma,
followed by the formula expression.
To create a DaysInCurrentQuarter measure in the DimDate table
1. With the DimDate table still active in the model designer, in the measure grid, click the empty cell below
the measure you just created.
2. In the formula bar, type the following formula:
When creating a comparison ratio between one incomplete period and the previous period; the formula
must take into account the proportion of the period that has elapsed, and compare it to the same
proportion in the previous period. In this case, [DaysCurrentQuarterToDate]/[DaysInCurrentQuarter] gives
the proportion elapsed in the current period.
To create an InternetDistinctCountSalesOrder measure in the FactInternetSales table
1. Click the FactInternetSales table.
2. Click on the SalesOrderNumber column heading.
3. On the toolbar, click the down-arrow next to the AutoSum (∑) button, and then select DistinctCount.
The AutoSum feature automatically creates a measure for the selected column using the DistinctCount
standard aggregation formula.
4. In the measure grid, click the new measure, and then in the Properties window, in Measure Name,
rename the measure to InternetDistinctCountSalesOrder.
To create additional measures in the FactInternetSales table
1. By using the AutoSum feature, create and name the following measures:
2. By clicking on an empty cell in the measure grid, and by using the formula bar, create and name the
following measures in order:
InternetPreviousQuarterMargin:=CALCULATE([InternetTotalMargin],PREVIOUSQUARTER('DimDate'[Date]))
InternetCurrentQuarterMargin:=TOTALQTD([InternetTotalMargin],'DimDate'[Date])
InternetPreviousQuarterMarginProportionToQTD:=[InternetPreviousQuarterMargin]*
([DaysCurrentQuarterToDate]/[DaysInCurrentQuarter])
InternetPreviousQuarterSales:=CALCULATE([InternetTotalSales],PREVIOUSQUARTER('DimDate'[Date]))
InternetCurrentQuarterSales:=TOTALQTD([InternetTotalSales],'DimDate'[Date])
InternetPreviousQuarterSalesProportionToQTD:=[InternetPreviousQuarterSales]*
([DaysCurrentQuarterToDate]/[DaysInCurrentQuarter])
Measures created for the FactInternetSales table can be used to analyze critical financial data such as sales, costs,
and profit margin for items defined by the user selected filter.
What's next?
Go to the next lesson: Lesson 7: Create Key Performance Indicators.
Lesson 7: Create Key Performance Indicators
8/23/2018 • 2 minutes to read • Edit Online
APPLIES TO: SQL Server Analysis Services (starting with 2016) Azure Analysis Services
In this lesson, you will create Key Performance Indicators (KPIs). KPIs are used to gauge performance of a value,
defined by a Base measure, against a Target value, also defined by a measure or by an absolute value. In reporting
client applications, KPIs can provide business professionals a quick and easy way to understand a summary of
business success or to identify trends. To learn more, see KPIs.
Estimated time to complete this lesson: 15 minutes
Prerequisites
This topic is part of a tabular modeling tutorial, which should be completed in order. Before performing the tasks
in this lesson, you should have completed the previous lesson: Lesson 6: Create Measures.
InternetCurrentQuarterSalesPerformance
:=IFERROR([InternetCurrentQuarterSales]/[InternetPreviousQuarterSalesProportionToQTD],BLANK())
This measure will serve as the Base measure for the KPI.
4. Right-click InternetCurrentQuarterSalesPerformance > Create KPI.
5. In the Key Performance Indicator (KPI) dialog box, in Target select Absolute Value, and then type 1.1.
6. In the left (low ) slider field, type 1, and then in the right (high) slider field, type 1.07.
7. In Select Icon Style, select the diamond (red), triangle (yellow ), circle (green) icon type.
TIP
Notice the expandable Descriptions label below the available icon styles. Use this to enter descriptions for the
various KPI elements to make them more identifiable in client applications.
InternetCurrentQuarterMarginPerformance :=IF([InternetPreviousQuarterMarginProportionToQTD]<>0,
([InternetCurrentQuarterMargin]-
[InternetPreviousQuarterMarginProportionToQTD])/[InternetPreviousQuarterMarginProportionToQTD],BLANK())
What's next?
Go to the next lesson: Lesson 8: Create Perspectives.
Lesson 8: Create Perspectives
8/23/2018 • 2 minutes to read • Edit Online
APPLIES TO: SQL Server Analysis Services (starting with 2016) Azure Analysis Services
In this lesson, you will create an Internet Sales perspective. A perspective defines a viewable subset of a model that
provides focused, business-specific, or application-specific viewpoints. When a user connects to a model by using
a perspective, they see only those model objects (tables, columns, measures, hierarchies, and KPIs) as fields
defined in that perspective.
The Internet Sales perspective you create in this lesson will exclude the DimCustomer table object. When you
create a perspective that excludes certain objects from view, that object still exists in the model; however, it is not
visible in a reporting client field list. Calculated columns and measures either included in a perspective or not can
still calculate from object data that is excluded.
The purpose of this lesson is to describe how to create perspectives and become familiar with the tabular model
authoring tools. If you later expand this model to include additional tables, you can create additional perspectives
to define different viewpoints of the model, for example, Inventory and Sales. To learn more, see Perspectives.
Estimated time to complete this lesson: 5 minutes
Prerequisites
This topic is part of a tabular modeling tutorial, which should be completed in order. Before performing the tasks
in this lesson, you should have completed the previous lesson: Lesson 7: Create Key Performance Indicators.
Create perspectives
To create an Internet Sales perspective
1. Click the Model menu > Perspectives > Create and Manage.
2. In the Perspectives dialog box, click New Perspective.
3. Double-click the New Perspective column heading, and then rename Internet Sales.
4. Select the all of the tables except DimCustomer.
In a later lesson, you will use the Analyze in Excel feature to test this perspective. The Excel PivotTable Fields
List will include each table except the DimCustomer table.
What's next?
Go to the next lesson: Lesson 9: Create Hierarchies.
Lesson 9: Create Hierarchies
8/23/2018 • 2 minutes to read • Edit Online
APPLIES TO: SQL Server Analysis Services (starting with 2016) Azure Analysis Services
In this lesson, you will create hierarchies. Hierarchies are groups of columns arranged in levels; for example, a
Geography hierarchy might have sub-levels for Country, State, County, and City. Hierarchies can appear separate
from other columns in a reporting client application field list, making them easier for client users to navigate and
include in a report. To learn more, see Hierarchies.
To create hierarchies, you'll use the model designer in Diagram View. Creating and managing hierarchies is not
supported in Data View.
Estimated time to complete this lesson: 20 minutes
Prerequisites
This topic is part of a tabular modeling tutorial, which should be completed in order. Before performing the tasks
in this lesson, you should have completed the previous lesson: Lesson 8: Create Perspectives.
Create hierarchies
To create a Category hierarchy in the DimProduct table
1. In the model designer (diagram view ), right-click the DimProduct table > Create Hierarchy. A new
hierarchy appears at the bottom of the table window. Rename the hierarchy Category.
2. Click and drag the ProductCategoryName column to the new Category hierarchy.
3. In the Category hierarchy, right-click the ProductCategoryName > Rename, and then type Category.
NOTE
Renaming a column in a hierarchy does not rename that column in the table. A column in a hierarchy is just a
representation of the column in the table.
4. Click and drag the ProductSubcategoryName column to the Category hierarchy. Rename it
Subcategory.
5. Right-click the ModelName column > Add to hierarchy, and then select Category. Do the same for
EnglishProductName. Rename these columns in the hierarchy Model and Product.
To create hierarchies in the DimDate table
1. In the DimDate table, create a new hierarchy named Calendar.
2. Add the following columns in-order:
CalendarYear
CalendarSemester
CalendarQuarter
MonthCalendar
DayNumberOfMonth
3. In the DimDate table, create a Fiscal hierarchy. Include the following columns:
FiscalYear
FiscalSemester
FiscalQuarter
MonthCalendar
DayNumberOfMonth
4. Finally, in the DimDate table, create a ProductionCalendar hierarchy. Include the following columns:
CalendarYear
WeekNumberOfYear
DayNumberOfWeek
What's next?
Go to the next lesson: Lesson 10: Create Partitions.
Lesson 10: Create Partitions
11/27/2018 • 3 minutes to read • Edit Online
APPLIES TO: SQL Server Analysis Services (starting with 2016) Azure Analysis Services
In this lesson, you will create partitions to divide the FactInternetSales table into smaller logical parts that can be
processed (refreshed) independent of other partitions. By default, every table you include in your model has one
partition which includes all of the table's columns and rows. For the FactInternetSales table, we want to divide the
data by year; one partition for each of the table's five years. Each partition can then be processed independently. To
learn more, see Partitions.
Estimated time to complete this lesson: 15 minutes
Prerequisites
This topic is part of a tabular modeling tutorial, which should be completed in order. Before performing the tasks
in this lesson, you should have completed the previous lesson: Lesson 9: Create Hierarchies.
Create partitions
To create partitions in the FactInternetSales table
1. In Tabular Model Explorer, expand Tables, right-click FactInternetSales > Partitions.
2. In the Partition Manager dialog box, click Copy.
3. In Partition Name, change the name to FactInternetSales2010.
TIP
Notice the column names in the Table Preview window display those columns included in the model table (checked)
with the column names from the source. This is because the Table Preview window displays columns from the source
table, not from the model table.
4. Select the SQL button just above the right side of the preview window to open the SQL Statement editor.
Because you want the partition to include only those rows within a certain period, you must include a
WHERE clause. You can only create a WHERE clause by using a SQL Statement.
5. In the SQL Statement field, replace the existing statement by copying and pasting the following statement:
SELECT
[dbo].[FactInternetSales].[ProductKey],
[dbo].[FactInternetSales].[CustomerKey],
[dbo].[FactInternetSales].[PromotionKey],
[dbo].[FactInternetSales].[CurrencyKey],
[dbo].[FactInternetSales].[SalesTerritoryKey],
[dbo].[FactInternetSales].[SalesOrderNumber],
[dbo].[FactInternetSales].[SalesOrderLineNumber],
[dbo].[FactInternetSales].[RevisionNumber],
[dbo].[FactInternetSales].[OrderQuantity],
[dbo].[FactInternetSales].[UnitPrice],
[dbo].[FactInternetSales].[ExtendedAmount],
[dbo].[FactInternetSales].[UnitPriceDiscountPct],
[dbo].[FactInternetSales].[DiscountAmount],
[dbo].[FactInternetSales].[ProductStandardCost],
[dbo].[FactInternetSales].[TotalProductCost],
[dbo].[FactInternetSales].[SalesAmount],
[dbo].[FactInternetSales].[TaxAmt],
[dbo].[FactInternetSales].[Freight],
[dbo].[FactInternetSales].[CarrierTrackingNumber],
[dbo].[FactInternetSales].[CustomerPONumber],
[dbo].[FactInternetSales].[OrderDate],
[dbo].[FactInternetSales].[DueDate],
[dbo].[FactInternetSales].[ShipDate]
FROM [dbo].[FactInternetSales]
WHERE (([OrderDate] >= N'2010-01-01 00:00:00') AND ([OrderDate] < N'2011-01-01 00:00:00'))
This statement specifies the partition should include all of the data in those rows where the OrderDate is
for the 2010 calendar year as specified in the WHERE clause.
6. Click Validate.
To create a partition for the 2011 year
1. In the partitions list, click the FactInternetSales2010 partition you just created, and then click Copy.
2. In Partition Name, type FactInternetSales2011.
3. In the SQL Statement, in-order for the partition to include only those rows for the 2011 year, replace the
WHERE clause with the following:
WHERE (([OrderDate] >= N'2011-01-01 00:00:00') AND ([OrderDate] < N'2012-01-01 00:00:00'))
WHERE (([OrderDate] >= N'2012-01-01 00:00:00') AND ([OrderDate] < N'2013-01-01 00:00:00'))
WHERE (([OrderDate] >= N'2013-01-01 00:00:00') AND ([OrderDate] < N'2014-01-01 00:00:00'))
WHERE (([OrderDate] >= N'2014-01-01 00:00:00') AND ([OrderDate] < N'2015-01-01 00:00:00'))
Delete the FactInternetSales partition
Now that you have partitions for each year, you can delete the FactInternetSales partition. This prevents overlap
when choosing Process all when processing partitions.
To delete the FactInternetSales partition
Click the FactInternetSales partition, and then click Delete.
Process partitions
In Partition Manager, notice the Last Processed column for each of the new partitions you just created shows
these partitions have never been processed. When you create new partitions, you should run a Process Partitions
or Process Table operation to refresh the data in those partitions.
To process the FactInternetSales partitions
1. Click OK to close the Partition Manager dialog box.
2. Click the FactInternetSales table, then click the Model menu > Process > Process Partitions.
3. In the Process Partitions dialog box, verify Mode is set to Process Default.
4. Select the checkbox in the Process column for each of the five partitions you created, and then click OK.
If you're prompted for Impersonation credentials, enter the Windows user name and password you
specified in Lesson 2.
The Data Processing dialog box appears and displays process details for each partition. Notice that a
different number of rows for each partition are transferred. This is because each partition includes only
those rows for the year specified in the WHERE clause in the SQL Statement. When processing is finished,
go ahead and close the Data Processing dialog box.
What's next?
Go to the next lesson: Lesson 11: Create Roles.
Lesson 11: Create Roles
11/28/2018 • 3 minutes to read • Edit Online
APPLIES TO: SQL Server Analysis Services (starting with 2016) Azure Analysis Services
In this lesson, you will create roles. Roles provide model database object and data security by limiting access to
only those Windows users which are role members. Each role is defined with a single permission: None, Read,
Read and Process, Process, or Administrator. Roles can be defined during model authoring by using Role
Manager. After a model has been deployed, you can manage roles by using SQL Server Management Studio. To
learn more, see Roles.
NOTE
Creating roles is not necessary to complete this tutorial. By default, the account you are currently logged in with will have
Administrator privileges on the model. However, to allow other users in your organization to browse the model by using a
reporting client, you must create at least one role with Read permissions and add those users as members.
Prerequisites
This topic is part of a tabular modeling tutorial, which should be completed in order. Before performing the tasks
in this lesson, you should have completed the previous lesson: Lesson 10: Create Partitions.
Create roles
To create a Sales Manager user role
1. In Tabular Model Explorer, right-click Roles > Roles.
2. In Role Manager, click New.
3. Click on the new role, and then in the Name column, rename the role to Sales Manager.
4. In the Permissions column, click the dropdown list, and then select the Read permission.
5. Optional: Click the Members tab, and then click Add. In the Select Users or Groups dialog box, enter the
Windows users or groups from your organization you want to include in the role.
To create a Sales Analyst US user role
1. In Role Manager, click New.
2. Rename the role to Sales Analyst US.
3. Give this role Read permission.
4. Click on the Row Filters tab, and then for the DimGeography table only, in the DAX Filter column, type the
following formula:
=DimGeography[CountryRegionCode] = "US"
A Row Filter formula must resolve to a Boolean (TRUE/FALSE ) value. With this formula, you are specifying
that only rows with the Country Region Code value of "US" be visible to the user.
5. Optional: Click on the Members tab, and then click Add. In the Select Users or Groups dialog box, enter
the Windows users or groups from your organization you want to include in the role.
To create an Administrator user role
1. Click New.
2. Rename the role to Administrator.
3. Give this role Administrator permission.
4. Optional: Click on the Members tab, and then click Add. In the Select Users or Groups dialog box, enter
the Windows users or groups from your organization you want to include in the role.
What's next?
Go to the next lesson: Lesson 12: Analyze in Excel.
Lesson 12: Analyze in Excel
8/23/2018 • 2 minutes to read • Edit Online
APPLIES TO: SQL Server Analysis Services (starting with 2016) Azure Analysis Services
In this lesson, you will use the Analyze in Excel feature in SSDT to open Microsoft Excel, automatically create a
data source connection to the model workspace, and automatically add a PivotTable to the worksheet. The Analyze
in Excel feature is meant to provide a quick and easy way to test the efficacy of your model design prior to
deploying your model. You will not perform any data analysis in this lesson. The purpose of this lesson is to
familiarize you, the model author, with the tools you can use to test your model design. Unlike using the Analyze in
Excel feature, which is meant for model authors, end-users will use client reporting applications like Excel or Power
BI to connect to and browse deployed model data.
In order to complete this lesson, Excel must be installed on the same computer as SSDT. To learn more, see
Analyze in Excel.
Estimated time to complete this lesson: 20 minutes
Prerequisites
This topic is part of a tabular modeling tutorial, which should be completed in order. Before performing the tasks
in this lesson, you should have completed the previous lesson: Lesson 11: Create Roles.
What's next?
Go to the next lesson: Lesson 13: Deploy.
Lesson 13: Deploy
8/23/2018 • 2 minutes to read • Edit Online
APPLIES TO: SQL Server Analysis Services (starting with 2016) Azure Analysis Services
In this lesson, you will configure deployment properties; specifying an on-premises or Azure server instance, and a
name for the model. You'll then deploy the model to that instance. After your model is deployed, users can connect
to it by using a reporting client application. To learn more about deploying, see Tabular model solution deployment
and Deploy to Azure Analysis Services.
Estimated time to complete this lesson: 5 minutes
Prerequisites
This topic is part of a tabular modeling tutorial, which should be completed in order. Before performing the tasks
in this lesson, you should have completed the previous lesson: Lesson 12: Analyze in Excel.
IMPORTANT
You must have Administrator permissions on the remote Analysis Services instance in-order to deploy to it.
Conclusion
Congratulations! You're finished authoring and deploying your first Analysis Services Tabular model. This tutorial
has helped guide you through completing the most common tasks in creating a tabular model. Now that your
Adventure Works Internet Sales model is deployed, you can use SQL Server Management Studio to manage the
model; create process scripts and a backup plan. Users can also now connect to the model using a reporting client
application such as Microsoft Excel or Power BI.
See also
DirectQuery Mode
Configure default data modeling and deployment properties
Tabular Model Databases
What's next?
Supplemental Lesson - Implement Dynamic Security by Using Row Filters.
Supplemental Lesson - Configure Reporting Properties for Power View Reports.
Supplemental Lesson - Implement Dynamic Security
by Using Row Filters
11/27/2018 • 10 minutes to read • Edit Online
APPLIES TO: SQL Server Analysis Services (starting with 2016) Azure Analysis Services
In this supplemental lesson, you will create an additional role that implements dynamic security. Dynamic security
provides row -level security based on the user name or login id of the user currently logged on. To learn more, see
Roles.
To implement dynamic security, you must add a table to your model containing the Windows user names of those
users that can create a connection to the model as a data source and browse model objects and data. The model
you create using this tutorial is in the context of Adventure Works Corp.; however, in order to complete this lesson,
you must add a table containing users from your own domain. You will not need the passwords for the user names
that will be added. To create an EmployeeSecurity table, with a small sample of users from your own domain, you
will use the Paste feature, pasting employee data from an Excel spreadsheet. In a real-world scenario, the table
containing user names you add to a model would typically use a table from an actual database as a data source; for
example, a real DimEmployee table.
In order to implement dynamic security, you will use two new DAX functions: USERNAME Function (DAX) and
LOOKUPVALUE Function (DAX). These functions, applied in a row filter formula, are defined in a new role. Using
the LOOKUPVALUE function, the formula specifies a value from the EmployeeSecurity table and then passes that
value to the USERNAME function, which specifies the user name of the user logged on belongs to this role. The
user can then browse only data specified by the role's row filters. In this scenario, you will specify that sales
employees can only browse Internet sales data for the sales territories in which they are a member.
In order to complete this supplemental lesson, you will complete a series of tasks. Those tasks that are unique to
this Adventure Works tabular model scenario, but would not necessarily apply to a real-world scenario are
identified as such. Each task includes additional information describing the purpose of the task.
Estimated time to complete this lesson: 30 minutes
Prerequisites
This supplemental lesson topic is part of a tabular modeling tutorial, which should be completed in order. Before
performing the tasks in this supplemental lesson, you should have completed all previous lessons.
|EmployeeId|SalesTerritoryId|FirstName|LastName|LoginId|
|---------------|----------------------|--------------|-------------|------------|
|1|2|<user first name>|<user last name>|\<domain\username>|
|1|3|<user first name>|<user last name>|\<domain\username>|
|2|4|<user first name>|<user last name>|\<domain\username>|
|3|5|<user first name>|<user last name>|\<domain\username>|
3. Replace the first name, last name, and domain\username with the names and login ids of three users in
your organization. Put the same user on the first two rows, for EmployeeId 1. This will show this user
belongs to more than one sales territory. Leave the EmployeeId and SalesTerritoryId fields as they are.
4. Save the worksheet as SampleEmployee.
5. In the worksheet, select all of the cells with employee data, including the headers, then right-click the
selected data, and then click Copy.
6. In SSDT, click the Edit menu, and then click Paste.
If Paste is grayed out, click any column in any table in the model designer window, and try again.
7. In the Paste Preview dialog box, in Table Name, type EmployeeSecurity.
8. In Data to be pasted, verify the data includes all of the user data and headers from the SampleEmployee
worksheet.
9. Verify Use first row as column headers is checked, and then click Ok.
A new table named EmployeeSecurity with employee data copied from the SampleEmployee worksheet is
created.
Create relationships between FactInternetSales, DimGeography, and
DimSalesTerritory table
The FactInternetSales, DimGeography, and DimSalesTerritory table all contain a common column,
SalesTerritoryId. The SalesTerritoryId column in the DimSalesTerritory table contains values with a different Id for
each sales territory.
To create relationships between the FactInternetSales, DimGeography, and the DimSalesTerritory table
1. In the model designer, in Diagram View, in the DimGeography table, click and hold on the
SalesTerritoryId column, then drag the cursor to the SalesTerritoryId column in the DimSalesTerritory
table, and then release.
2. In the FactInternetSales table, click and hold on the SalesTerritoryId column, then drag the cursor to the
SalesTerritoryId column in the DimSalesTerritory table, and then release.
Notice the Active property for this relationship is False, meaning it's inactive. This is because the
FactInternetSales table already has another active relationship that is used in measures.
NOTE
The Sales Employees by Territory role you create in this lesson restricts members to browse (or query) only sales data for the
sales territory to which they belong. If you add a user as a member to the Sales Employees by Territory role that also exists
as a member in a role created in Lesson 11: Create Roles, you will get a combination of permissions. When a user is a
member of multiple roles, the permissions, and row filters defined for each role are cumulative. That is, the user will have the
greater permissions determined by the combination of roles.
=FALSE()
This formula specifies that all columns resolve to the false Boolean condition; therefore, no columns for the
EmployeeSecurity table can be queried by a member of the Sales Employees by Territory user role.
9. For the DimSalesTerritory table, type the following formula.
In this formula, the LOOKUPVALUE function returns all values for the
DimEmployeeSecurity[SalesTerritoryId] column, where the EmployeeSecurity[LoginId] is the same as the
current logged on Windows user name, and EmployeeSecurity[SalesTerritoryId] is the same as the
DimSalesTerritory[SalesTerritoryId].
The set of sales territory IDs returned by LOOKUPVALUE is then used to restrict the rows shown in the
DimSalesTerritory table. Only rows where the SalesTerritoryID for the row is in the set of IDs returned by
the LOOKUPVALUE function are displayed.
10. In Role Manager, click Ok.
See Also
USERNAME Function (DAX)
LOOKUPVALUE Function (DAX)
CUSTOMDATA Function (DAX)
Supplemental Lesson - Configure Reporting
Properties for Power View Reports
11/28/2018 • 9 minutes to read • Edit Online
APPLIES TO: SQL Server Analysis Services (starting with 2016) Azure Analysis Services
In this supplemental lesson, you will set reporting properties for the AW Internet Sales project. Reporting
properties make it easier for end-users to select and display model data in Power View. You will also set properties
to hide certain columns and tables, and create new data for use in charts.
Estimated time to complete this lesson: 30 minutes
Prerequisites
This supplemental lesson is part of a tabular modeling tutorial, which should be completed in order. Before
performing the tasks in this supplemental lesson, you should have completed all previous lessons.
In order to complete this particular supplemental lesson, you must also have the following:
The AW Internet Sales project (completed through this tutorial) ready to be deployed or already deployed to an
Analysis Services server.
Year Quarter =[Calendar Year] & " Q" & [Calendar Quarter]
Table behavior
By using Table Behavior properties, you can change the default behavior for different visualization types and
grouping behavior for tables used in Power View reports. This allows better default placement of identifying
information such as names, images, or titles in tile, card, and chart layouts.
For detailed information about Table Behavior properties, see Configure Table Behavior Properties for Power View
Reports in SQL Server Books Online.
To set table behavior
1. In the model designer, click the Customer table (tab).
2. In the Properties window, in the Table Behavior property, click Click to edit, to open the Table Behavior
dialog box.
3. In the Table Behavior dialog box, in the Row Identifier dropdown list box, select the Customer Id
column.
4. In the Keep Unique Rows list box, select First Name and Last Name.
This property setting specifies these columns provide values that should be treated as unique even if they
are duplicates, for example, when two or more employees share the same name.
5. In the Default Label dropdown list box, select the Last Name column.
This property setting specifies this column provides a display name to represent row data.
6. Repeat these steps for the Geography table, selecting the Geography Id column as the Row Identifier, and
the City column in the Keep Unique Rows list box. You do not need to set a Default Label for this table.
7. Repeat these steps, for the Product table, selecting the Product Id column as the Row Identifier, and the
Product Name column in the Keep Unique Rows list box. For Default Label, select Product Alternate
Id.
Date
NOTE
Because the Date table was selected as the models date table by using the Mark as Date Table setting, in Lesson 7:
Mark as Date Table, and the Date column in the Date table as the column to be used as the unique identifier, the Row
Identifier property for the Date column will automatically be set to True, and cannot be changed. When using time-
intelligence functions in DAX formulas, you must specify a date table. In this model, you created a number of
measures using time-intelligence functions to calculate sales data for various periods such as previous and current
quarters, and also for use in KPIs. For more information about specifying a date table, see Specify Mark as Date Table
for use with Time Intelligence in SQL Server Books Online.
Geography
Product
Internet Sales
Decimal Places 0
COLUMN PROPERTY VALUE
Next steps
You can now use Power View to visualize data from the model. Ensure the Analysis Services and Reporting
Services accounts on the SharePoint site have read permissions to the Analysis Services instance where you
deployed your model.
To create a Reporting Services report data source that points to your model, see Table Model Connection Type
(SSRS ).
Multidimensional Modeling (Adventure Works
Tutorial)
5/16/2018 • 2 minutes to read • Edit Online
Prerequisites
You will need sample data, sample project files, and software to complete all of the lessons in this tutorial. For
instructions on how to find and install the prerequisites for this tutorial, see Install Sample Data and Projects for
the Analysis Services Multidimensional Modeling Tutorial.
Additionally, the following permissions must be in place to successfully complete this tutorial:
You must be a member of the Administrators local group on the Analysis Services computer or be a
member of the server administration role in the instance of Analysis Services.
You must have Read permissions in the AdventureWorksDW sample database. This sample database is
valid for the SQL Server 2017 release.
Lessons
This tutorial includes the following lessons.
NOTE
The cube database that you will create in this tutorial is a simplified version of the Analysis Services multidimensional model
project that is part of the Adventure Works sample databases available for download on GitHub. The tutorial version of the
Adventure Works multidimensional database is simplified to bring greater focus to the specific skills that you will want to
master right away. After you complete the tutorial, consider exploring the multidimensional model project on your own to
further your understanding of Analysis Services multidimensional modeling.
Next Step
To begin the tutorial, continue to the first lesson: Lesson 1: Defining a Data Source View within an Analysis
Services Project.
Analysis Services Tutorial Scenario
5/16/2018 • 4 minutes to read • Edit Online
The Solution
The data warehouse team recently performed a design review of the current analysis system. The review included
a gap analysis of current issues and future demands. The data warehouse team determined that the
AdventureWorksDW2012 database is a well-designed dimensional database with conformed dimensions and
surrogate keys. Conformed dimensions enable a dimension to be used in multiple data marts, such as a time
dimension or a product dimension. Surrogate keys are artificial keys that link dimension and fact tables and that
are used to ensure uniqueness and to improve performance. Moreover, the data warehouse team determined that
there currently are no significant problems with the loading and management of the base tables in the
AdventureWorksDW2012 database. The team has therefore decided to use Microsoft Analysis Services to
accomplish the following:
Provide unified data access through a common metadata layer for analytical analysis and reporting.
Simplify users' view of data, speeding the development of both interactive and predefined queries and
predefined reports.
Correctly construct queries that combine data from multiple subject areas.
Manage aggregates.
Store and reuse complex calculations.
Present a localized experience to business users outside the United States.
The lessons in the Analysis Services tutorial provide guidance in building a cube database that meets all of these
goals. To get started, continue to the first lesson: Lesson 1: Create a New Tabular Model Project.
See Also
Multidimensional Modeling (Adventure Works Tutorial)
Install sample data and multidimensional projects
12/7/2018 • 5 minutes to read • Edit Online
NOTE
For learning purposes, it is recommended that you use the default service account impersonation option and grant data
reader permissions to the service account in SQL Server. Although other impersonation options are available, not all of them
are suitable for processing operations. Specifically, the option for using the credentials of the current user is not supported
for processing.
1. Determine the service account. You can use SQL Server Configuration Manager or the Services console
application to view account information. If you installed Analysis Services as the default instance, using the
default account, the service is running as NT Service\MSSQLServerOLAPService.
2. In Management Studio, connect to the database engine instance.
3. Expand the Security folder, right-click Logins and select New Login.
4. On the General page, in Login name, type NT Service\MSSQLServerOLAPService (or whatever
account the service is running as).
5. Click User Mapping.
6. Select the checkbox next to the AdventureWorksDW database. Role membership should automatically
include db_datareader and public. Click OK to accept the defaults.
Next step
You are now ready to use the tutorial. For more information about how to get started, see Multidimensional
Modeling (Adventure Works Tutorial).
See also
Configure the Windows Firewall to Allow Analysis Services Access
Configure the Windows Firewall to Allow SQL Server Access
Lesson 1: Defining a Data Source View within an
Analysis Services Project
5/16/2018 • 2 minutes to read • Edit Online
Next Lesson
Lesson 2: Defining and Deploying a Cube
See Also
Data Source Views in Multidimensional Models
Multidimensional Modeling (Adventure Works Tutorial)
Lesson 1-1 - Creating an Analysis Services Project
5/16/2018 • 2 minutes to read • Edit Online
See Also
Creating Multidimensional Models Using SQL Server Data Tools (SSDT)
Create an Analysis Services Project (SSDT)
Lesson 1-2 - Defining a Data Source
5/16/2018 • 2 minutes to read • Edit Online
See Also
Create a Data Source (SSAS Multidimensional)
Lesson 1-3 - Defining a Data Source View
5/16/2018 • 3 minutes to read • Edit Online
NOTE
To create a data source view that is based on multiple data sources, first define a data source view that is based on a
single data source. This data source is then called the primary data source. You can then add tables and views from a
secondary data source. When designing dimensions that contain attributes based on related tables in multiple data
sources, you might need to define a MicrosoftSQL Server data source as the primary data source to use its
distributed query engine capabilities.
4. On the Select Tables and Views page, select tables and views from the list of objects that are available
from the selected data source. You can filter this list to help you select tables and views.
NOTE
Click the maximize button in the upper-right corner so that the window covers the full screen. This makes it easier to
see the complete list of available objects.
In the Available objects list, select the following objects. You can select multiple tables by clicking each
while holding down the CTRL key:
DimCustomer (dbo)
DimDate (dbo)
DimGeography (dbo)
DimProduct (dbo)
FactInternetSales (dbo)
5. Click > to add the selected tables to the Included objects list.
6. Click Next.
7. In the Name field, make sure Adventure Works DW 2012 displays, and then click Finish.
The Adventure Works DW 2012 data source view appears in the Data Source Views folder in Solution
Explorer. The content of the data source view is also displayed in Data Source View Designer in SQL Server
Data Tools (SSDT). This designer contains the following elements:
A Diagram pane in which the tables and their relationships are represented graphically.
A Tables pane in which the tables and their schema elements are displayed in a tree view.
A Diagram Organizer pane in which you can create subdiagrams so that you can view subsets of
the data source view.
A toolbar that is specific to Data Source View Designer.
8. To maximize the Microsoft Visual Studio development environment, click the Maximize button.
9. To view the tables in the Diagram pane at 50 percent, click the Zoom icon on the Data Source View
Designer toolbar. This will hide the column details of each table.
10. To hide Solution Explorer, click the Auto Hide button, which is the pushpin icon on the title bar. To view
Solution Explorer again, position your pointer over the Solution Explorer tab along the right side of the
development environment. To unhide Solution Explorer, click the Auto Hide button again.
11. If the windows are not hidden by default, click Auto Hide on the title bar of the Properties and Solution
Explorer windows.
You can now view all the tables and their relationships in the Diagram pane. Notice that there are three
relationships between the FactInternetSales table and the DimDate table. Each sale has three dates
associated with the sale: an order date, a due date, and a ship date. To view the details of any relationship,
double-click the relationship arrow in the Diagram pane.
See Also
Data Source Views in Multidimensional Models
Lesson 1-4 - Modifying Default Table Names
5/16/2018 • 2 minutes to read • Edit Online
NOTE
You can also change the friendly names of columns, define calculated columns, and join tables or views in the data source
view to make them easier to use.
Next Lesson
Lesson 2: Defining and Deploying a Cube
See Also
Data Source Views in Multidimensional Models
Change Properties in a Data Source View (Analysis Services)
Lesson 2: Defining and Deploying a Cube
5/16/2018 • 2 minutes to read • Edit Online
NOTE
Completed projects for all of the lessons in this tutorial are available online. You can jump ahead to any lesson by using the
completed project from the previous lesson as a starting point. Click here to download the sample projects that go with this
tutorial.
Next Lesson
Lesson 3: Modifying Measures, Attributes and Hierarchies
See Also
Analysis Services Tutorial Scenario
Multidimensional Modeling (Adventure Works Tutorial)
Dimensions in Multidimensional Models
Cubes in Multidimensional Models
Configure Analysis Services Project Properties (SSDT)
Build Analysis Services Projects (SSDT)
Deploy Analysis Services Projects (SSDT)
Lesson 2-1 - Defining a Dimension
5/16/2018 • 2 minutes to read • Edit Online
NOTE
This lesson requires that you have completed all the procedures in Lesson 1.
To define a dimension
1. In Solution Explorer (on the right side of Microsoft Visual Studio), right-click Dimensions, and then click
New Dimension. The Dimension Wizard appears.
2. On the Welcome to the Dimension Wizard page, click Next.
3. On the Select Creation Method page, verify that the Use an existing table option is selected, and then
click Next.
4. On the Specify Source Information page, verify that the Adventure Works DW 2012 data source view
is selected.
5. In the Main table list, select Date.
6. Click Next.
7. On the Select Dimension Attributes page, select the check boxes next to the following attributes:
Date Key
Full Date Alternate Key
English Month Name
Calendar Quarter
Calendar Year
Calendar Semester
8. Change the setting of the Full Date Alternate Key attribute's Attribute Type column from Regular to
Date. To do this, click Regular in the Attribute Type column. Then click the arrow to expand the options.
Next, click Date > Calendar > Date. Click OK. Repeat these steps to change the attribute type of the
attributes as follows:
English Month Name to Month
Calendar Quarter to Quarter
Calendar Year to Year
Calendar Semester to Half Year
9. Click Next.
10. On the Completing the Wizard page, in the Preview pane, you can see the Date dimension and its
attributes.
11. Click Finish to complete the wizard.
In Solution Explorer, in the Analysis Services Tutorial project, the Date dimension appears in the
Dimensions folder. In the center of the development environment, Dimension Designer displays the Date
dimension.
12. On the File menu, click Save All.
See Also
Dimensions in Multidimensional Models
Create a Dimension by Using an Existing Table
Create a Dimension Using the Dimension Wizard
Lesson 2-2 - Defining a Cube
5/16/2018 • 2 minutes to read • Edit Online
See Also
Cubes in Multidimensional Models
Dimensions in Multidimensional Models
Lesson 2-3 - Adding Attributes to Dimensions
5/16/2018 • 2 minutes to read • Edit Online
See Also
Browse Dimension Data in Dimension Designer
Lesson 2-5 - Deploying an Analysis Services Project
11/28/2018 • 3 minutes to read • Edit Online
NOTE
If you want to deploy the project to a named instance of Analysis Services on the local computer, or to an instance
on a remote server, change the Server property to the appropriate instance name, such as <ServerName*>\
<InstanceName>*.
3. Click OK.
4. In Solution Explorer, right-click the Analysis Services Tutorial project, and then click Deploy. You might
need to wait.
NOTE
If you get errors during deployment, use SQL Server Management Studio to check the database permissions. The
account you specified for the data source connection must have a login on the SQL Server instance. Double-click the
login to view User Mapping properties. The account must have db_datareader permissions on the
AdventureWorksDW2012 database.
SQL Server Data Tools (SSDT) builds and then deploys the Analysis Services Tutorial project to the
specified instance of Analysis Services by using a deployment script. The progress of the deployment is
displayed in two windows: the Output window and the Deployment Progress - Analysis Services
Tutorial window.
Open the Output window, if necessary, by clicking Output on the View menu. The Output window
displays the overall progress of the deployment. The Deployment Progress - Analysis Services Tutorial
window displays the detail about each step taken during deployment. For more information, see Build
Analysis Services Projects (SSDT) and Deploy Analysis Services Projects (SSDT).
5. Review the contents of the Output window and the Deployment Progress - Analysis Services Tutorial
window to verify that the cube was built, deployed, and processed without errors.
6. To hide the Deployment Progress - Analysis Services Tutorial window, click the Auto Hide icon (it
looks like a pushpin) on the toolbar of the window.
7. To hide the Output window, click the Auto Hide icon on the toolbar of the window.
You have successfully deployed the Analysis Services Tutorial cube to your local instance of Analysis Services, and
then processed the deployed cube.
See Also
Deploy Analysis Services Projects (SSDT)
Configure Analysis Services Project Properties (SSDT)
Lesson 2-6 - Browsing the Cube
5/16/2018 • 2 minutes to read • Edit Online
Next Lesson
Lesson 3: Modifying Measures, Attributes and Hierarchies
See Also
MDX Query Editor (Analysis Services - Multidimensional Data)
Lesson 3: Modifying Measures, Attributes and
Hierarchies
5/16/2018 • 2 minutes to read • Edit Online
NOTE
Completed projects for all of the lessons in this tutorial are available online. You can jump ahead to any lesson by using the
completed project from the previous lesson as a starting point. Click here to download the sample projects that go with this
tutorial.
See Also
Analysis Services Tutorial Scenario
Multidimensional Modeling (Adventure Works Tutorial)
Lesson 3-1 - Modifying Measures
5/16/2018 • 2 minutes to read • Edit Online
See Also
Define Database Dimensions
Configure Measure Properties
Lesson 3-2 - Modifying the Customer Dimension
11/28/2018 • 8 minutes to read • Edit Online
Renaming Attributes
You can change attribute names with the Dimension Structure tab of Dimension Designer.
To rename an attribute
1. Switch to Dimension Designer for the Customer dimension in SQL Server Data Tools (SSDT). To do this,
double-click the Customer dimension in the Dimensions node of Solution Explorer.
2. In the Attributes pane, right-click English Country Region Name, and then click Rename. Change the
name of the attribute to Country-Region.
3. Change the names of the following attributes in the same manner:
English Education attribute - change to Education
English Occupation attribute - change to Occupation
State Province Name attribute - change to State-Province
4. On the File menu, click Save All.
Creating a Hierarchy
You can create a new hierarchy by dragging an attribute from the Attributes pane to the Hierarchies pane.
To create a hierarchy
1. Drag the Country-Region attribute from the Attributes pane into the Hierarchies pane.
2. Drag the State-Province attribute from the Attributes pane into the cell in the Hierarchies pane,
underneath the Country-Region level.
3. Drag the City attribute from the Attributes pane into the cell in the Hierarchies pane, underneath the
State-Province level.
4. In the Hierarchies pane of the Dimension Structure tab, right-click the title bar of the Hierarchy
hierarchy, select Rename, and then type Customer Geography.
The name of the hierarchy is now Customer Geography.
5. On the File menu, click Save All.
CASE
WHEN MiddleName IS NULL THEN
FirstName + ' ' + LastName
ELSE
FirstName + ' ' + MiddleName + ' ' + LastName
END
The CASE statement concatenates the FirstName, MiddleName, and LastName columns into a single
column that you will use in the Customer dimension as the displayed name for the Customer attribute.
4. Click OK, and then expand Customer in the Tables pane.
The FullName named calculation appears in the list of columns in the Customer table, with an icon that
indicates that it is a named calculation.
5. On the File menu, click Save All.
6. In the Tables pane, right-click Customer, and then click Explore Data.
7. Review the last column in the Explore Customer Table view.
Notice that the FullName column appears in the data source view, correctly concatenating data from
several columns from the underlying data source and without modifying the original data source.
8. Close the Explore Customer Table tab.
See Also
Dimension Attribute Properties Reference
Remove an Attribute from a Dimension
Rename an Attribute
Define Named Calculations in a Data Source View (Analysis Services)
Lesson 3-3 - Modifying the Product Dimension
11/28/2018 • 5 minutes to read • Edit Online
CASE ProductLine
WHEN 'M' THEN 'Mountain'
WHEN 'R' THEN 'Road'
WHEN 'S' THEN 'Accessory'
WHEN 'T' THEN 'Touring'
ELSE 'Components'
END
This CASE statement creates user-friendly names for each product line in the cube.
5. Click OK to create the ProductLineName named calculation. You might need to wait.
6. On the File menu, click Save All.
Creating a Hierarchy
To create a hierarchy
1. Drag the Product Line attribute from the Attributes pane into the Hierarchies pane.
2. Drag the Model Name attribute from the Attributes pane into the cell in the Hierarchies pane,
underneath the Product Line level.
3. Drag the Product Name attribute from the Attributes pane into the cell in the Hierarchies pane,
underneath the Model Name level. (You renamed Product Key to Product Name in the previous section.)
4. In the Hierarchies pane of the Dimension Structure tab, right-click the title bar of the Hierarchy
hierarchy, click Rename, and then type Product Model Lines.
The name of the hierarchy is now Product Model Lines.
5. On the File menu, click Save All.
See Also
Define Named Calculations in a Data Source View (Analysis Services)
Create User-Defined Hierarchies
Configure the (All) Level for Attribute Hierarchies
Lesson 3-4 - Modifying the Date Dimension
11/28/2018 • 11 minutes to read • Edit Online
The DATENAME statement extracts the year, month, and day values from the FullDateAlternateKey
column. You will use this new column as the displayed name for the FullDateAlternateKey attribute.
4. Click OK, and then expand Date in the Tables pane.
The SimpleDate named calculation appears in the list of columns in the Date table, with an icon that
indicates that it is a named calculation.
5. On the File menu, click Save All.
6. In the Tables pane, right-click Date, and then click Explore Data.
7. Scroll to the right to review the last column in the Explore Date Table view.
Notice that the SimpleDate column appears in the data source view, correctly concatenating data from
several columns from the underlying data source, without modifying the original data source.
8. Close the Explore Date Table view.
Creating a Hierarchy
You can create a new hierarchy by dragging an attribute from the Attributes pane to the Hierarchies pane.
To create a hierarchy
1. In Dimension Structure tab of the Dimension Designer for the Date dimension, drag the Calendar Year
attribute from the Attributes pane into the Hierarchies pane.
2. Drag the Calendar Semester attribute from the Attributes pane into the cell in the Hierarchies pane,
underneath the Calendar Year level.
3. Drag the Calendar Quarter attribute from the Attributes pane into the cell in the Hierarchies pane,
underneath the Calendar Semester level.
4. Drag the English Month Name attribute from the Attributes pane into the cell in the Hierarchies pane,
underneath the Calendar Quarter level.
5. Drag the Date Key attribute from the Attributes pane into the cell in the Hierarchies pane, underneath
the English Month Name level.
6. In the Hierarchies pane, right-click the title bar of the Hierarchy hierarchy, click Rename, and then type
Calendar Date.
7. By using the right-click context menu, in the Calendar Date hierarchy, rename the English Month Name
level to Calendar Month, and then rename the Date Key level to Date.
8. Delete the Full Date Alternate Key attribute from the Attributes pane because you will not be using it.
Click OK in the Delete Objects confirmation window.
9. On the File menu, click Save All.
The statement concatenates the month and year for each month in the table into a new column.
4. Click OK.
5. In the Tables pane, right-click Date, and then click New Named Calculation.
6. In the Create Named Calculation dialog box, type CalendarQuarterDesc in the Column name box,
and then type or copy and paste the following SQL script in the Expression box:
This SQL script concatenates the calendar quarter and year for each quarter in the table into a new column.
7. Click OK.
8. In the Tables pane, right-click Date, and then click New Named Calculation.
9. In the Create Named Calculation dialog box, type CalendarSemesterDesc in the Column name box,
and then type or copy and paste the following SQL script in the Expression box:
CASE
WHEN CalendarSemester = 1 THEN 'H1' + ' ' + 'CY' + ' '
+ CONVERT(CHAR(4), CalendarYear)
ELSE
'H2' + ' ' + 'CY' + ' ' + CONVERT(CHAR(4), CalendarYear)
END
This SQL script concatenates the calendar semester and year for each semester in the table into a new
column.
10. Click OK.
11. On the File menu, click Save All.
See Also
Dimensions in Multidimensional Models
Lesson 3-5 - Browsing the Deployed Cube
5/16/2018 • 2 minutes to read • Edit Online
NOTE
This lesson is based on an enhanced version of the Analysis Services Tutorial project that you completed in the first three
lessons of this tutorial. The first task in this lesson describes where to locate the appropriate sample project to use for the
lesson, and the difference between this project and the project that you created in the first three lessons.
Next Lesson
Lesson 5: Defining Relationships Between Dimensions and Measure Groups
See Also
Analysis Services Tutorial Scenario
Multidimensional Modeling (Adventure Works Tutorial)
Dimensions in Multidimensional Models
Lesson 4-1 - Using a Modified Version of the Analysis
Services Tutorial Project
11/27/2018 • 4 minutes to read • Edit Online
See Also
Deploying an Analysis Services Project
Lesson 4-2 - Defining Parent Attribute Properties in a
Parent-Child Hierarchy
5/16/2018 • 3 minutes to read • Edit Online
NOTE
When you use the Dimension Wizard to create a dimension, the wizard recognizes the tables that have parent-child
relationships and automatically defines the parent-child hierarchy for you.
In the tasks in this topic, you will create a naming template that defines the name for each level in the parent-child
hierarchy in the Employee dimension. You will then configure the parent attribute to hide all parent data, so that
only the sales for leaf-level members are displayed.
10.
Notice that the sales made by each manager in Level 03 are also displayed in Level 04. This is because each
manager is also an employee of another manager. In the next task, you will hide these sale amounts.
5. Click OK.
6. In the Properties window for the Employees attribute, in the MembersWithData property cell, select
NonLeafDataHidden to change this value for the Employees attribute.
This will cause data that is related to non-leaf level members in the parent-child hierarchy to be hidden.
See Also
Parent-Child Dimensions
Attributes in Parent-Child Hierarchies
Lesson 4-3 - Automatically Grouping Attribute
Members
5/16/2018 • 5 minutes to read • Edit Online
10. Remove the Sick Leave Hours attribute hierarchy from the column area of the Data pane.
11. Add Vacation Hours to the column area of the Data pane.
Notice that two groups appear, based on the equal areas grouping method. Three other groups are hidden
because they contain no data values.
Modifying Grouping Properties and Reviewing the Effect of the
Changes
1. Switch to Dimension Designer for the Employee dimension, and then select Vacation Hours in the
Attributes pane.
2. In the Properties window, change the value of the DiscretizationBucketCount property to 10.
3. On the Build menu of SQL Server Data Tools, click Deploy Analysis Services Tutorial.
4. When deployment has successfully completed, switch back to Cube Designer for the Analysis Services
Tutorial cube.
5. Click Reconnect on the Browser tab, click the Excel icon, and then reconstruct the PivotTable so that you
can view the effect of the change to the grouping method:
a. Drag Reseller Sales-Sales Amount to Values
b. Drag Vacation Hours (in the Employees Organization folder) to Columns
c. Drag Product Model Lines to Rows
Notice that there are now three groups of members of the Vacation Hours attribute that have sales values
for products. (The other seven groups contain members with no sales data.)
See Also
Group Attribute Members (Discretization)
Lesson 4-4 - Hiding and Disabling Attribute
Hierarchies
5/16/2018 • 5 minutes to read • Edit Online
NOTE
An attribute that has its IsAggregatable property set to false can only be used as the root of a user-defined
hierarchy and must have a default member specified (otherwise, one will be chosen for you by the Analysis Services
engine).
AttributeHierarchyOrdered
By default, Analysis Services orders the members of enabled attribute hierarchies during processing, and
then stores the members by the value of the OrderBy property, such as by Name or Key. If you do not care
about ordering, you can increase processing performance by setting the value of this property to False.
AttributeHierarchyOptimizedState
By default, Analysis Services creates an index for each enabled attribute hierarchy during processing, to
improve query performance. If you do not plan to use an attribute hierarchy for browsing, you can increase
processing performance by setting the value of this property to NotOptimized. However, if you use a
hidden hierarchy as the key attribute for the dimension, creating an index of the attribute members will still
improve performance.
These properties do not apply if an attribute hierarchy is disabled.
In the tasks in this topic, you will disable social security numbers and other attributes in the Employee dimension
that will not be used for browsing. You will then hide the customer name and postal code attribute hierarchies in
the Customer dimension. The large number of attribute members in these hierarchies will make browsing these
hierarchies very slow independent of a user hierarchy.
5. Drag the Postal Code attribute from the Attributes pane into the Customer Geography user hierarchy in
the Hierarchies and Levels pane, immediately under the City level.
Notice that a hidden attribute can still become a level in a user hierarchy.
6. On the Build menu, click Deploy Analysis Services Tutorial.
7. When deployment has successfully completed, switch to the Browser tab for the Customer dimension, and
then click Reconnect.
8. Try to select either of the modified attribute hierarchies from the Hierarchy list.
Notice that neither of the modified attribute hierarchies appears in the Hierarchy list.
9. In the Hierarchy list, select Customer Geography, and then browse each level in the browser pane.
Notice that the hidden levels, Postal Code and Full Name, are visible in the user-defined hierarchy.
NOTE
Sorting properties in the Properties window alphabetically will simplify this task as these three properties will be
sorted adjacent to each other.
2. Switch to the Dimension Structure tab in Dimension Designer for the Customer dimension, right-click
CommuteDistanceSort in the Customer table in the Data Source View pane, and then click New
Attribute from Column.
3. In the Attributes pane, select Commute Distance Sort, and then set the AttributeHierarchyEnabled
property for this attribute to False in the Properties window, set the AttributeHierarchyOptimizedState
property to NotOptimized, and set the AttributeHierarchyOrdered property to False.
These settings will hide the attribute from users and will improve processing time. This attribute will not be
used for browsing. It will only be used for ordering the members of another attribute.
4. Select Geography, and then set its AttributeHierarchyVisible property to False in the Properties
window, set its AttributeHierarchyOptimizedState property to NotOptimized, and set its
AttributeHierarchyOrdered property to False.
These settings will hide the attribute from users and will improve processing time. This attribute will not be
used for browsing. It will be only be used for ordering the members of another attribute. Because
Geography has member properties, its AttributeHierarchyEnabled property must be set to True.
Therefore, to hide the attribute, you set the AttributeHierarchyVisible property to False.
5. Click the Attribute Relationships tab.
6. In the attributes list, right-click the Commute Distance attribute and then select New Attribute
Relationship.
7. In the Create Attribute Relationship dialog box, the Source Attribute is Commute Distance. Set the
Related Attribute to Commute Distance Sort.
8. In the Relationship type list, set the relationship type to Rigid.
The relationship between the members of the Commute Distance attribute and the Commute Distance
Sort attribute will not change over time.
9. Click OK.
You are now ready to set the sort order for the Commute Distance attribute.
10. Click the Dimension Structure tab.
11. In the Attributes pane, select Commute Distance, and then change the value of the OrderBy property in
the Properties window to AttributeKey, and change the value of the OrderByAttribute property to
Commute Distance Sort.
12. On the Build menu, click Deploy Analysis Services Tutorial.
13. When deployment has successfully completed, switch to the Browser tab of Dimension Designer for the
Customer dimension, click Reconnect, and then browse the Commute Distance attribute hierarchy.
Notice that the attribute hierarchy members are now sorted in a logical order based on increasing distance,
as shown in the following image.
See Also
Define Attribute Relationships
User Hierarchy Properties
Lesson 4-7 - Defining the Unknown Member and
Null Processing Properties
11/28/2018 • 7 minutes to read • Edit Online
NOTE
If you have added the Subcategory and Category attributes when you originally defined the Analysis Services Tutorial cube
using the Cube Wizard, these steps would have been performed for you automatically.
5. Click the Browser tab, verify that Product Model Lines is selected in the Hierarchy list, and then expand
All Products.
Notice the five members of the Product Line level.
6. Expand Components, and then expand the unlabeled member of the Model Name level.
This level contains the assembly components that are used when building other components, starting with
the Adjustable Race product, as shown in the following image.
NOTE
Completed projects for all of the lessons in this tutorial are available online. You can jump ahead to any lesson by using the
completed project from the previous lesson as a starting point. Click here to download the sample projects that go with this
tutorial.
Next Lesson
Lesson 6: Defining Calculations
See Also
Analysis Services Tutorial Scenario
Multidimensional Modeling (Adventure Works Tutorial)
Dimension Relationships
Lesson 5-1 - Defining a Referenced Relationship
11/28/2018 • 6 minutes to read • Edit Online
4. Open Data Source View Designer for the Adventure Works DW 2012 data source view.
5. In the Diagram Organizer pane, view the relationship between the Geography table and the
ResellerSales table.
Notice that there is no direct link between these tables. However, there is an indirect link between these
tables through either the Reseller table or the SalesTerritory table.
6. Double-click the arrow that represents the relationship between the Geography table and the Reseller
table.
In the Edit Relationship dialog box, notice that the GeographyKey column is the primary key in the
Geography table and the foreign key in the Reseller table.
7. Click Cancel, switch to Cube Designer for the Analysis Services Tutorial cube, and then click the
Dimension Usage tab.
Notice that the Geography cube dimension does not currently have a relationship with either the Internet
Sales measure group or the Reseller Sales measure group.
8. Click the ellipsis button (...) in the Full Name cell at the intersection of the Customer dimension and the
Internet Sales measure group.
In the Define Relationship dialog box, notice that a Regular relationship is defined between the
DimCustomer dimension table and the FactInternetSales measure group table based on the
CustomerKey column in each of these tables. All the relationships that you have defined within this tutorial
up to this point have been regular relationships.
The following image shows the Define Relationship dialog box with a regular relationship between the
DimCustomer dimension table and the FactInternetSales measure group table.
9. Click Cancel.
10. Click the ellipsis button (...) in the unnamed cell at the intersection of the Geography dimension and the
Reseller Sales measure group.
In the Define Relationship dialog box, notice that no relationship is currently defined between the
Geography cube dimension and the Reseller Sales measure group. You cannot define a regular relationship
because there is no direct relationship between the dimension table for the Geography dimension and the
fact table for the Reseller Sales measure group.
11. In the Select relationship type list, select Referenced.
You define a referenced relationship by specifying a dimension that is directly connected to the measure
group table, called an intermediate dimension, that Analysis Services can use to link the reference
dimension to the fact table. You then specify the attribute that links the reference dimension to the
intermediate dimension.
12. In the Intermediate dimension list, select Reseller.
The underlying table for the Geography dimension is linked to the fact table through the underlying table
for the Reseller dimension.
13. In the Reference dimension attribute list, select Geography Key, and then try to select Geography Key
in the Intermediate dimension attribute list.
Notice that Geography Key does not appear in the Intermediate dimension attribute list. This is
because the GeographyKey column is not defined as an attribute in the Reseller dimension.
14. Click Cancel.
In the next task, you will solve this problem by defining an attribute that is based on the GeographyKey column in
the Reseller dimension.
See Also
Attribute Relationships
Define a Referenced Relationship and Referenced Relationship Properties
Lesson 5-2 - Defining a Fact Relationship
11/28/2018 • 6 minutes to read • Edit Online
NOTE
Fact dimensions must be incrementally updated after every update to the measure group that the fact relationship
references.
For more information, see Dimension Relationships, and Define a Fact Relationship and Fact Relationship
Properties.
In the tasks in this topic, you add a new cube dimension based on the CustomerPONumber column in the
FactInternetSales fact table. You then define the relationship between this new cube dimension and the Internet
Sales measure group as a fact relationship.
3. Click Cancel.
See Also
Dimension Relationships
Define a Fact Relationship and Fact Relationship Properties
Lesson 5-3 - Defining a Many-to-Many Relationship
11/28/2018 • 8 minutes to read • Edit Online
NOTE
In order to support a many-to-many dimension relationship, a primary key-foreign key relationship must be defined in the
data source view between all the tables that are involved. Otherwise, you will not be able to select the correct intermediate
measure group when you establish the relationship in the Dimension Usage tab of Cube Designer.
For more information, see Dimension Relationships, and Define a Many-to-Many Relationship and Many-to-Many
Relationship Properties.
In the tasks in this topic, you define the Sales Reasons dimension and the Sales Reasons measure group, and you
define a many-to-many relationship between the Sales Reasons dimension and the Internet Sales measure group
through the Sales Reasons measure group.
See Also
Work with Diagrams in Data Source View Designer (Analysis Services)
Dimension Relationships
Define a Many-to-Many Relationship and Many-to-Many Relationship Properties
Lesson 5-4 - Defining Dimension Granularity within a
Measure Group
11/28/2018 • 11 minutes to read • Edit Online
In the next series of steps in this topic you will define a reference dimension relationship between this
dimension and this fact table.
6. Move the Sales Territories user hierarchy from the Rows Labels area to the Column Labels area.
7. In the PivotTable Field list, select the Sales Territories user-defined hierarchy, and then click the down
arrow to the right.
8. In the filter, click the Select All checkbox to clear all the selections, and then choose just North America.
9. In the PivotTable Field List, expand Date.
10. Drag the Date.Fiscal Date user hierarchy to Row Labels
11. On the PivotTable, click the down arrow next to Row Labels. Clear all of the years except for FY 2008.
Notice that only the July 2007 member of the Month level appears, instead of the July, 2007, August,
2007, and September, 2007 members of Month level, and that only the July 1, 2007 member of the Date
level appears, instead of all 31 days. This behavior occurs because the grain of the data in the fact table is at
the quarter level and the grain of the Date dimension is the daily level. You will change this behavior in the
next task in this topic.
Notice also that the Sales Amount Quota value for the month and day levels is the same value as for the
quarter level, $13,733,000.00. This is because the lowest level of data in the Sales Quotas measure group is
at the quarter level. You will change this behavior in Lesson 6.
The following image shows the values for Sales Amount Quota.
Defining Dimension Usage Properties for the Sales Quotas Measure
Group
1. Open Dimension Designer for the Employee dimension, right-click SalesTerritoryKey in the Data
Source View pane, and then click New Attribute from Column.
2. In the Attributes pane, select SalesTerritoryKey, and then set the AttributeHierarchyVisible property to
False in the Properties window, set the AttributeHierarchyOptimizedState property to NotOptimized,
and set the AttributeHierarchyOrdered property to False.
This attribute is required to link the Sales Territory dimension to the Sales Quotas and Sales Quotas 1
measure groups as a referenced dimension.
3. In Cube Designer for the Analysis Services Tutorial cube, click the Dimension Usage tab, and then review
the dimension usage within the Sales Quotas and Sales Quotas 1 measure groups.
Notice that the Employee and Date cube dimensions are linked to the Sales Quotasand Sales Quotas 1
measure groups through regular relationships. Notice also that the Sales Territory cube dimension is not
linked to either of these measure groups.
4. Click the cell at the intersection of the Sales Territory dimension and the Sales Quotas measure group
and then click the browse button (...). The Define Relationship dialog box opens.
5. In the Select relationship type list, select Referenced.
6. In the Intermediate dimension list, select Employee.
7. In the Reference dimension attribute list, select Sales Territory Region.
8. In the Intermediate dimension attribute list, select Sales Territory Key. (The key column for the Sales
Territory Region attribute is the SalesTerritoryKey column.)
9. Verify that the Materialize check box is selected.
10. Click OK.
11. Click the cell at the intersection of the Sales Territory dimension and the Sales Quotas 1 measure group
and then click the browse button (...). The Define Relationship dialog box opens.
12. In the Select relationship type list, select Referenced.
13. In the Intermediate dimension list, select Employee.
14. In the Reference dimension attribute list, select Sales Territory Region.
15. In the Intermediate dimension attribute list, select Sales Territory Key. (The key column for the Sales
Territory Region attribute is the SalesTerritoryKey column.)
16. Verify that the Materialize check box is selected.
17. Click OK.
18. Delete the Date cube dimension.
Instead of having four time-related cube dimensions, you will use the Order Date cube dimension in the
Sales Quotas measure group as the date against which sales quotas will be dimensioned. You will also use
this cube dimension as the primary date dimension in the cube.
19. In the Dimensions list, rename the Order Date cube dimension to Date.
Renaming the Order Date cube dimension to Date makes it easier for users to understand its role as the
primary date dimension in this cube.
20. Click the browse button (...) in the cell at the intersection of the Sales Quotas measure group and the Date
dimension.
21. In the Define Relationship dialog box, select Regular in the Select relationship type list.
22. In the Granularity attribute list, select Calendar Quarter.
Notice that a warning appears to notify you that because you have selected a non-key attribute as the
granularity attribute, you must make sure that all other attributes are directly or indirectly related to the
granularity attribute by specifying them as member properties.
23. In the Relationship area of the Define Relationship dialog box, link the CalendarYear and
CalendarQuarter dimension columns from the table that underlies the Date cube dimension to the
CalendarYear and CalendarQuarter columns in the table that underlies the Sales Quota measure group,
and then click OK.
NOTE
The Calendar Quarter is defined as the granularity attribute for the Date cube dimension in the Sales Quotas
measure group, but the Date attribute continues to be the granularity attribute for the Internet Sales and Reseller
Sales measure groups.
24. Repeat the previous four steps for the Sales Quotas 1 measure group.
See Also
Dimension Relationships
Define a Regular Relationship and Regular Relationship Properties
Work with Diagrams in Data Source View Designer (Analysis Services)
Lesson 6: Defining Calculations
5/16/2018 • 2 minutes to read • Edit Online
NOTE
If Analysis Services detects a syntax error in any calculation, the Form view will not display until the error is corrected in the
Script view.
You can also use the Business Intelligence Wizard to add certain calculations to a cube. For example, you can use
this wizard to add time intelligence to a cube, which means defining calculated members for time-related
calculations such as period-to-date, moving averages, or period over period growth. For more information, see
Define Time Intelligence Calculations using the Business Intelligence Wizard.
IMPORTANT
On the Calculations tab, the calculation script starts with the CALCULATE command. The CALCULATE command controls
the aggregation of the cells in the cube and you should edit this command only if you intend to manually specify how the
cube cells should be aggregated.
Next Lesson
Lesson 7: Defining Key Performance Indicators (KPIs)
See Also
Analysis Services Tutorial Scenario
Multidimensional Modeling (Adventure Works Tutorial)
Create Named Sets
Create Calculated Members
Lesson 6-1 - Defining Calculated Members
5/16/2018 • 11 minutes to read • Edit Online
3. In the Name box, change the name of the calculated measure to [Total Sales Amount].
If the name of a calculated member contains a space, the calculated member name must be enclosed in
square brackets.
Notice in the Parent hierarchy list that, by default, a new calculated member is created in the Measures
dimension. A calculated member in the Measures dimension is also frequently called a calculated measure.
4. On the Metadata tab in the Calculation Tools pane of the Calculations tab, expand Measures and then
expand Internet Sales to view the metadata for the Internet Sales measure group.
You can drag metadata elements from the Calculation Tools pane into the Expression box and then add
operators and other elements to create Multidimensional Expressions (MDX) expressions. Alternatively, you
can type the MDX expression directly into the Expression box.
NOTE
If you cannot view any metadata in the Calculation Tools pane, click Reconnect on the toolbar. If this does not
work, you may have to process the cube or start the instance of Analysis Services.
5. Drag Internet Sales-Sales Amount from the Metadata tab in the Calculation Tools pane into the
Expression box in the Calculation Expressions pane.
6. In the Expression box, type a plus sign (+) after [Measures].[Internet Sales-Sales Amount].
7. On the Metadata tab in the Calculation Tools pane, expand Reseller Sales, and then drag Reseller
Sales-Sales Amount into the Expression box in the Calculation Expressions pane after the plus sign
(+).
8. In the Format string list, select "Currency".
9. In the Non-empty behavior list, select the check boxes for Internet Sales-Sales Amount and Reseller
Sales-Sales Amount, and then click OK.
The measures you specify in the Non-empty behavior list are used to resolve NON EMPTY queries in
MDX. When you specify one or more measures in the Non-empty behavior list, Analysis Services treats
the calculated member as empty if all the specified measures are empty. If the Non-empty behavior
property is blank, Analysis Services must evaluate the calculated member itself to determine whether the
member is empty.
The following image shows the Calculation Expressions pane populated with the settings that you
specified in the previous steps.
10. On the toolbar of the Calculations tab, click Script View, and then review the calculation script in the
Calculation Expressions pane.
Notice that the new calculation is added to the initial CALCULATE expression; each individual calculation is
separated by a semicolon. Notice also that a comment appears at the beginning of the calculation script.
Adding comments within the calculation script for groups of calculations is a good practice, to help you and
other developers understand complex calculation scripts.
11. Add a new line in the calculation script after the Calculate; command and before the newly added
calculation script, and then add the following text to the script on its own line:
The following image shows the calculation scripts as they should appear in the Calculation Expressions
pane at this point in the tutorial.
12. On the toolbar of the Calculations tab, click Form View, verify that [Total Sales Amount] is selected in
the Script Organizer pane, and then click New Calculated Member.
13. Change the name of this new calculated member to [Total Product Cost], and then create the following
expression in the Expression box:
Notice that this calculated member is referencing other calculated members. Because this calculated
member will be calculated after the calculated members that it references, this is a valid calculated member.
14. In the Format string list, select "Percent".
15. In the Non-empty behavior list, select the check boxes for Internet Sales-Sales Amount and Reseller
Sales-Sales Amount, and then click OK.
16. On the toolbar of the Calculations tab, click Script View and review the three calculations you just added
to the calculation script.
17. Add a new line in the calculation script immediately before the [Internet GPM ] calculation, and then add
the following text to the script on its own line:
The following image shows the Expressions pane with the three new calculations.
Case
When IsEmpty( [Measures].[Internet Sales-Sales Amount] )
Then 0
Else ( [Product].[Product Categories].CurrentMember,
[Measures].[Internet Sales-Sales Amount]) /
( [Product].[Product Categories].[(All)].[All],
[Measures].[Internet Sales-Sales Amount] )
End
This MDX expression calculates the contribution to total Internet sales of each product. The Case statement
together with the IS EMPTY function ensures that a divide by zero error does not occur when a product has
no sales.
5. In the Format string list, select "Percent".
6. In the Non-empty behavior list, select the check box for Internet Sales-Sales Amount, and then click
OK.
7. On the toolbar of the Calculations tab, click New Calculated Member.
8. Change the name of this calculated member to [Reseller Sales Ratio to All Products].
9. Type the following expression in the Expression box:
Case
When IsEmpty( [Measures].[Reseller Sales-Sales Amount] )
Then 0
Else ( [Product].[Product Categories].CurrentMember,
[Measures].[Reseller Sales-Sales Amount]) /
( [Product].[Product Categories].[(All)].[All],
[Measures].[Reseller Sales-Sales Amount] )
End
You have now defined a total of eight calculated members, which are visible in the Script Organizer pane
when you are in Form view.
9. Add the Total Sales Ratio to All Products, Internet Sales Ratio to All Products, and Reseller Sales
Ratio to All Products measures to the Values area.
Notice that the ratio of the sales of mountain bikes to all products has increased over time for Internet sales,
but is decreasing over time for reseller sales. Notice also that the ratio of the sale of mountain bikes to all
products is lower from sales through resellers than it is for sales over the Internet.
10. Change the filter from Mountain Bikes to Bikes, and review the results.
Notice that the gross profit margin for all bikes sold through resellers is negative, because touring bikes and
road bikes are being sold at a loss.
11. Change the filter to Accessories, and then review the results.
Notice that the sale of accessories is increasing over time, but that these sales make up only a small fraction
of total sales. Notice also that the gross profit margin for sales of accessories is higher than for bikes.
See Also
Calculations
Calculations in Multidimensional Models
Create Calculated Members
Lesson 6-2 - Defining Named Sets
11/28/2018 • 6 minutes to read • Edit Online
NOTE
If you cannot view any metadata in the Calculation Tools pane, click Reconnect on the toolbar. If this does not
work, you may have to process the cube or start the instance of Analysis Services.
Now that you have defined the first set for the Exists set expression, you are ready to add the second set-the
set of members of the Reseller dimension that contains the largest number of employees.
7. On the Metadata tab in the Calculation Tools pane, expand Number of Employees in the Reseller
dimension, expand Members, and then expand All Resellers.
Notice that the members of this attribute hierarchy are not grouped.
8. Open Dimension Designer for the Reseller dimension, and then click Number of Employees in the
Attributes pane.
9. In the Properties window, change the DiscretizationMethod property to Automatic, and then change the
DiscretizationBucketCount property to 5. For more information, see Group Attribute Members
(Discretization).
10. On the Build menu of SQL Server Data Tools (SSDT), click Deploy Analysis Services Tutorial.
11. When deployment has successfully completed, switch to Cube Designer for the Analysis Services Tutorial
cube, and then click Reconnect on the toolbar of the Calculations tab.
12. On the Metadata tab in the Calculation Tools pane, expand Number of Employees in the Reseller
dimension, expand Members, and then expand All Resellers.
Notice that the members of this attribute hierarchy are now contained in five groups, numbered 0 through
4. To view the number of a group, pause the pointer over that group to view an InfoTip. For the range
2 -17 , the InfoTip should contain [Reseller].[Number of Employees].&[0] .
The members of this attribute hierarchy are grouped because the DiscretizationBucketCount property is set
to 5 and the DiscretizationMethod property is set to Automatic.
13. In the Expression box, add a comma in the Exists set expression after the Members function and before the
closing parenthesis, and then drag 83 - 100 from the Metadata pane and position it after the comma.
You have now completed the Exists set expression that will return the set of members that intersects with
these two specified sets, the set of all resellers and the set of resellers who have 83 to 100 employees, when
the Large Resellers named set is put on an axis.
The following image shows the Calculation Expressions pane for the [Large Resellers] named set.
14. On the toolbar of the Calculations tab, click Script View, and then review the two named sets that you
have just added to the calculation script.
15. Add a new line in the calculation script immediately before the first CREATE SET command, and then add
the following text to the script on its own line:
/* named sets */
You have now defined two named sets, which are visible in the Script Organizer pane. You are now ready
to deploy these named sets, and then to browse these measures in the Analysis Services Tutorial cube.
6. In the Metadata pane, in the Product dimension, drag Core Products to the filter area.
Notice that only the Bike member of the Category attribute and members of the Bike subcategories
remain in the cube. This is because the Core Products named set is used to define a subcube. This subcube
limits the members of the Category attribute in the Product dimension within the subcube to those
members of the Core Product named set, as shown in the following image.
7. In the Metadata pane, expand Reseller, add Large Resellers to the filter area.
Notice that the Reseller Sales Amount measure in the Data pane only displays sales amounts for large
resellers of bikes. Notice also that the Filter pane now displays the two named sets that are used to define
this particular subcube, as shown in the following image.
Next Lesson
Lesson 7: Defining Key Performance Indicators (KPIs)
See Also
Calculations
Create Named Sets
Lesson 7: Defining Key Performance Indicators (KPIs)
5/16/2018 • 2 minutes to read • Edit Online
NOTE
Completed projects for all of the lessons in this tutorial are available online. You can jump ahead to any lesson by using the
completed project from the previous lesson as a starting point. Click here to download the sample projects that go with this
tutorial.
Next Lesson
Lesson 8: Defining Actions
See Also
Analysis Services Tutorial Scenario
Multidimensional Modeling (Adventure Works Tutorial)
Key Performance Indicators (KPIs) in Multidimensional Models
Lesson 7-1 - Defining and Browsing KPIs
5/16/2018 • 7 minutes to read • Edit Online
NOTE
For more examples of KPIs, see the KPI examples on the Templates tab in the Calculation Tools pane or in the examples in the
Adventure Works DW 2012 sample data warehouse. For more information about how to install this database, see Install
Sample Data and Projects for the Analysis Services Multidimensional Modeling Tutorial.
In the task in this lesson, you define KPIs in the Analysis Services Tutorial project, and you then browse the
Analysis Services Tutorial cube by using these KPIs. You will define the following KPIs:
Reseller Revenue
This KPI is used to measure how actual reseller sales compare to sales quotas for reseller sales, how close
the sales are to the goal, and what the trend is toward reaching the goal.
Product Gross Profit Margin
This KPI is used to determine how close the gross profit margin is for each product category to a specified
goal for each product category, and also to determine the trend toward reaching this goal.
2. On the toolbar of the KPIs tab, click the New KPI button.
A blank KPI template appears in the display pane, as shown in the following image.
3. In the Name box, type Reseller Revenue, and then select Reseller Sales in the Associated measure
group list.
4. On the Metadata tab in the Calculation Tools pane, expand Measures, expand Reseller Sales, and then
drag the Reseller Sales-Sales Amount measure to the Value Expression box.
5. On the Metadata tab in the Calculation Tools pane, expand Measures, expand Sales Quotas, and then
drag the Sales Amount Quota measure to the Goal Expression box.
6. Verify that Gauge is selected in the Status indicator list, and then type the following MDX expression in
the Status expression box:
Case
When
KpiValue("Reseller Revenue")/KpiGoal("Reseller Revenue")>=.95
Then 1
When
KpiValue("Reseller Revenue")/KpiGoal("Reseller Revenue")<.95
And
KpiValue("Reseller Revenue")/KpiGoal("Reseller Revenue")>=.85
Then 0
Else-1
End
This MDX expression provides the basis for evaluating the progress toward the goal. In this MDX
expression, if actual reseller sales are more than 85 percent of the goal, a value of 0 is used to populate the
chosen graphic. Because a gauge is the chosen graphic, the pointer in the gauge will be half-way between
empty and full. If actual reseller sales are more the 90 percent, the pointer on the gauge will be three-
fourths of the way between empty and full.
7. Verify that Standard arrow is selected in the Trend indicator list, and then type the following expression in
the Trend expression box:
Case
When IsEmpty
(ParallelPeriod
([Date].[Calendar Date].[Calendar Year],1,
[Date].[Calendar Date].CurrentMember))
Then 0
When (
KpiValue("Reseller Revenue") -
(KpiValue("Reseller Revenue"),
ParallelPeriod
([Date].[Calendar Date].[Calendar Year],1,
[Date].[Calendar Date].CurrentMember))
/
(KpiValue ("Reseller Revenue"),
ParallelPeriod
([Date].[Calendar Date].[Calendar Year],1,
[Date].[Calendar Date].CurrentMember)))
>=.02
Then 1
When(
KpiValue("Reseller Revenue") -
(KpiValue ( "Reseller Revenue" ),
ParallelPeriod
([Date].[Calendar Date].[Calendar Year],1,
[Date].[Calendar Date].CurrentMember))
/
(KpiValue("Reseller Revenue"),
ParallelPeriod
([Date].[Calendar Date].[Calendar Year],1,
[Date].[Calendar Date].CurrentMember)))
<=.02
Then -1
Else 0
End
This MDX expression provides the basis for evaluating the trend toward achieving the defined goal.
Case
When [Product].[Category].CurrentMember Is
[Product].[Category].[Accessories]
Then .40
When [Product].[Category].CurrentMember
Is [Product].[Category].[Bikes]
Then .12
When [Product].[Category].CurrentMember Is
[Product].[Category].[Clothing]
Then .20
When [Product].[Category].CurrentMember Is
[Product].[Category].[Components]
Then .10
Else .12
End
Case
When KpiValue( "Product Gross Profit Margin" ) /
KpiGoal ( "Product Gross Profit Margin" ) >= .90
Then 1
When KpiValue( "Product Gross Profit Margin" ) /
KpiGoal ( "Product Gross Profit Margin" ) < .90
And
KpiValue( "Product Gross Profit Margin" ) /
KpiGoal ( "Product Gross Profit Margin" ) >= .80
Then 0
Else -1
End
This MDX expression provides the basis for evaluating the progress toward the goal.
7. Verify that Standard arrow is selected in the Trend indicator list, and then type the following MDX
expression in the Trend expression box:
Case
When IsEmpty
(ParallelPeriod
([Date].[Calendar Date].[Calendar Year],1,
[Date].[Calendar Date].CurrentMember))
Then 0
When VBA!Abs
(
KpiValue( "Product Gross Profit Margin" ) -
(
KpiValue ( "Product Gross Profit Margin" ),
ParallelPeriod
(
[Date].[ Calendar Date].[ Calendar Year],
1,
[Date].[ Calendar Date].CurrentMember
)
) /
(
KpiValue ( "Product Gross Profit Margin" ),
ParallelPeriod
(
[Date].[ Calendar Date].[ Calendar Year],
1,
[Date].[ Calendar Date].CurrentMember
)
)
) <=.02
Then 0
When KpiValue( "Product Gross Profit Margin" ) -
(
KpiValue ( "Product Gross Profit Margin" ),
ParallelPeriod
(
[Date].[ Calendar Date].[ Calendar Year],
1,
[Date].[ Calendar Date].CurrentMember
)
) /
(
KpiValue ( "Product Gross Profit Margin" ),
ParallelPeriod
(
[Date].[Calendar Date].[Calendar Year],
1,
[Date].[Calendar Date].CurrentMember
)
) >.02
Then 1
Else -1
End
This MDX expression provides the basis for evaluating the trend toward achieving the defined goal.
Browsing the Cube by Using the Total Gross Profit Margin KPI
1. On the Build menu, click Deploy Analysis Service Tutorial.
2. When deployment has successfully completed, click Reconnect on the toolbar of the KPIs tab, and then
click Browser View.
The Product Gross Profit Margin KPI appears and displays the KPI value for Q3 CY 2007 and the North
America sales territory.
3. In the Filter pane, select Product in the Dimension list, select Category in the Hierarchy list, select
Equal in the Operator list, and then select Bikes in the Filter Expression list, and then click OK.
The gross profit margin for the sale of Bikes by resellers in North America in Q3 CY 2007 appears.
Next Lesson
Lesson 8: Defining Actions
Lesson 8: Defining Actions
5/16/2018 • 2 minutes to read • Edit Online
NOTE
Completed projects for all of the lessons in this tutorial are available online. You can jump ahead to any lesson by using the
completed project from the previous lesson as a starting point. Click here to download the sample projects that go with this
tutorial.
Analysis Services supports the types of actions that are described in the following table.
Actions let users start an application or perform other steps within the context of a selected item. For more
information, see Actions (Analysis Services - Multidimensional Data), Actions in Multidimensional Models
NOTE
For examples of actions, see the action examples on the Templates tab in the Calculation Tools pane or in the examples in
the Adventure Works DW sample data warehouse. For more information about installing this database, see Install Sample
Data and Projects for the Analysis Services Multidimensional Modeling Tutorial.
Next Lesson
Lesson 9: Defining Perspectives and Translations
See Also
Analysis Services Tutorial Scenario
Multidimensional Modeling (Adventure Works Tutorial)
Actions (Analysis Services - Multidimensional Data)
Actions in Multidimensional Models
Lesson 8-1 - Defining and Using a Drillthrough Action
11/28/2018 • 4 minutes to read • Edit Online
2. On the toolbar of the Actions tab, click the New Drillthrough Action button.
A blank action template appears in the display pane.
3. In the Name box, change the name of this action to Internet Sales Details Drillthrough Action.
4. In the Measure group members list, select Internet Sales.
5. In the Drillthrough Columns box, select Internet Sales Order Details in the Dimensions list.
6. In the Return Columns list, select the Item Description and the Order Number check boxes, and then
click OK. The following image shows the Action template as it should appear at this point in this procedure.
Next Lesson
Lesson 9: Defining Perspectives and Translations
See Also
Actions (Analysis Services - Multidimensional Data)
Actions in Multidimensional Models
Dimension Relationships
Defining a Fact Relationship
Define a Fact Relationship and Fact Relationship Properties
Lesson 9: Defining Perspectives and Translations
5/16/2018 • 2 minutes to read • Edit Online
NOTE
Completed projects for all of the lessons in this tutorial are available online. You can jump ahead to any lesson by using the
completed project from the previous lesson as a starting point. Click here to download the sample projects that go with this
tutorial.
Next Lesson
Lesson 10: Defining Administrative Roles
See Also
Analysis Services Tutorial Scenario
Multidimensional Modeling (Adventure Works Tutorial)
Perspectives
Perspectives in Multidimensional Models
Dimension Translations
Cube Translations
Translation support in Analysis Services
Lesson 9-1 - Defining and Browsing Perspectives
5/16/2018 • 4 minutes to read • Edit Online
NOTE
A perspective is not a security mechanism, but instead is a tool for providing a better user experience. All security for a
perspective is inherited from the underlying cube.
In the tasks in this topic, you will define several different perspectives and then browse the cube through each of
these new perspectives.
NOTE
You can also set the default measure for the whole Analysis Services Tutorial cube in the Properties window on the
Cube Structure tab for the cube.
NOTE
Within each dimension, you can also individually select the user-defined hierarchies and attributes that you want to
appear in a perspective.
NOTE
You cannot specify a calculated measure as the default measure.
5. Alternatively, you can start Excel from the Windows Start menu, define a connection to the Analysis
Services Tutorial database on localhost, and choose a perspective in the Data Connection wizard, as shown
in the following image.
6. Select Internet Sales in the Perspective list and then review the measures and dimensions in the
metadata pane.
Notice that only those objects that are specified for the Internet Sales perspective appear.
7. In the metadata pane, expand Measures.
Notice that only the Internet Sales measure group appears, together with the Internet GPM and Internet
Sales Ratio to All Products calculated members.
8. In the model, select Excel again. Select Sales Summary.
Notice that in each of these measure groups, only a single measure appears, as shown in the following
image.
See Also
Perspectives
Perspectives in Multidimensional Models
Lesson 9-2 - Defining and Browsing Translations
11/28/2018 • 5 minutes to read • Edit Online
9. Click OK, and then click the ellipsis (...) for the French (France) translation for the Month Name attribute.
10. In the Translation columns list, select FrenchMonthName, and then click OK.
The steps in this procedure illustrate the process of defining metadata translations for dimension objects
and members.
6. In the metadata pane, right-click Cantidad de las Ventas del Internet and then select Add to Query.
7. In the metadata pane, expand Fecha, expand Fecha.Calendar Date, right-click Fecha.Calendar Date, and
then select Add to Filter.
8. In the Filter pane, select CY 2007 as the filter expression.
9. In the metadata pane, right-click Mes del Ano and select Add to Query.
Notice that the month names appear in Spanish, as shown in the following image.
10. On the toolbar, select French (France) in the Language list.
Notice that the month names now appear in French and that the measure name now also appears in
French.
Next Lesson
Lesson 10: Defining Administrative Roles
See Also
Dimension Translations
Cube Translations
Translation support in Analysis Services
Lesson 10: Defining Administrative Roles
5/16/2018 • 2 minutes to read • Edit Online
NOTE
Completed projects for all of the lessons in this tutorial are available online. You can jump ahead to any lesson by using the
completed project from the previous lesson as a starting point. Click here to download the sample projects that go with this
tutorial.
See Also
Analysis Services Tutorial Scenario
Multidimensional Modeling (Adventure Works Tutorial)
Lesson 10 - Granting Process Database Permissions
5/16/2018 • 2 minutes to read • Edit Online
NOTE
A completed project for Lesson 10 is available by downloading and installing the samples. For more information, see Install
Sample Data and Projects for the Analysis Services Multidimensional Modeling Tutorial.
See Also
Roles and Permissions (Analysis Services)
Data Mining Tutorials (Analysis Services)
5/16/2018 • 2 minutes to read • Edit Online
NOTE
The tutorials described here have not been updated for SQL Server 2017. You can use the tutorials created for SQL Server
2014. Functionally, there are no changes in Data Mining features for SQL Server 2017. The steps should be identical.
Tutorials
Basic Data Mining Tutorial (SQL Server 2014) - This tutorial walks you through a targeted mailing scenario. It
demonstrates how to use the data mining algorithms, mining model viewers, and data mining tools that are
included in Analysis Services. You will build three data mining models to answer practical business questions while
learning data mining concepts and tools.
Intermediate Data Mining Tutorial (SQL Server 2014) - This tutorial contains a collection of lessons that introduce
more advanced data mining concepts and techniques such as, forecasting, market basket analysis, neural networks
and logistic regression, and sequence clustering.
DMX Tutorials (SQL Server 2014) - The Data Mining Extensions (DMX) query language has syntax like that of
SQL but can be used to create, query, and manage predictive models stored in Analysis Services. These tutorials
demonstrate how to create a new mining structure and mining models by using the DMX language, and how to
create DMX prediction queries for use in applications.
See Also
Data Mining Solutions
Microsoft SQL Server Data Mining resources
Creating and Querying Data Mining Models with DMX: Tutorials (Analysis Services - Data Mining)
Install SQL Server Analysis Services
6/1/2018 • 2 minutes to read • Edit Online
Tabular mode uses the xVelocity in-memory analytics engine (VertiPaq), which is the default storage for tabular
models. After you deploy tabular models to the server, you can selectively configure tabular solutions to use
DirectQuery disk storage as an alternative to memory-bound storage.
Multidimensional and Data Mining mode use MOLAP as the default storage for models deployed to Analysis
Services. After deploying to the server, you can configure a solution to use ROLAP if you want to run queries
directly against the relational database rather than storing query data in an Analysis Services multidimensional
database .
Memory management and IO settings can be adjusted to get better performance when using non-default storage
modes. See Server Properties in Analysis Services for more information.
VALUE DESCRIPTION
See Also
Determine the Server Mode of an Analysis Services Instance
Tabular Modeling
Install Analysis Services in Power Pivot Mode
11/28/2018 • 11 minutes to read • Edit Online
Background
Power Pivot for SharePoint is a collection of middle-tier and backend services that provide Power Pivot data
access in a SharePoint 2016, or SharePoint 2013, farm.
Backend services: If you use Power Pivot for Excel to create workbooks that contain analytical data, you
must have Power Pivot for SharePoint to access that data in a server environment. You can run SQL
Server Setup on a computer that has SharePoint Server installed, or on a different computer that has no
SharePoint software. Analysis Services does not have any dependencies on SharePoint.
Note: This topic describes the installation of the Analysis Services server and the backend services.
Middle-tier: Enhancements to the Power Pivot experiences in SharePoint including Power Pivot Gallery,
Schedule data refresh, Management dashboard, and data providers. For more information on installing
and configuring the middle-tier, see the following:
Install or Uninstall the Power Pivot for SharePoint Add-in (SharePoint 2016)
Install or Uninstall the Power Pivot for SharePoint Add-in (SharePoint 2013)
Configure Power Pivot and Deploy Solutions (SharePoint 2016)
Configure Power Pivot and Deploy Solutions (SharePoint 2013)
Prerequisites
1. You must be a local administrator to run SQL Server Setup.
2. SharePoint Server enterprise edition is required for Power Pivot for SharePoint. You can also use the
evaluation enterprise edition.
3. The computer must be joined to a domain in the same Active Directory forest as the Office Online Server
(SharePoint 2016) or Excel Services (SharePoint 2013).
4. The Power Pivot instance name must be available. You cannot have an existing Power Pivot-named
instance on the computer on which you are installing Analysis Services in Power Pivot mode.
Note: The instance name must be POWERPIVOT.
5. Review Hardware and Software Requirements for Analysis Services Server in SharePoint Mode.
6. Review the release notes at SQL Server 2016 Release Notes.
SQL Server Edition Requirements
Business intelligence features are not all available in all editions of SQL Server 2017. For details, see Analysis
Services Features Supported by the Editions of SQL Server 2016 and Editions and Components of SQL Server
2016.
13. On the Server Configuration page, configure all of the services for Automatic Startup Type. Specify the
desired domain account and password for SQL Server Analysis Services, (1) in the following diagram.
For Analysis Services, you can use a domain user account or NetworkService account. Do not
use LocalSystem or LocalService accounts.
If you added the SQL Server Database Engine and SQL Server Agent, you can configure the
services to run under domain user accounts or under the default virtual account.
Never provision service accounts with your own domain user account. Doing so grants the server
the same permissions that you have to the resources in your network. If a malicious user
compromises the server, that user is logged in under your domain credentials. The user has the
permissions to download or use the same data and applications that you do.
Select Next.
14. If you are installing the Database Engine, the Database Engine Configuration page appears. In
Database Engine Configuration, select Add Current User to grant your user account administrator
permissions on the Database Engine instance.
Select Next.
15. On the Analysis Services Configuration page, select PowerPivot Mode under Server Mode
16. On the Analysis Services Configuration page, select Add Current User to grant your user account
administrative permissions. You will need administrative permission to configure the server after Setup is
finished.
In the same page, add the Windows user account of any person who also requires administrative
permissions. For example, any user who wants to connect to the Analysis Services service instance
in SQL Server Management Studio to troubleshoot database connection problems must have
system administrator permissions. Add the user account of any person who might need to
troubleshoot or administer the server now.
NOTE
All service applications that require access to the Analysis Services server instance need to have Analysis
Services Administrative permissions. For example, add the service accounts for Excel Services, Power View,
and Performance Point Services. Also, add the SharePoint farm account, which is used as the identity of the
web application that hosts Central Administration.
Select Next.
17. On the Error Reporting page, select Next.
18. On the Ready to Install page, select Install.
19. If you see the dialog Computer Restart Required, select OK.
20. When the installation is complete, select Close.
21. Restart the computer.
22. If you have a firewall in your environment, review the SQL Server Books Online topic, Configure the
Windows Firewall to Allow Analysis Services Access.
Verify the SQL Server Installation
Verify that the Analysis Services Service is running.
1. In Microsoft Windows click Start, select All Programs, and select the Microsoft SQL Server 2016 group.
2. Select SQL Server Management Studio.
3. Connect to the Analysis Services instance, for example [your server name]\POWERPIVOT. If you can
connect to the instance, you have verified the Service is running.
SharePoint 2013
Grant Excel Services Server Administration Rights on Analysis Services
You do not need to complete this section if during the Analysis Services installation; you added the Excel Services
Application service account as an Analysis Services administrator.
1. On the Analysis Services server, start SQL Server Management Studio and connect to the Analysis
Services instance, for example [MyServer]\POWERPIVOT .
2. In Object Explorer, right-click the instance name and select Properties.
3. In the left pane, select Security. Add the domain login you configured for the Excel Services Application in
step 1.
Type a description.
6. Click Ok.
7. The changes will take effect in a few minutes or you can Stop and Start the service Excel Calculation
Services. To
Another option is to open a command prompt with administrative privileges, and type iisreset /noforce .
You can verify the server is recognized by Excel Services by reviewing entries in the ULS log. You will see
entries similar to the following:
Excel Services Application Data Model 27 Medium Check
Administrator Access ([ServerName]\POWERPIVOT): Pass. f127bd9b-bae3-e0e0-9b48-3f7b5ad1eae6
Excel Services Application Data Model 27 Medium Check Server
Version ([ServerName]\POWERPIVOT): Pass (11.0.2809.24 >= 11.0.2800.0). f127bd9b-bae3-e0e0-9b48-
3f7b5ad1eae6
Excel Services Application Data Model 27 Medium Check
Deployment Mode ([ServerName]\POWERPIVOT): Pass. f127bd9b-bae3-e0e0-9b48-3f7b5ad1eae6
See Also
Migrate Power Pivot to SharePoint 2013
Install or Uninstall the Power Pivot for SharePoint Add-in (SharePoint 2013)
Upgrade Workbooks and Scheduled Data Refresh (SharePoint 2013)
Verify a Power Pivot for SharePoint Installation
5/16/2018 • 4 minutes to read • Edit Online
NOTE
SharePoint installation documentation includes additional instructions for working around proxy server errors
and for disabling Internet Explorer Enhanced Security Configuration so that you can download and install
updates. For more information, see the Perform additional tasks section in Deploy a single server with SQL
Server on the Microsoft web site.
Summary of Accounts
Power Pivot for SharePoint 2016 supports the use of the Network Service account for the Analysis Services
service account. The Network Service account is not a supported scenario with SharePoint 2010. For more
information on Service accounts, see Configure Windows Service Accounts and Permissions
(http://msdn.microsoft.com/library/ms143504.aspx).
The following table summarizes the three accounts used in this example of a minimum privileged configuration.
SCOPE NAME
Summary of Accounts
Power Pivot for SharePoint 2013 supports the use of the Network Service account for the Analysis Services
service account. The Network Service account is not a supported scenario with SharePoint 2010. For more
information on Service accounts, see Configure Windows Service Accounts and Permissions
(http://msdn.microsoft.com/library/ms143504.aspx).
The following table summarizes the three accounts used in this example of a minimum privileged configuration.
SCOPE NAME
Background
Application Server: Power Pivot functionality in SharePoint 2016 includes using workbooks as a data
source, scheduled data refresh, and the Power Pivot Management Dashboard.
Power Pivot for SharePoint 2016 is a Microsoft Windows Installer package (spPowerpivot16.msi) that
deploys Analysis Services client libraries and copies Power Pivot for SharePoint 2013 installation files to the
computer. The installer does not deploy or configure Power Pivot features in SharePoint. The following
components install by default:
Power Pivot for SharePoint 2016. This component includes PowerShell scripts (.ps1 files), SharePoint
solution packages (.wsp), and the Power Pivot for SharePoint 2016 configuration tool to deploy
Power Pivot in a SharePoint 2016 farm.
Microsoft OLE DB Provider for Analysis Services (MSOLAP ).
ADOMD.NET data provider.
SQL Server Analysis Management Objects.
Backend services: If you use Power Pivot for Excel to create workbooks that contain analytical data, you
must have Office Online Server configured with a BI server running Analysis Services in Power Pivot mode
to access that data in a server environment. You can run SQL Server Setup on a computer that has
SharePoint Server 2016 installed, or on a different computer that has no SharePoint software. Analysis
Services does not have any dependencies on SharePoint.
For more information on installing, uninstalling, and configuring the backend services, see the following:
Install Analysis Services in Power Pivot Mode
Uninstall Power Pivot for SharePoint
NOTE
You must install the Analysis Services data providers on a SharePoint 2016 server using spPowerPivot16.msi. Other
installer packages available in the SQL Server 2017 Feature Pack are not supported because these packages do not include
the SharePoint 2016 support files that the data providers require in this environment.
Configuration Tool: The Power Pivot for SharePoint 2016 configuration tool is required on only one of the
SharePoint servers. However a recommended best practice in multi-server farms is to install the configuration tool
on at least two servers so you have access to the configuration tool if one of the two servers is offline.
IMPORTANT
If you use the /q switch for a silent command line installation, the end-user license agreement will not be displayed.
Regardless of the installation method, the use of this software is governed by a license agreement and you are responsible
for complying with the license agreement.
Msiexec.exe /i spPowerPivot16.msi /q
OPTION DESCRIPTION
PowerPivot16WebApplicationSolution.wsp
Following the .msi installation, run the Power Pivot for SharePoint 2016 Configuration Tool to configure and
deploy the solutions in the SharePoint farm.
To start the configuration tool:
From the Windows Start screen type "power" and in the Apps search results, select Power Pivot for SharePoint
2016 Configuration. Note that the search results may include two links because SQL Server setup installs
separate Power Pivot configuration tools for SharePoint 2013 and SharePoint 2016. Make sure you start the
Power Pivot for SharePoint 2016 Configuration tool.
Or
1. Go to Start, All Programs.
2. Select Microsoft SQL Server 2017.
3. Select Configuration Tools.
4. Select Power Pivot for SharePoint 2016 Configuration.
For more information on the configuration tool, see Power Pivot Configuration Tools.
If you uninstall spPowerPivot16.msi the data providers and the configuration tool are uninstalled. Uninstalling
the data providers will cause the server to be unable to connect to Power Pivot.
You can uninstall or repair Power Pivot for SharePoint 2016 using one of the following methods:
1. Windows control panel: Select Microsoft SQL Server 2017Power Pivot for SharePoint 2016. Select
either Uninstall or Repair.
2. Run the spPowerPivot16.msi and select the Remove option or the Repair option.
Command Line: To repair or uninstall Power Pivot for SharePoint 2016 using the command line, open a
command prompt with administrator permissions and run one of the following commands:
To Repair, run the following command:
msiexec.exe /f spPowerPivot16.msi
OR
To uninstall, run the following command:
Background
Application Server: Power Pivot functionality in SharePoint 2013 includes using workbooks as a data
source, scheduled data refresh, and the Power Pivot Management Dashboard.
Power Pivot for SharePoint 2013 is a Microsoft Windows Installer package (spPowerpivot.msi) that
deploys Analysis Services client libraries and copies Power Pivot for SharePoint 2013 installation files to
the computer. The installer does not deploy or configure Power Pivot features in SharePoint. The following
components install by default:
Power Pivot for SharePoint 2013. This component includes PowerShell scripts (.ps1 files),
SharePoint solution packages (.wsp), and the Power Pivot for SharePoint 2013 configuration tool to
deploy Power Pivot in a SharePoint 2013 farm.
Microsoft OLE DB Provider for Analysis Services (MSOLAP ).
ADOMD.NET data provider.
SQL Server Analysis Management Objects.
Backend services: If you use Power Pivot for Excel to create workbooks that contain analytical data, you
must have Excel Services configured with a BI server running Analysis Services in SharePoint mode to
access that data in a server environment. You can run SQL Server Setup on a computer that has
SharePoint Server 2013 installed, or on a different computer that has no SharePoint software. Analysis
Services does not have any dependencies on SharePoint.
For more information on installing, uninstalling, and configuring the backend services, see the following:
Install Analysis Services in Power Pivot Mode
Uninstall Power Pivot for SharePoint
NOTE
You must install the Analysis Services data providers on a SharePoint 2013 server using spPowerPivot.msi. Other installer
packages available in the SQL Server 2017 Feature Pack are not supported because these packages do not include the
SharePoint 2013 support files that the data providers require in this environment.
Configuration Tool: The Power Pivot for SharePoint 2013 configuration tool is required on only one of the
SharePoint servers. However a recommended best practice in multi-server farms is to install the configuration
tool on at least two servers so you have access to the configuration tool if one of the two servers is offline.
IMPORTANT
If you use the /q switch for a silent command line installation, the end-user license agreement will not be displayed.
Regardless of the installation method, the use of this software is governed by a license agreement and you are responsible
for complying with the license agreement.
Msiexec.exe /i spPowerPivot.msi /q
OPTION DESCRIPTION
SQL_OLAPDM MSOLAP
Deploy the SharePoint Solution Files with the Power Pivot for
SharePoint 2013 Configuration Tool
Three of the files copied to the hard drive by spPowerPivot.msi are SharePoint solution files. The scope of one
solution file is the Web application level while the scope of the other files is the farm level. The files are the
following:
PowerPivotFarmSolution.wsp
PowerPivotFarm14Solution.wsp
PowerPivotWebApplicationSolution.wsp
Following the .msi installation, run the Power Pivot for SharePoint 2013 Configuration Tool to configure and
deploy the solutions in the SharePoint farm.
To start the configuration tool:
From the Windows Start screen type "power" and in the Apps search results, click Power Pivot for SharePoint
2013 Configuration. Note that the search results may include two links because SQL Server setup installs
separate Power Pivot configuration tools for SharePoint 2010 and SharePoint 2013. Make sure you start the
Power Pivot for SharePoint 2013 Configuration tool.
Or
1. Go to Start, All Programs.
2. Click Microsoft SQL Server 2017.
3. Click Configuration Tools.
4. Click Power Pivot for SharePoint 2013 Configuration.
For more information on the configuration tool, see Power Pivot Configuration Tools.
If you uninstall spPowerPivot.msi the data providers and the configuration tool are uninstalled. Uninstalling the
data providers will cause the server to be unable to connect to Power Pivot.
You can uninstall or repair Power Pivot for SharePoint 2013 using one of the following methods:
1. Windows control panel: Select Microsoft SQL Server 2017Power Pivot for SharePoint 2013. Click
either Uninstall or Repair.
2. Run the spPowerPivot.msi and select the Remove option or the Repair option.
Command Line: To repair or uninstall Power Pivot for SharePoint 2013 using the command line, open a
command prompt with administrator permissions and run one of the following commands:
To Repair, run the following command:
msiexec.exe /f spPowerPivot.msi
OR
To uninstall, run the following command:
NAME DESCRIPTION
Power Pivot Configuration Tool SharePoint 2010 with SharePoint 2010 Service Pack 1 (SP1)
Note: To complete the following steps, you must be a farm administrator. If you see an error message similar to
the following:
"The user is not a farm administrator. Please address the validation failures and try again."
Either login as the account that installed SharePoint or configure the setup account as the primary administrator
of the SharePoint Central Administration Site.
1. On the Start menu, click All Programs, and then click Microsoft SQL Server 2017, click Configuration
Tools, and then click Power Pivot For SharePoint 2013 Configuration. Toold is listed only when Power
Pivot for SharePoint is installed on the local server.
2. Click Configure or Repair Power Pivot for SharePoint and then click OK.
3. The tool runs validation to verify the current state of Power Pivot and what steps are required to complete
configuration. Expand the window to full size. You should see a button bar at the bottom of the window
that includes Validate, Run, and Exit commands.
4. On the Parameters tab:
a. Default Account UserName: Enter a domain user account for the default account. This account
will be used to provision services, including the Power Pivot service application pool. Do not specify
a built-in account such as Network Service or Local System. The tool blocks configurations that
specify built-in accounts.
b. Database Server: You can use SQL Server Database engine that is supported for the SharePoint
farm.
c. Passphrase: Enter a passphrase. If you are creating a new SharePoint farm, the passphrase is used
whenever you add a server or application to the SharePoint farm. If the farm already exists, enter
the passphrase that allows you to add a server application to the farm.
d. Power Pivot Server for Excel Services: Type the name of an Analysis Services SharePoint mode
server. In a single-server deployment, it is the same as the database server.
[ServerName]\powerpivot
e. Click Create Site Collection in the left window. Note Site URL so you can reference it in later
steps. If the SharePoint server is not already configured, then the configuration wizard defaults the
web application, and site collection URLs to the root of http://[ServerName] . To modify the defaults
review the following pages in the left window: Create Default Web application and Deploy
Web Application Solution
5. Optionally, review the remaining input values used to complete each action. Click each action in the left
window to see and review the details of the action. For more information about each one, see the section
"Input values used to configure the server in Configure or Repair Power Pivot for SharePoint 2010 (Power
Pivot Configuration Tool) in this topic.
6. Optionally, remove any actions that you do not want to process at this time. For example, if you want to
configure Secure Store Service later, click Configure Secure Store Service, and then clear the checkbox
Include this action in the task list.
7. Click Validate to check whether the tool has sufficient information to process the actions in the list. If you
see validation errors, click the warnings in the left pane to see details of the validation error. Correct any
validation errors and then click Validate again.
8. Click Run to process all of the actions in the task list. Note that Run becomes available after you validate
the actions. If Run is not enabled, click Validate first.
For more information, see Configure or Repair Power Pivot for SharePoint 2010 (Power Pivot Configuration
Tool)
Troubleshoot Issues
To assist in troubleshooting issues, it is a good idea to verify the diagnostic logging is enabled.
1. In SharePoint Central Administration, click Monitoring and then click Configure usage and health
data collection.
2. Verify Enable usage data collection is selected.
3. Verify the following events are selected:
Definition of usage fields for Education telemetry
Power Pivot Connects
Power Pivot Load Data Usage
Power Pivot Query Usage
Power Pivot Unload Data Usage
4. Verify Enable health data collection is selected.
5. Click OK.
For more information on trouble shooting data refresh, see Troubleshooting Power Pivot Data Refresh
(http://social.technet.microsoft.com/wiki/contents/articles/3870.troubleshooting-powerpivot-data-refresh.aspx).
For more information on the configuration tool, see Power Pivot Configuration Tools.
Migrate Power Pivot to SharePoint 2013
12/10/2018 • 7 minutes to read • Edit Online
Prepare the SharePoint Backup, copy, restore Mount content databases Migrate Power Pivot
2013 farm databases. Schedules
database. The service application database does not need to be mounted, only the content databases:
For more information, see Attach or detach content databases (SharePoint Server 2010)
(http://technet.microsoft.com/library/ff628582.aspx).
Status when the step is complete: When the mount operation is complete, users can see files that were in
the old content database. Therefore users can see and open the workbooks in the document library.
TIP
It is possible at this point in the migration process to create new schedules for the migrated workbooks.
However, the schedules are created in the new Power Pivot service application database, and not the
database you copied from the old SharePoint farm. Therefore it will not contain any of the old schedules.
After you complete the following steps to use the old database and migrate the old schedules, the new
schedules are not available.
$app=Get-PowerPivotServiceApplication
Set-PowerPivotServiceApplication $app -StartMigratingRefreshSchedules
After the Windows PowerShell script is run, the schedules are active and the schedules will run at the
next appropriate time. However, the status one the schedule refresh page is not enabled. When the
schedule runs the first time it will be migrated and on the schedule refresh page, Enabled will be
true.
2. If you want to check the current value of the StartMigratingRefreshSchedules property, run the
following PowerShell script. The Script loops through all Power Pivot service application objects and
display the name and property values:
$apps = Get-PowerPivotServiceApplication
foreach ($app in $apps){}
Get-PowerPivotServiceApplication $appp | format-table -property
displayname,id,StartMigratingRefreshSchedules
Additional Resources
NOTE
For more information on Power Pivot and SharePoint database-attach upgrade, see the following:
WARNING
You cannot rollback upgrade for workbooks that are upgraded automatically on the server. Once a workbook is upgraded,
it remains upgraded. To use a previous version, you can republish the previous workbook to SharePoint, restore a previous
version, or recycle the workbook. For more information about restoring or recycling a document in SharePoint, see Plan to
protect content by using recycle bins and versioning.
IMPORTANT
You cannot rollback an upgraded workbook, so be sure to make a copy of the file if you want to use it in the previous
version of Power Pivot for Excel, or on a previous version of Power Pivot for SharePoint.
The following table lists the support and behavior of Power Pivot workbooks based on the environment in which
the workbook was created. The behavior described includes the general user experience, the supported upgrade
options to upgrade the workbook to the particular environment, and the behavior of scheduled data refresh of a
workbook that has not yet been upgraded.
Workbook Behavior and Upgrade Options
CREATED IN < SUPPORT AND BEHAVIOR >
2008 R2 Power Pivot for 2012 Power Pivot for 2012 SP1 Power Pivot for
SharePoint 2010 SharePoint 2010 SharePoint 2013
CREATED IN < SUPPORT AND BEHAVIOR >
2008 R2 Power Pivot for All Features Experience: Users can Experience: Users can
Excel 2010 interact with the workbook interact with the workbook
in the browser and use it as and use it as a data source
a data source for other for other solutions.
solutions.
Upgrade: Auto upgrade is
Upgrade: Workbooks will not available. Users must
auto upgrade in the manually upgrade their
document library if Auto 2008 R2 workbooks to the
Upgrade is enabled for the 2012 version or to the office
Power Pivot system Service 2013 version.
in the SharePoint farm,
Schedule data refresh:
Schedule data refresh: NOT supported. Workbook
NOT supported. Workbook needs to be upgraded.
needs to be upgraded.
2012 Power Pivot for Not supported All Features Experience: Users can
Excel interact with the workbook
in the browser and use it as
a data source for other
solutions. Schedule data
refresh is available.
NOTE
Automatic upgrade is a server configuration feature; you cannot enable or disable it for specific workbooks, libraries,
or site collections.
PS C:\Windows\system32> Get-PowerPivotSystemService
The output from Get-PowerPivotSystemService is a list of properties and corresponding values. You should see
WorkbookUpgradeOnDataRefresh in the property list. It will be set to true if automatic upgrade is enabled. If
it is false, continue to the next step, enabling automatic workbook upgrade.
To enable automatic workbook upgrade, run the following command:
After you upgrade the workbook, you can use scheduled data refresh and new features in the Power Pivot for
Excel add-in.
See Also
Migrate Power Pivot to SharePoint 2013
Upgrade Power Pivot for SharePoint
What's New in Analysis Services
View Data Refresh History (Power Pivot for SharePoint)
Configure Analysis Services and Kerberos
Constrained Delegation (KCD)
12/3/2018 • 8 minutes to read • Edit Online
Overview
KCD enables an account to impersonate another account for the purpose of providing access to resources. The
impersonating account would be a service account assigned to a web application or the computer account of a web
server while the impersonated account would be a user account requiring access to resources. KCD operates at the
service level, so that selected services on a server can be granted access by the impersonating account, while other
services on the same server, or services on other servers are denied for access.
The sections in this topic review common scenarios with Analysis Services and Power Pivot where KCD is required
as well as an example server deployment with a high level summary of what you need to install and configure. See
the More Information and community content section for links to more detailed information on the technologies
involved such as Domain Controllers and KCD.
Domain Controller
The following is a summary of what to install for the domain controller (DC ).
Role: Active Directory Domain Services. For an overview, see Configuring Active Directory (AD DS ) in
Windows Server 2012.
Role: DNS Server
Feature: .NET Framework 3.5 Features / .NET Framework 3.5
Feature: Remote Server Administration Tools / Role Administration Tools
Configure Active Directory to create a new Forest and join the computers to the domain. Before trying to
add other computers to the private domain, you will need to configure the client computers DNS to the
DC's IP address. On the DC machine, run ipconfig /all to get the IPv4 and IPv6 addresses for the next
step.
It is recommended you configure both IPv4 and IPv6 addresses. You can do this in Windows control panel:
1. Click Network and Sharing Center
2. Click your Ethernet connection
3. Click Properties
4. Click Internet Protocol Version 6 (TCP/IPv6)
5. Click Properties
6. Click Use the following DNS server addresses
7. Type the IP address from the ipconfig command.
8. Click the Advanced button , click the DNS tab and verify the DNS suffixes are correct.
9. Click Append these DNS Suffixes.
10. Repeat the steps for IPv4.
Note: you can join computers to the domain from Windows Control panel, in the System settings. For more
information, see How To Join Windows Server 2012 to a Domain.
2016 SQL Server Database engine and Analysis services in Power Pivot mode
The following is a summary of what to install on the SQL Server computer.
In the SQL Server 2017 setup wizard, Analysis Services in Power Pivot mode is installed as part of the feature
selection workflow.
1. Run the SQL Server 2017 setup wizard and from the feature selection page, click the database engine,
Analysis Services, and the Management tools. In a later setup for the setup wizard you can specify the Power
Pivot mode for Analysis Services.
2. For instance configuration, configure a named instance of "POWERPIVOT".
3. On the Analysis Services Configuration page, configure the Analysis Services server for Power Pivot mode
and add the computer name of the Office Online Server to the list of Analysis Services server
administrators. For more information, see Install Analysis Services in Power Pivot Mode.
4. Note, by default the "Computer" object type is not included in the search. Click to add the
Computers object.
5. Create the Service Principal Names (SPN ) for the Analysis Services instance.
The following are useful SPN commands:
List the SPN for a specific account name running the service of interest: SetSPN -l <account-name>
Set a SPN for an account name that is running the service of interest:
SetSPN -a <SPN> <account-name>
Delete a SPN from a specific account name running the service of interest:
SetSPN -D <SPN> <account-name>
The SPN for the PowerPivot instance will be in the form of:
Where the FQDN and NetBIOS names are the name of the machine that the instance resides on. These
SPNs will be placed on the Domain Account that is being used for the service account. If you are using
Network Service, Local System, or the Service ID, you will want to place the SPN on the domain machine
account. If you are using a domain user account, you will place the SPN on that account.
6. Create the SPN for the SQL Browser service on the Analysis Services machine.
Learn more
7. Configure constrained delegation settings on the Analysis Services service account for any external
source you will be refreshing from such as SQL Server, or Excel files. On the Analysis Services service
account, we want to make sure the following are set.
Note: If you do not see the delegation tab for the account, within Active Directory Users and Computers, it
is because there is no SPN on that account. You can add a fake SPN to get it to appear such as my/spn .
Trust this user for delegation to specified services only and Use any authentication protocol.
This is known as constrained delegation, and is required because the windows token will originate from a
Claims to Windows Token Services (C2WTS ) which requires constrained delegation with protocol
transitioning.
You will also need to add the services that you will be delegating to. This will vary based on your
environment.
Office Online Server
1. Install Office Online Server
2. Configure Office Online Server to connect to the Analysis Services server. Note, the Office Online Server
computer account needs to be an administrator on the Analysis Services server. This was completed in a
previous section of this topic, installing the Analysis Services server.
a. On the Office Online Server, open a PowerShell window with administrative privileges and run the
following command
b. New-OfficeWebAppsExcelBIServer -ServerId <AS instance name>
3. Configure Active Directory to allow the Office Online Server computer account to impersonate users to
the SharePoint service account. So, set delegation property on principal running the Application Pool for
SharePoint Web Services, on the Office Online Server: The PowerShell commands in this section require the
Active Directory (AD ) PowerShell objects.
a. Get the Active Directory identity of the Office Online Server
find this Principal name is by looking at Task Manager / Details / w3wp.exe's User name. For example
"svcSharePoint"
4. Configure constrained delegation settings on the Office Online Server account to the Analysis Services
Power Pivot instance. This should be the machine account that Office Online Server is running on. On the
Office Online Service account, we want to make sure the following are set.
Note: If you do not see the delegation tab for the account, within Active Directory Users and Computers, it
is because there is no SPN on that account. You can add a fake SPN to get it to appear such as my/spn .
Trust this user for delegation to specified services only and Use any authentication protocol.
This is known as constrained delegation, and is required because the windows token will originate from a
Claims to Windows Token Services (C2WTS ) which requires constrained delegation with protocol
transitioning. You will then want to allow delegation to the MSOLAPSvc.3 and MSOLAPDisco.3 SPNs that
we created above.
5. Setup Claims to windows token service (C2WTS ) This is needed for scenario 1. For more information see
Claims to Windows Token Service (c2WTS ) Overview.
6. Configure constrained delegation settings on the C2WTS service account. The settings should match
what you did in step 4.
A full PowerShell script is included at the bottom of the topic. Use the full script as a starting point to build a
custom script for auditing your full Power Pivot for SharePoint deployment.
Windows PowerShell
For more information on the PowerShell ISE, see Introducing the Windows PowerShell ISE and Use Windows
PowerShell to administer SharePoint 2013.
You can optionally verify a majority of the components in
Central Administration, using the Power Pivot management
dashboard. To open the dashboard in Central Administration,
click General Application Settings, and then click
Management Dashboard in the Power Pivot. For more
information on the dashboard, see Power Pivot Management
Dashboard and Usage Data.
Data refresh is not running See the section Timer Jobs and verify the Online Power Pivot
Data Refresh Timer Job is online.
Management dashboard data is old See the section Timer Jobs and verify the Management
Dashboard Processing Timer Job is online.
Some portions of the Management Dashboard If you install Power Pivot for SharePoint into a farm that has
the topology of Central Administration, without Excel Services
or Power Pivot for SharePoint, you must download and install
the Microsoft ADOMD.NET client library if you want full access
to the built-in reports in the Power Pivot management
dashboard. Some reports in the dashboard use ADOMD.NET
to access internal data that provides reporting data on Power
Pivot query processing and server health in the farm. See the
section ADOMD.Net client Library and the topic Install
ADOMD.NET on Web Front-End Servers Running Central
Administration.
get-service | select name, displayname, status | where {$_.Name -eq "msolap`$powerpivot"} | format-table -
property * -autosize | out-default
Example output
Example output
PowerPivotEngineService
NOTE
Skip this script if you are using SharePoint 2013. The PowerPivotEngineService is not part of a SharePoint 2013
deployment. If you run the Get-PowerPivotEngineService cmdlet on SharePoint 2013, you will see an error message similar to
the following. This error message is returned even if you have run the Add-PSSnapin command described in the prerequisites
section of this topic.
The term 'Get-PowerPivotEngineService' is not recognized as the name of a cmdlet
Example output
Example output
TypeName : PowerPivot Service Application
Name : PowerPivotServiceApplication1
Status : Online
UnattendedAccount : PowerPivotUnattendedAccount
ApplicationPool : SPIisWebServiceApplicationPool Name=sqlbi_serviceapp
Farm : SPFarm Name=SharePoint_Config
Database : GeminiServiceDatabase Name=PowerPivotServiceApplication1_19648f3f2c944e27acdc6c20aab8487a
NOTE
The following code sample first returns the applicationpool property of the default Power Pivot for SharePoint service
application. The name is parsed from the string and used to get the status of the application pool object.
Verify the Status is Online. If the status is not Online or you see "http error" when you browse the Power Pivot site, verify
the identity credentials in the IIS application pools are still correct. The IIS pool name will is the value of the ID property
returned by the Get-SPServiceApplicationPool command.
Example output
The application pool can also be verified on the Central Administration page Manage Service Applications.
Click the name of the service application and then click properties in the ribbon.
Power Pivot and Excel Service Application proxies
Verify the Status is Online.
Example output
Get-SPDatabase | select name, status, server, typename | where {$_.TypeName -eq "content database" -or
$_.TypeName -like "*Gemini*"} | format-table -property * -autosize | out-default
Example output
SharePoint Features
Verify the site, web, and farm features are online.
Get-SPFeature | select displayname, status, scope, farm | where {$_.displayName -like "*powerpivot*"} | format-
table -property * -autosize | out-default
Example output
Timer Jobs
Verify the Time Jobs are Online. The Power Pivot EngineService is not installed on SharePoint 2013, therefore the
script will not list EngineService timer jobs in a SharePoint 2013 deployment.
Get-SPTimerJob | where {$_.service -like "*power*" -or $_.service -like "*mid*"} | select status, displayname,
LastRunTime, service | format-table -property * -autosize | out-default
Example output
Status DisplayName LastRunTime
Service
------ ----------- -----------
-------
Online Health Analysis Job (Daily, SQL Server Analysis Services, All Servers) 4/9/2014 12:00:01
AM EngineService Name=MSOLAP$POWERPIVOT
Online Health Analysis Job (Hourly, SQL Server Analysis Services, All Servers) 4/9/2014 1:00:01 PM
EngineService Name=MSOLAP$POWERPIVOT
Online Health Analysis Job (Weekly, SQL Server Analysis Services, All Servers) 4/6/2014 12:00:10
AM EngineService Name=MSOLAP$POWERPIVOT
Online PowerPivot Management Dashboard Processing Timer Job 4/8/2014 3:45:38 AM
MidTierService
Online PowerPivot Health Statistics Collector Timer Job 4/9/2014 1:00:12 PM
MidTierService
Online PowerPivot Data Refresh Timer Job 4/9/2014 1:09:36 PM
MidTierService
Online Health Analysis Job (Daily, SQL Server PowerPivot Service Application, All Servers) 4/9/2014 12:00:00
AM MidTierService
Online Health Analysis Job (Daily, SQL Server PowerPivot Service Application, Any Server) 4/9/2014 12:00:00
AM MidTierService
Online Health Analysis Job (Weekly, SQL Server PowerPivot Service Application, All Servers) 4/6/2014 12:00:03
AM MidTierService
Online Health Analysis Job (Weekly, SQL Server PowerPivot Service Application, Any Server) 4/6/2014 12:00:03
AM MidTierService
Online PowerPivot Setup Extension Timer Job 4/1/2014 1:40:31 AM
MidTierService
Health Rules
There are fewer rules in a SharePoint 2013 deployment. For a full list of rules for each SharePoint environment
and an explanation of how to use the rules, see Configure Power Pivot Health Rules.
Get-SPHealthAnalysisRule | select name, enabled, summary | where {$_.summary -like "*power*"} | format-table -
property * -autosize | out-default
Example output
Example output
The following variation of the command only returns log events for the data refresh category.
Example output
Timestamp : 4/14/2014 7:15:01 PM
Area : PowerPivot Service
Category : Data Refresh
EventID : 43
Level : High
Correlation : 5755879c-7cab-e097-8f80-f27895d44a77
Message : The following error occured when working with the service application, Default PowerPivot Service
Application. Skipping the service application..
System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan
timeout...
MSOLAP Provider
Verify the provider MSOLAP provider. SQL Server 2012 (11.x) and SQL Server 2014 (12.x) Power Pivot require
MSOLAP.5.
$excelApp=Get-SPExcelServiceApplication
get-spexceldataprovider -ExcelServiceApplication $excelApp |select providerid,providertype,description | where
{$_.providerid -like "msolap*" } | format-table -property * -autosize | out-default
Example output
For more information, see Install the Analysis Services OLE DB Provider on SharePoint Servers and Add
MSOLAP.5 as a Trusted Data Provider in Excel Services.
Example output
name version vendor
---- ------- ------
Microsoft SQL Server 2008 Analysis Services ADOMD.NET 10.1.2531.0 Microsoft Corporation
Microsoft SQL Server 2005 Analysis Services ADOMD.NET 9.00.1399.06 Microsoft Corporation
For more information, see Install ADOMD.NET on Web Front-End Servers Running Central Administration.
get-spusagedefinition | select name, status, enabled, tablename, DaysToKeepDetailedData | where {$_.name -like
"powerpivot*"} | format-table -property * -autosize | out-default
Example output
Solutions
If the other components are online then you can skip verifying the solutions. If however the Health rules are
missing, verify the two solutions exist and showed Verify the two Power Pivot solutions are Online and Deployed.
get-spsolution | select name, status, deployed, DeploymentState, DeployedServers | where {$_.Name -like
"*powerpivot*"} | format-table -property * -autosize | out-default
For more information on how to deploy SharePoint solutions, see Deploy solution packages (SharePoint Server
2010).
More Resources
Web Server (IIS ) Administration Cmdlets in Windows PowerShell.
PowerShell to check services, IIS sites and Application Pool status in SharePoint.
Windows PowerShell for SharePoint 2013 reference
Windows PowerShell for SharePoint Foundation 2010 reference
Manage Excel Services with Windows PowerShell (SharePoint Server 2010)
View and Read SQL Server Setup Log Files
Use the Get-EvenLog cmdlet
#Write-Host ""
Write-Host -ForegroundColor Green "Analysis Services Windows Service"
Write-Host -ForegroundColor Green ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
get-service | select name, displayname, status | where {$_.Name -eq "msolap`$powerpivot"} | format-table -
property * -autosize | out-default
#Write-Host ""
Write-Host -ForegroundColor Green "PowerPivotEngineService and PowerPivotSystemService"
Write-Host -ForegroundColor Green ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
#Write-Host ""
#Write-Host -ForegroundColor Green "Service Instances - optional if you want to associate services with the
server"
#Write-Host -ForegroundColor Green ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
#Get-SPServiceInstance | select typename, status, server, service, instance | where {$_.TypeName -like
#Get-SPServiceInstance | select typename, status, server, service, instance | where {$_.TypeName -like
"*powerpivot*" -or $_.TypeName -like "*excel*" -or $_.TypeName -like "*Analysis Services*"} | format-table -
property * -autosize | out-default
#Get-PowerPivotEngineServiceInstance | select typename, ASServername, status, server, service, instance
#Get-PowerPivotSystemServiceInstance | select typename, ASSServerName, status, server, service, instance
#Write-Host ""
Write-Host -ForegroundColor Green "PowerPivot And Excel Service Applications"
Write-Host -ForegroundColor Green ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
Get-PowerPivotServiceApplication | select typename,name, status, unattendedaccount, applicationpool, farm,
database
Get-SPExcelServiceApplication | select typename, DisplayName, status
#Write-Host ""
Write-Host -ForegroundColor Green "PowerPivot Service Application pool"
Write-Host -ForegroundColor Green ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
# the following assumes there is only 1 PowerPivot Service Application, and returns that applicaitons pool
name. if you have more than one, use the 2nd version
$poolname=[string](Get-PowerPivotServiceApplication | select -property applicationpool)
$position=$poolname.lastindexof("=")
$poolname=$poolname.substring($position+1)
$poolname=$poolname.substring(0,$poolname.length-1)
Get-SPServiceApplicationPool | select name, status, processaccountname, id | where {$_.Name -eq $poolname} |
format-table -property * -autosize | out-default
#Write-Host ""
Write-Host -ForegroundColor Green "PowerPivot and Excel Service Application Proxy"
Write-Host -ForegroundColor Green ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
Get-SPServiceApplicationProxy | select typename, status, unattendedaccount, displayname | where {$_.TypeName -
like "*powerpivot*" -or $_.TypeName -like "*excel services*"} | format-table -property * -autosize | out-
default
#Get-SPServiceApplicationProxy | select typename, status, unattendedaccount, displayname | where {$_.TypeName
-like "*powerpivot*" -or $_.TypeName -like "*Reporting Services*" -or $_.TypeName -like "*excel services*"} |
format-table -property * -autosize | out-default
#Write-Host ""
Write-Host -ForegroundColor Green "DATABASES"
Write-Host -ForegroundColor Green ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
Get-SPDatabase | select name, status, server, typename | where {$_.TypeName -eq "content database" -or
$_.TypeName -like "*Gemini*"} | format-table -property * -autosize | out-default
#Get-SPDatabase | select name, status, server, typename | where {$_.TypeName -eq "content database" -or
$_.TypeName -like "*Gemini*" -or $_.TypeName -like "*ReportingServices*"}
#Write-Host ""
Write-Host -ForegroundColor Green "features"
Write-Host -ForegroundColor Green ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
Get-SPFeature | select displayname, status, scope, farm| where {$_.displayName -like "*powerpivot*"} | format-
table -property * -autosize | out-default
#Get-SPFeature | select displayname, status, scope, farm | where {$_.displayName -like "*powerpivot*" -or
$_.displayName -like "*ReportServer*"} | format-table -property * -autosize | out-default
#Write-Host ""
Write-Host -ForegroundColor Green "Timer Jobs (Job Definitions) -- list is the same as seen in the 'Review
timer job definitions' section of the management dashboard"
Write-Host -ForegroundColor Green ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
Get-SPTimerJob | where {$_.service -like "*power*" -or $_.service -like "*mid*"} | select status, displayname,
LastRunTime, service | format-table -property * -autosize | out-default
#Write-Host ""
Write-Host -ForegroundColor Green "health rules"
Write-Host -ForegroundColor Green ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
Get-SPHealthAnalysisRule | select name, enabled, summary | where {$_.summary -like "*power*"} | format-table -
property * -autosize | out-default
$time=Get-Date
write-host -foregroundcolor DarkGray StartTime $starttime
write-host -foregroundcolor DarkGray EndTime $time
#Write-Host ""
Write-Host -ForegroundColor Green "Windows Event Log data MSSQL$POWERPIVOT and "
Write-Host -ForegroundColor Green "Windows Event Log data MSSQL$POWERPIVOT and "
Write-Host -ForegroundColor Green ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
Get-EventLog "application" | Where-Object {$_.source -like "msolap`$powerpivot*"} |select timegenerated,
entrytype , source, message | format-table -property * -autosize | out-default
#The following is the same command but with the Inforamtion events filtered out.
#Get-EventLog "application" | Where-Object {$_.source -like "msolap`$powerpivot*" -and ($_.entrytype -match
"error" -or $_.entrytype -match "critical" -or $_.entrytype -match "warning")} |select timegenerated,
entrytype , source, message | format-table -property * -autosize | out-default
#Write-Host ""
Write-Host -ForegroundColor Green "ULS Log data"
Write-Host -ForegroundColor Green ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
Get-SPLogEvent -starttime(get-date).addhours(-48) | Where-Object {$_.Area -eq "powerpivot service" -and
$_.level -eq "high"} | select timestamp, area, category, eventid,level, correlation, message| format-table -
property * -autosize | out-default
#the following example filters for the category 'data refresh'
#Get-SPLogEvent -starttime(get-date).addhours(-48) | Where-Object {$_.category -eq "data refresh" -and $_.level
-eq "high"} | select timestamp, area, category, eventid, level, correlation, message
$time=Get-Date
write-host -foregroundcolor DarkGray StartTime $starttime
write-host -foregroundcolor DarkGray EndTime $time
#Write-Host ""
Write-Host -ForegroundColor Green "MSOLAP data provider for Excel Servivces, service application"
Write-Host -ForegroundColor Green ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
$excelApp=Get-SPExcelServiceApplication
get-spexceldataprovider -ExcelServiceApplication $excelApp |select providerid,providertype,description | where
{$_.providerid -like "msolap*" } | format-table -property * -autosize | out-default
#Write-Host ""
Write-Host -ForegroundColor Green "Usage Data Rules"
Write-Host -ForegroundColor Green ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
get-spusagedefinition | select name, status, enabled, tablename, DaysToKeepDetailedData | where {$_.name -like
"powerpivot*"} | format-table -property * -autosize | out-default
$time=Get-Date
write-host -foregroundcolor DarkGray StartTime $starttime
write-host -foregroundcolor DarkGray EndTime $time
Deploying SQL Server 2016 PowerPivot and Power
View in SharePoint 2016
5/16/2018 • 2 minutes to read • Edit Online
Beginning with SQL Server 2017, the Analysis Services build version number and SQL Server Database Engine
build version number do not match. While both Analysis Services and the Database Engine use the same installer,
the build systems each use are separate.
In some cases, it may be necessary to verify if a Cumulative Update (CU ) build package has been applied and
Analysis Services components have been updated. You can verify by comparing the build version numbers of
Analysis Services component files installed on your computer with the build version numbers for a particular CU.
See also
Install SQL Server Servicing Updates
Update Center for Microsoft SQL Server
Post-install Configuration (Analysis Services)
5/16/2018 • 3 minutes to read • Edit Online
Instance Configuration
Analysis Services is a replicable service, meaning you can install multiple instances of the service on a single server.
Each additional instance is installed separately as a named instance, using SQL Server Setup, and configured
independently to support its intended purpose. For example, a development server might run Flight Recorder or
use default values for data storage that you might otherwise change on servers supporting production workloads.
Another example that calls for adjusting system configuration is installing Analysis Services instance on hardware
shared by other services. When hosting multiple data-intensive applications on the same hardware, you might
want to configure server properties that lower the memory thresholds to optimize available resources across all of
the applications.
Post-installation Tasks
LINK TASK DESCRIPTION
Configure the Windows Firewall to Allow Analysis Services Create an inbound rule in Windows Firewall so that requests
Access can be routed through the TCP port used by the Analysis
Services instance. This task is required. No one can access
Analysis Services from a remote computer until an inbound
firewall rule is defined.
Grant server admin rights to an Analysis Services instance During installation, you had to add at least one user account
to the Administrator role of the Analysis Services instance.
Administrative permissions are required for many routine
server operations, such as processing data from external
relational databases. Use the information in this topic to add
or modify the membership of the Administrator role.
Configure antivirus software on computers running SQL You might need to configure scanning software, such as
Server antivirus and antispyware applications, to exclude SQL Server
folders and file types. If scanning software locks a program or
data file when Analysis Services needs to use it, service
disruption or data corruption can occur.
LINK TASK DESCRIPTION
Configure Service Accounts (Analysis Services) During installation, the Analysis Services service account was
provisioned, with appropriate permissions to allow controlled
access to program executables and database files. As a post-
installation task, you should now consider whether to allow
the use of the service account when performing additional
tasks. Both processing and query workloads can be executed
under the service account. These operations succeed only
when the service account has appropriate permissions.
Register an Analysis Services Instance in a Server Group SQL Server Management Studio (SSMS) lets you create server
groups for organizing your SQL Server instances. Scalable
deployments consisting of multiple server instances are easier
to manage in server groups. Use the information in this topic
to organize Analysis Services instances into groups in SSMS.
Determine the Server Mode of an Analysis Services Instance During installation, you chose a server mode that determines
the type of model (multidimensional or tabular) that runs on
the server. If you are unsure of the server mode, use the
information in this topic to determine which mode was
installed.
Rename an Analysis Services Instance A descriptive name can help you distinguish among multiple
instances having different server modes, or among instances
primarily used by departments or teams in your organization.
If you want to change the instance name to one that helps
you better manage your installations, use the information in
this topic to learn how.
Next Steps
Learn how to connect to Analysis Services from Microsoft applications or custom applications using the client
libraries. Depending on your solution requirements, you might also need to configure the service for Kerberos
authentication. Connections that must cross domain boundaries will require HTTP access. See Connect to Analysis
Services for instructions about the next steps.
See Also
Installation for SQL Server 2016
Install Analysis Services in Multidimensional and Data Mining Mode
Install Analysis Services
Install Analysis Services in Power Pivot Mode
Configure the Windows Firewall to Allow Analysis
Services Access
12/10/2018 • 15 minutes to read • Edit Online
NOTE
Different Windows operating systems provide alternative tools for configuring Windows Firewall. Most of these tools let
you choose between opening a specific port or program executable. Unless you have a reason for specifying the program
executable, we recommend that you specify the port.
When specifying an inbound rule, be sure to adopt a naming convention that allows you to easily find the rules
later (for example, SQL Server Analysis Services (TCP -in) 2383).
Windows Firewall with Advanced Security
1. On Windows 7 or Windows Vista, in Control Panel, click System and Security, select Windows
Firewall, and then click Advanced settings. On Windows Server 2008 or 2008 R2, open Administrator
Tools and click Windows Firewall with Advanced Security. On Windows Server 2012, open the
Applications page and type Windows Firewall.
2. Right-click Inbound Rules and select New Rule.
3. In Rule Type, click Port and then click Next.
4. In Protocol and Ports, select TCP and then type 2383 in Specific local ports.
5. In Action, click Allow the connection and then click Next.
6. In Profile, clear any network locations that do not apply and then click Next.
7. In Name, type a descriptive name for this rule (for example, SQL Server Analysis Services (tcp-in)
2383), and then click Finish.
8. To verify that remote connections are enabled, open SQL Server Management Studio or Excel on a
different computer and connect to Analysis Services by specifying the network name of the server in
Server name.
NOTE
Other users will not have access to this server until you grant permissions. For more information, see Authorizing
access to objects and operations (Analysis Services).
netsh advfirewall firewall add rule name="SQL Server Analysis Services inbound on TCP 2383" dir=in
action=allow protocol=TCP localport=2383 profile=domain
NOTE
SQL Server Browser service listens on both UDP port 1434 and TCP port 2382 for the Database Engine and Analysis
Services, respectively. Even if you already unblocked UDP port 1434 for the SQL Server Browser service, you must still
unblock TCP port 2382 for Analysis Services.
netsh advfirewall firewall add rule name="SQL Server Analysis Services (tcp-in) on 54321" dir=in
action=allow protocol=TCP localport=54321 profile=domain
netsh advfirewall firewall add rule name="SQL Server Browser Services inbound on TCP 2382" dir=in
action=allow protocol=TCP localport=2382 profile=domain
See Also
SQL Server Browser Service (Database Engine and SSAS )
Start, Stop, Pause, Resume, Restart the Database Engine, SQL Server Agent, or SQL Server Browser Service
Configure a Windows Firewall for Database Engine Access
Configure Service Accounts (Analysis Services)
9/28/2018 • 13 minutes to read • Edit Online
Increase a process working set This privilege is available to all users by default through the
(SeIncreaseWorkingSetPrivilege) Users security group. If you lock down a server by removing
privileges for this group, Analysis Services might fail to start,
logging this error: "A required privilege is not held by the
client." When this error occurs, restore the privilege to
Analysis Services by granting it to the appropriate Analysis
Services security group.
Adjust memory quotas for a process This privilege is used to request more memory if a process has
(SeIncreaseQuotaPrivilege) insufficient resources to complete its execution, subject to the
memory thresholds established for the instance.
Lock pages in memory (SeLockMemoryPrivilege) This privilege is needed only when paging is turned off
entirely. By default, a tabular server instance uses the
Windows paging file, but you can prevent it from using
Windows paging by setting VertiPaqPagingPolicy to 0.
All file system permissions required for server operations─ including permissions needed for loading and
unloading databases from a designated data folder─ are assigned by SQL Server Setup during installation.
The permission holder on data files, program file executables, configuration files, log files, and temporary files is a
local security group created by SQL Server Setup.
There is one security group created for each instance that you install. The security group is named after the
instance ─ either SQLServerMSASUser$MSSQLSERVER for the default instance, or
SQLServerMSASUser$<servername>$<instancename> for a named instance. Setup provisions this security
group with the file permissions required to perform server operations. If you check the security permissions on
the \MSAS13.MSSQLSERVER\OLAP\BIN directory, you will see that the security group (not the service account
or its per-service SID ) is the permission holder on that directory.
The security group contains one member only: the per-service Security Identifier (SID ) of the Analysis Services
instance startup account. Setup adds the per-service SID to the local security group. The use of a local security
group, with its SID membership, is a small but noticeable difference in how SQL Server Setup provisions Analysis
Services, as compared to the Database Engine.
If you believe that file permissions are corrupted, follow these steps to verify the service is still correctly
provisioned:
1. Use the Service Control command line tool (sc.exe) to obtain the SID of a default service instance.
SC showsid MSSqlServerOlapService
For a named instance (where the instance name is Tabular), use this syntax:
SC showsid MSOlap$Tabular
2. Use Computer Manager | Local Users and Groups | Groups to inspect the membership of the
SQLServerMSASUser$<servername>$<instancename> security group.
The member SID should match the per-service SID from step 1.
3. Use Windows Explorer | Program Files | Microsoft SQL Server | MSASxx.MSSQLServer | OLAP | bin
to verify folder Security properties are granted to the security group in step 2.
NOTE
Never remove or modify a SID. To restore a per-service SID that was inadvertently deleted, see
http://support.microsoft.com/kb/2620201.
Remote access to external relational Create a database login for the service Processing refers to data retrieval from
data sources account an external data source (usually a
relational database), which is
subsequently loaded into an Analysis
Services database. One of the credential
options for retrieving external data is to
use the service account. This credential
option works only if you create a
database login for the service account
and grant read permissions on the
source database. See Set Impersonation
Options (SSAS - Multidimensional) for
more information about how the
service account option is used for this
task. Similarly, if ROLAP is used as the
storage mode, the same impersonation
options are available. In this case, the
account must also have write access to
the source data to process the ROLAP
partitions (that is, to store
aggregations).
SERVER OPERATION WORK ITEM JUSTIFICATION
DirectQuery Create a database login for the service DirectQuery is a tabular feature used to
account query external datasets that are either
too large to fit inside the tabular model
or have other characteristics that make
DirectQuery a better fit than the default
in-memory storage option. One of the
connection options available in
DirectQuery mode is to use the service
account. Once again, this option works
only when the service account has a
database login and read permissions on
the target data source. See Set
Impersonation Options (SSAS -
Multidimensional) for more information
about how the service account option is
used for this task. Alternatively, the
credentials of the current user can be
used to retrieve data. In most cases this
option entails a double-hop connection,
so be sure to configure the service
account for Kerberos constrained
delegation so that the service account
can delegate identities to a downstream
server. For more information, see
Configure Analysis Services for Kerberos
constrained delegation.
Remote access to other SSAS instances Add the service account to Analysis Remote partitions and referencing
Services database roles defined on the linked objects on other remote Analysis
remote server Services instances are both system
capabilities requiring permissions on a
remote computer or device. When a
person creates and populates remote
partitions, or sets up a linked object,
that operation runs in the security
context of the current user. If you
subsequently automate these
operations, Analysis Services will access
remote instances in the security context
of its service account. In order to access
linked objects on a remote instance of
Analysis Services, the logon account
must have permission to read the
appropriate objects on the remote
instance, such as Read access to certain
dimensions. Similarly, using remote
partitions requires that the service
account have administrative rights on
the remote instance. Such permissions
are granted on the remote Analysis
Services instance, using roles that
associate permitted operations with a
specific object. See Grant database
permissions (Analysis Services) for
instructions on how to grant Full
Control permissions that allow
processing and query operations. See
Create and Manage a Remote Partition
(Analysis Services) for more information
about remote partitions.
SERVER OPERATION WORK ITEM JUSTIFICATION
Writeback Add the service account to Analysis When enabled in client applications,
Services database roles defined on the writeback is a feature of
remote server multidimensional models that allows
the creation of new data values during
data analysis. If writeback is enabled
within any dimension or cube, the
Analysis Services service account must
have write permissions to the writeback
table in the source SQL Server relational
database. If this table does not already
exist and needs to be created, the
Analysis Services service account must
also have create table permissions
within the designated SQL Server
database.
Write to a query log table in a SQL Create a database login for the service You can enable query logging to collect
Server relational database account and assign write permissions usage data in a database table for
on the query log table subsequent analysis. The Analysis
Services service account must have
write permissions to the query log table
in the designated SQL Server database.
If this table does not already exist and
needs to be created, the Analysis
Services logon account must also have
create table permissions within the
designated SQL Server database. For
more information, see Improve SQL
Server Analysis Services Performance
with the Usage Based Optimization
Wizard (Blog) and Query Logging in
Analysis Services (Blog).
See Also
Configure Windows Service Accounts and Permissions
SQL Server Service Account and Per-Service SID (Blog)
SQL Server uses a service SID to provide service isolation (KB Article)
Access Token (MSDN )
Security Identifiers (MSDN )
Access Token (Wikipedia)
Access Control Lists (Wikipedia)
Grant server admin rights to an Analysis Services
instance
10/26/2018 • 2 minutes to read • Edit Online
NOTE
Analysis Services provides a progression of increasingly granular roles for processing and querying at server, database, and
object levels. See Roles and Permissions (Analysis Services) for instructions on how to use these roles.
5. In the Enter the object names to select text box, type the name of the computer and click Check
Names to verify the computer account is found in the current Locations. If the computer account is not
found, verify the computer name and the correct domain the computer is a member of.
NT Service\SSASTelemetry account
NT Service/SSASTelemetry is a low -privileged machine account created during setup and used exclusively to
run the Analysis Services implementation of the Customer Experience Improvement Program (CEIP ) service.
This service requires admin rights on the Analysis Services instance to run several discover commands. See
Customer Experience Improvement Program for SQL Server Data Tools and Microsoft SQL Server Privacy
Statement for more information.
See Also
Authorizing access to objects and operations (Analysis Services)
Security Roles (Analysis Services - Multidimensional Data)
Features off by default (Analysis Services)
5/16/2018 • 2 minutes to read • Edit Online
Feature List
To enable the following features, connect to Analysis Services using SQL Server Management Studio. Right-click
the instance name and choose Facets. Alternatively, you can enable these features through server properties, as
described in the next section.
Ad Hoc Data Mining (OpenRowset) Queries
Linked Objects (To)
Linked Objects (From)
Listen Only On Local Connections
User Defined Functions
Server properties
Additional features that are off by default can be enabled through server properties. Connect to Analysis Services
using SQL Server Management Studio. Right-click the instance name and choose Properties. Click General, and
then click Show Advanced to display a larger property list.
Ad Hoc Data Mining (OpenRowset) Queries
Allow Session Mining Models (Data Mining)
Linked Objects (To)
Linked Objects (From)
COM based user-defined functions
Flight Recorder Trace Definitions (templates).
Query logging
Listen Only On Local Connections
Binary XML
Compression
Group affinity. See Thread Pool Properties for details.
Register an Analysis Services Instance in a Server
Group
5/16/2018 • 2 minutes to read • Edit Online
Server groups can be created in a hierarchical structure. Local Server Group is the root node. It always contains
instances of Analysis Services that run on the local computer. You can add remote servers to any group, including
the local group.
After you create a server group, you must use the Registered Servers pane to view and connect to the member
servers. The pane filters SQL Server instances by server type (Database Engine, Analysis Services, Reporting
Services, and Integration Services). You click a server type to view the server groups created for it. To connect to a
specific server within group, you double-click a server in the group.
The connection information that is defined for the server, including the server name, is persisted with server
registration. You cannot modify the connection information, or use the registered name when connecting to the
server using other tools.
Do not change the value of the DeploymentMode property. Changing the property manually after the server
is installed is not supported.
Each mode is exclusive of the other. A server that is configured for tabular mode cannot run Analysis Services
databases that contain cubes and dimensions. If the underlying computer hardware can support it, you can
install multiple instances of Analysis Services on the same computer and configure each instance to use a
different deployment mode. Remember that Analysis Services is a resource intensive application. Deploying
multiple instances on the same system is recommended only for high-end servers.
See Also
Install Analysis Services
Install Analysis Services in Multidimensional and Data Mining Mode
Power Pivot for SharePoint 2010 Installation
Connect to Analysis Services
Tabular Model Solutions
Multidimensional Model Solutions
Mining Models (Analysis Services - Data Mining)
Rename an Analysis Services Instance
11/27/2018 • 2 minutes to read • Edit Online
IMPORTANT
While renaming the instance, the Analysis Services Instance Rename tool runs under elevated privileges, updating the
Windows service name, security accounts, and registry entries associated with that instance. To ensure that these actions are
performed, be sure to run this tool as a local system administrator.
The Analysis Services Instance Rename tool does not modify the program folder that was created for the original
instance. Do not modify the program folder name to match the instance you are renaming. Changing a program
folder name can prevent Setup from repairing or uninstalling the installation.
NOTE
The Analysis Services Instance Rename tool is not supported for use in a cluster environment.
1200 Azure Analysis Services, SQL Server 2017, SQL Server 2016
1103 SQL Server 2017*, SQL Server 2016, SQL Server 2014, SQL
Server 2012 SP1
1100 SQL Server 2017*, SQL Server 2016, SQL Server 2014, SQL
Server 2012 SP1, SQL Server 2012
* 1100 and 1103 compatibility levels are deprecated in SQL Server 2017.
See also
Compatibility Level of a multidimensional database
What's new in Analysis Services
Create a new tabular model project
Tabular model designer
12/7/2018 • 7 minutes to read • Edit Online
Benefits
When you install SQL Server Data Tools (SSDT), new project templates for creating tabular models are added to
the available project types. After creating a new tabular model project by using one of the templates, you can begin
model authoring by using the tabular model designer tools and wizards.
In addition to new templates and tools for authoring professional multidimensional and tabular model solutions,
the Visual Studio environment provides debugging and project lifecycle capabilities that ensure you create the
most powerful BI solutions for your organization. For more information about Visual Studio, see Getting Started
with Visual Studio.
Project templates
When you install SQL Server Data Tools (SSDT), the following tabular model project templates are added to the
Business Intelligence project types:
Analysis Services Tabular Project
This template can be used to create a new, blank tabular model project. Compatibility levels are specified when you
create the project.
Import from Server (Tabular)
This template can be used to create a new tabular model project by extracting the metadata from an existing
tabular model in Analysis Services.
Older models have older compatibility levels. You can upgrade by changing the Compatibility Level property after
importing the model definition.
Import from Power Pivot
This template is used for creating a new tabular model project by extracting the metadata and data from a Power
Pivot for Excel file.
Tabular Model Explorer organizes metadata objects into a tree structure that closely resembles the schema of a
tabular model. Data Sources, Perspectives, Relationships, Roles, Tables, and Translations correspond to top-level
schema objects. There are some exceptions, specifically KPIs and Measures, which technically aren't top-level
objects, but child objects of the various tables in the model. However, having consolidated top-level containers for
all KPIs and Measures makes it easier to work with these objects, especially if your model includes a very large
number of tables. Measures are also listed under their corresponding parent tables, so you have a clear view of the
actual parent-child relationships. If you select a measure in the top-level Measures container, the same measure is
also selected in the child collection under its table, and vice-versa.
Object nodes in Tabular Model Explorer are linked to appropriate menu options that until now were hiding under
the Model, Table, and Column menus in Visual Studio. You can right-click an object to explore options for the
object type. Not all object node types have a context menu yet, but additional options and improvements are
coming in subsequent releases.
Tabular Model Explorer also offers a convenient search feature. Just type in a portion of the name in the Search
box and Tabular Model Explorer narrows down the tree view to the matches.
Properties window
The Properties window lists the properties of the selected object. The following objects have properties that can be
viewed and edited in the Properties window:
Model.bim
Table
Column
Measure
Project properties display only the project name and project folder in the Properties window. Projects also have
additional deployment Options and deployment server settings that you can set using a modal properties dialog
box. To view these properties, in Solution Explorer, right click the project, and then click Properties.
Fields in the Properties window have embedded controls that open when you click them. The type of edit control
depends on the particular property. Controls include edit boxes, dropdown lists, and links to custom dialog boxes.
Properties that are shown as dimmed are read-only.
To view the Properties window, click the View menu, and then click Properties Window.
Error List
The Error List window contains messages about the model state:
Notifications about security best practices.
Requirements for data processing.
Semantic error information for calculated columns, measures, and row filters for roles. For calculated
columns, you can double-click the error message to navigate to the source of the error.
DirectQuery validation errors.
By default, the Error List does not appear unless an error is returned. You can, however, view the Error List
window at any time. To view the Error List window, click the View menu, and then click Error List.
Output
Build and deployment information is displayed in the Output Window (in addition to the modal progress dialog).
To view the Output window, click the View menu, and then click Output.
Menu items
When you install SQL Server Data Tools (SSDT), additional menu items specifically for authoring tabular models
are added to the Visual Studio menu bar. The Model menu can be used to launch the Data Import Wizard, view
existing connections, process workspace data, and browse the model workspace in Microsoft Excel. The Table
menu is used to create and manage relationships between tables, create and manage measures, specify data table
settings, specify calculation options, and specify other table properties. With the Column menu, you can add and
delete columns in a table, hide and unhide columns, and specify other column properties such as data types and
filters. You can build and deploy tabular model solutions on the Build menu. Copy/Paste functions are included on
the Edit menu.
In addition to these menu items, additional settings are added to the Analysis Services options on the Tools menu
items.
Toolbar
The Analysis Services toolbar provides quick and easy access to the most frequently used model authoring
commands.
See also
Tabular Model Projects
Workspace database
12/7/2018 • 8 minutes to read • Edit Online
NOTE
When using Integrated workspace mode, the local Analysis Services instance is 64-bit, while SSDT runs in the 32-bit
environment of Visual Studio. If you're connecting to special data sources, make sure you install both the 32-bit and 64-bit
versions of the corresponding data providers on your workstation. The 64-bit provider is required for the 64-bit Analysis
Services instance and the 32-bit version is required for the Table Import Wizard in SSDT.
Workspace server
A workspace database is created on the Analysis Services instance, specified in the Workspace Server property,
when you create a new Business Intelligence project by using one of the tabular model project templates in SQL
Server Data Tools. Each tabular model project will have its own workspace database. You can use SQL Server
Management Studio to view the workspace database on the Analysis Services server. The workspace database
name includes the project name, followed by an underscore, followed by the username, followed by an
underscore, followed by a GUID.
The workspace database resides in-memory while the tabular model project is open in SQL Server Data Tools.
When you close the project, the workspace database is either kept in-memory, stored to disk and removed from
memory (default), or removed from memory and not stored on disk, as determined by the Workspace Retention
property. For more information about the Workspace Retention property, see Workspace Database Properties
later in this topic.
After you've added data to your model project by using the Table Import Wizard or by using copy/paste, when you
view the tables, columns, and data in the model designer, you are viewing the workspace database. If you add
additional tables, columns, relationships, etc. you are changing the workspace database.
When you deploy a tabular model project, the deployed model database, which is essentially a copy of the
workspace database, is created on the Analysis Services server instance specified in the Deployment Server
property. For more information about the Deployment Server property, see Project properties.
The model workspace database typically resides on localhost or a local named instance of an Analysis Services
server. You can use a remote instance of Analysis Services to host the workspace database, however, this
configuration is not recommended due to latency during data queries and other restrictions. Optimally, the
instance of Analysis Services that will host the workspace databases is on the same computer as SQL Server Data
Tools. Authoring model projects on the same computer as the Analysis Services instance that hosts the workspace
database can improve performance.
Remote workspace databases have the following restrictions:
Potential latency during queries.
The Data Backup property cannot be set to Backup to disk.
You cannot import data from a Power Pivot workbook when creating a new tabular model project by using
the Import from Power Pivot project template.
IMPORTANT
The model's compatibility level and the Workspace Server must correspond.
NOTE
If any of the tables in your model will contain a large number of rows, consider importing only a subset of the data during
model authoring. By importing a subset of the data, you can reduce processing time and consumption of workspace
database server resources.
NOTE
The preview window in the Select Tables and Views page in the Table Import Wizard, Edit Table Properties dialog box, and
Partition Manager dialog box show tables, columns, and rows at the data source, and may not show the same tables,
columns, and rows as the workspace database.
NOTE
Integrated Workspace Mode, Workspace Server, Workspace Retention, and Data Backup properties have default
settings applied when you create a new model project. You can change the default settings for new model projects on the
Data Modeling page in Analysis Server settings in the Tools\Options dialog box. These properties, as well as others, can
also be set for each model project in the Properties window. Changing default settings will not apply to model projects
already created. For more information, see Configure default data modeling and deployment properties.
PROPERTY DEFAULT SETTING DESCRIPTION
See also
Model properties
Tabular Model Projects
12/7/2018 • 2 minutes to read • Edit Online
Related Tasks
TOPIC DESCRIPTION
Create a New Tabular Model Project (Analysis Services) This article describes how to create a new, blank tabular model
project.
Import from Analysis Services This article describes how to create a new tabular model
project based on an existing model already in Analysis
Services. Metadata from the existing model is extracted and
used to create the new model.
Import from Power Pivot This article describes how to create a new tabular model
project by extracting the metadata and data from a Power
Pivot for Excel file (.xlsx).
Create a new tabular model project
5/16/2018 • 2 minutes to read • Edit Online
See Also
Project properties
Model properties
Import from Analysis Services
5/16/2018 • 2 minutes to read • Edit Online
See Also
Project properties
Import from Power Pivot
12/7/2018 • 2 minutes to read • Edit Online
Create a new Tabular Model from a Power Pivot for Excel file
When creating a new tabular model project by importing from a Power Pivot workbook, the metadata that defines
the structure of the workbook is used to create and define the structure of the tabular model project in SQL Server
Data Tools. Objects such as tables, columns, measures, and relationships are retained and will appear in the tabular
model project as they are in the Power Pivot workbook. No changes are made to the .xlsx workbook file.
NOTE
Tabular models do not support linked tables. When importing from a Power Pivot workbook that contains a linked table,
linked table data is treated as copy\pasted data and stored in the Model.bim file. When viewing properties for a copy\pasted
table, the Source Data property is disabled and the Table Properties dialog on the Table menu is disabled.
There is a limit of 10,000 rows that can be added to the data embedded in the model. If you import a model from Power
Pivot and see the error, "Data was truncated. Pasted tables cannot contain more than 10000 rows" you should revise the
Power Pivot model by moving the embedded data into another data source, such as a table in SQL Server, and then re-
import.
There are special considerations depending on whether or not the workspace database is on an Analysis Services
instance on the same computer (local) as SQL Server Data Tools (SSDT) or is on a remote Analysis Services
instance..
If the workspace database is on a local instance of Analysis Services, you can import both the metadata and data
from the Power Pivot workbook. The metadata is copied from the workbook and used to create the tabular model
project. The data is then copied from the workbook and stored in the project's workspace database (except for
copy/pasted data, which is stored in the Model.bim file).
If the workspace database is on a remote Analysis Services instance, you cannot import data from a Power Pivot
for Excel workbook. You can still import the workbook metadata; however, this will cause a script to be run on the
remote Analysis Services instance. You should only import metadata from a trusted Power Pivot workbook. Data
must be imported from sources defined in the data source connections. Copy/pasted and linked table data in the
Power Pivot workbook must be copied and pasted into the tabular model project.
To create a new tabular model project from a Power Pivot for Excel file
1. In SQL Server Data Tools, on the File menu, click New, and then click Project.
2. In the New Project dialog box, under Installed Templates, click Business Intelligence, and then click
Import from Power Pivot.
3. In Name, type a name for the project, then specify a location and solution name, and then click OK.
4. In the Open dialog box, select the Power Pivot for Excel file that contains the model metadata and data you
want to import, and then click Open.
See Also
Workspace Database
Copy and Paste Data
Power View - Reporting Properties
12/7/2018 • 2 minutes to read • Edit Online
Related Tasks
TOPIC DESCRIPTION
Configure Default Field Set for Power View Reports Describes how to configure a Default Field Set; a predefined
list of columns and measures that are automatically added to
a Power View report canvas when the table is selected in the
report field list.
Configure Table Behavior Properties for Power View Reports Describes how to configure table behavior properties that
expose detail rows at a more granular level. Setting table
behavior properties changes the grouping behavior of detail
rows and produces a better default placement of identifying
information in tile, card, and chart layouts.
Power View - Configure Default Field Set for Reports
12/7/2018 • 2 minutes to read • Edit Online
NOTE
A default field set applies only to a tabular model used as a data model in Power View. Default field sets are not supported in
Excel pivot reports.
Next Step
After you create a default field set, you can further influence the report design experience by specifying default
labels, default images, default group behavior, or whether rows that contain the same value are grouped together
in one row or listed individually. For more information, see Configure Table Behavior Properties for Power View
Reports.
Power View - Configure Table Behavior Properties for
Reports
12/7/2018 • 9 minutes to read • Edit Online
NOTE
Table behavior properties only affect tabular models used as data models in Power View. Table behavior properties are not
supported in Excel pivot reports.
NOTE
Refer to the following section to approach layout optimizations from the standpoint of a particular presentation format:
Optimizing for Specific Layouts.
NOTE
Images can be sourced from URL addresses to an image file on a web server, or as binary data embedded in the workbook.
If the image is based on a URL, be sure to also set the column as an image type so that Power View retrieves the image
rather than displaying the URL as text data in the report.
To change the default grouping behavior, set the Row Identifier and Keep Unique Rows properties. In Keep
Unique Rows, choose the Last Name column so this value is repeated for a row, even if it already appears in a
different row. After you change the properties and republish the workbook, you can create the same report, only
this time you will see both customers named Jon Yang, with the Annual Income correctly allocated to each one.
Next Steps
After you have evaluated the tables in your model and set table behavior properties on those containing detail
rows that should always appear as individual items, you can further optimize the model through additional
properties or settings.
Project properties
12/7/2018 • 3 minutes to read • Edit Online
Project properties
Deployment Options
Deployment Server
DirectQuery Options
See Also
Configure default data modeling and deployment properties
Model properties
Tabular model solution deployment
Model properties
12/7/2018 • 5 minutes to read • Edit Online
Model properties
Advanced
Copy to Output Directory Do Not Copy This property specifies the source file
will be copied to the output directory.
This property setting has the following
options:
Miscellaneous
NOTE
Some properties are set automatically when the model is created and cannot be changed.
NOTE
Workspace Server, Workspace Retention, and Data Backup properties have default settings applied when you create a new
model project. You can change the default settings for new models on the Data Modeling page in Analysis Server settings in
the Tools\Options dialog box. These properties, as well as others, can also be set for each model in the Properties window.
For more information, see Configure default data modeling and deployment properties.
Collation Default collation for the computer for The collation designator for the model.
which Visual Studio is installed.
Compatibility Level Default or other selected when creating Applies to SQL Server 2012 Analysis
the project. Services SP1 or later. Specifies the
features and settings available for this
model. For more information, see
Compatibility Level for Tabular models
in Analysis Services.
Default filter direction Single direction Determines the default filter direction
for new relationships.
File Name Model.bim Specifies the name of the .bim file. The
file name should not be changed.
Full Path Path specified when the project was The model.bim file location. This
created. property cannot be set in the
Properties window.
PROPERTY DEFAULT SETTING DESCRIPTION
Workspace Database The project name, followed by an The name of the workspace database
underscore, followed by a GUID. used for storing and editing the in-
memory model for the selected
model.bim file. This database will
appear in the Analysis Services instance
specified in the Workspace Server
property. This property cannot be set
in the Properties window. For more
information, see Workspace Database.
PROPERTY DEFAULT SETTING DESCRIPTION
See Also
Configure default data modeling and deployment properties
Project properties
Table Properties
12/7/2018 • 2 minutes to read • Edit Online
Table Properties
Basic
Table Name <friendly name> Specifies the table's friendly name. The
table name can be specified when a
table is imported using the Table Import
Wizard or at any time after import. The
table name in the model can be
different from the associated table at
the source. The table friendly name
appears in the reporting client
application field list as well as in the
model database in SQL Server
Management Studio.
Reporting Properties
For detailed descriptions and configuration information for reporting properties, see Power View reporting
properties.
Table Behavior
NOTE
Some properties are not supported in all compatibility levels.
Column properties
Advanced
Basic
Data Format Automatically determined during Specifies the display format to use for
import. the data in this column. This property
has the following options:
General
Decimal Number
Whole Number
Currency
Percentage
Scientific
Data Type Automatically determined during Specifies the data type for all values in
import. the column.
Misc.
Reporting Properties
Image URL/Data Category (SP1) False Specifies the value in this column as a
hyperlink to an image on a server. For
example:
http://localhost/images/image1.jpg
.
Table Detail Position No Default Field Set Specifies this column or measure can be
added to a set of fields from a single
table to enhance the table visualization
experience in a reporting client.
See also
Power View reporting properties
Hide or freeze columns
Add columns to a table
Configure default data modeling and deployment
properties
12/7/2018 • 4 minutes to read • Edit Online
Default compatibility level for SQL Server 2016 (1200) This setting specifies the default
new projects compatibility level to use when
creating a new Tabular model
project. You can choose SQL Server
2012 (1100) if you will deploy to an
Analysis Services instance without
SP1 applied, or SQL Server 2012 SP1
or later if your deployment instance
has SP1 applied. For more
information, see Compatibility Level
for Tabular models in Analysis
Services.
To configure the default deployment server property setting for new model projects
1. In SQL Server Data Tools (SSDT), click the Tools menu, and then click Options.
2. In the Options dialog box, expand Analysis Services Tabular Designers, and then click Deployment.
3. Configure the following property settings:
NOTE
Changes to the Default deployment Server property setting will not affect existing projects created prior to the
change.
To configure the default Workspace Database property settings for new model projects
1. In SQL Server Data Tools (SSDT), click the Tools menu, and then click Options.
2. In the Options dialog box, expand Analysis Services Tabular Designers, and then click Workspace
Database.
3. Configure the following property settings:
Workspace database retention Keep workspace databases on Specifies how a workspace database
after the model is closed disk, but unload from memory is retained after a model is closed. A
workspace database includes model
metadata, the data imported into a
model, and impersonation
credentials (encrypted). In some
cases, the workspace database can
be very large and consume a
significant amount of memory. By
default, workspace databases are
removed from memory. When
changing this setting, it is important
to consider your available memory
resources as well as how often you
plan to work on the model. This
property setting has the following
options:
Data backup Keep backup of data on disk Specifies whether or not a backup of
the model data is kept in a backup
file. This property setting has the
following options:
NOTE
Changes to default model properties will not affect properties for existing models created prior to the change.
See also
Project properties
Model properties
Compatibility level
Data sources supported in SQL Server Analysis
Services tabular 1400 models
2/12/2019 • 2 minutes to read • Edit Online
APPLIES TO: SQL Server 2017 Analysis Services Azure Analysis Services
This article describes the types of data sources that can be used with SQL Server Analysis Services (SSAS ) tabular
models at the 1400 compatibility level.
For SSAS tabular models at the 1200 and lower compatibility levels, see Data sources supported in SQL Server
Analysis Services tabular 1200 models.
For Azure Analysis Services, see Data sources supported in Azure Analysis Services.
SQL Server Data Warehouse SQL Server Native Client .NET Framework Data
11.0, Microsoft OLE DB Provider for SQL Server
Provider for SQL Server, .NET
Framework Data Provider for
SQL Server
NOTE
For in-memory models, OLE DB providers can provide better performance for large-scale data. When choosing between
different providers for the same data source, try the OLE DB provider first.
Access Database
JSON document
MySQL Database
Excel workbook
Folder
JSON
Text/CSV
XML table
ONLINE SERVICES
Dynamics 365
Exhange Online
Saleforce Objects
Salesforce Reports
OTHER
Active Directory
Exhange
OData Feed
ODBC query
OLE DB
SharePoint list
See also
Data sources supported in SQL Server Analysis Services tabular 1200 models
Data sources supported in Azure Analysis Services
Data sources supported in SQL Server Analysis
Services tabular 1200 models
11/7/2018 • 4 minutes to read • Edit Online
Access databases Microsoft Access 2010 and .accdb or .mdb ACE 14 OLE DB provider 1
later.
SQL Server relational SQL Server 2008 and later, (not applicable) OLE DB Provider for SQL
databases SQL Server Data Warehouse Server
2008 and later, Azure SQL
Database, Azure SQL Data SQL Server Native Client
Warehouse, Analytics OLE DB Provider
Platform System (APS)
SQL Server Native 10.0
Client OLE DB Provider
OraOLEDB
MSDASQL
Teradata relational Teradata V2R6 and later (not applicable) TDOLEDB OLE DB provider
databases
.Net Data Provider for
Teradata
Other relational databases (not applicable) (not applicable) OLE DB provider or ODBC
driver
Text files (not applicable) .txt, .tab, .csv ACE 14 OLE DB provider 1
Microsoft Excel files Excel 2010 and later .xlsx, xlsm, .xlsb, .xltx, .xltm ACE 14 OLE DB provider 1
Power Pivot workbook Microsoft SQL Server 2008 xlsx, xlsm, .xlsb, .xltx, .xltm ASOLEDB 10.5
and later Analysis Services
(used only with Power Pivot
workbooks that are
published to SharePoint
farms that have Power Pivot
for SharePoint installed)
Analysis Services cube Microsoft SQL Server 2008 (not applicable) ASOLEDB 10
and later Analysis Services
Data feeds Atom 1.0 format .atomsvc for a service Microsoft Data Feed
document that defines one Provider for Power Pivot
(used to import data from Any database or document or more feeds
Reporting Services reports, that is exposed as a .NET Framework data feed
Atom service documents, Windows Communication .atom for an Atom web feed data provider for Power
Microsoft Azure Foundation (WCF) Data document Pivot
Marketplace DataMarket, Service (formerly ADO.NET
and single data feed) Data Services).
Microsoft SQL Server 2008 and later OLE DB Provider for SQL Server, SQL
Server Native Client OLE DB Provider,
.NET Framework Data Provider for SQL
Client
Microsoft Azure SQL Database All OLE DB Provider for SQL Server, SQL
Server Native Client OLE DB Provider,
.NET Framework Data Provider for SQL
Client
Microsoft Azure SQL Data Warehouse All SQL Server Native Client OLE DB
Provider, .NET Framework Data
Provider for SQL Client
Microsoft SQL Analytics Platform All OLE DB Provider for SQL Server, SQL
System (APS) Server Native Client OLE DB Provider,
.NET Framework Data Provider for SQL
Client
Teradata relational databases Teradata V2R6 and later .Net Data Provider for Teradata
See also
Data sources supported in SQL Server Analysis Services tabular 1400 models
Data sources supported in Azure Analysis Services
Data types supported in tabular models
11/27/2018 • 6 minutes to read • Edit Online
Whole Number A 64 bit (eight-bytes) integer value* Numbers that have no decimal places.
Integers can be positive or negative
Note: numbers, but must be whole numbers
DAX formulas do not support data between -9,223,372,036,854,775,808
types that are too small to hold the (-2^63) and
minimum value listed in the description. 9,223,372,036,854,775,807 (2^63-1).
Decimal Number A 64 bit (eight-bytes) real number* Real numbers are numbers that can
have decimal places. Real numbers
Note: cover a wide range of values:
DAX formulas do not support data
types that are too small to hold the Negative values from -1.79E +308
minimum value listed in the description. through -2.23E -308
Zero
* If you attempt to import data that has large numeric values, import might fail with the following error:
In-memory database error: The '<column name>' column of the '<table name>' table contains a value,
'1.7976931348623157e+308', which is not supported. The operation has been canceled.
This error occurs because the model designer uses that value to represent nulls. The values in the following list are
synonyms to the previous mentioned null value:
Value
9223372036854775807
-9223372036854775808
1.7976931348623158e+308
2.2250738585072014e-308
Remove the value from your data and try importing again.
NOTE
You cannot import from a varchar(max) column that contains a string length of more than 131,072 characters.
NOTE
Text data types are not included in these tables. When a number is represented as in a text format, in some cases, the model
designer attempts to determine the number type and represent it as a number.
Addition (+)
For example, if a real number is used in an addition operation in combination with currency data, both values are
converted to REAL, and the result is returned as REAL.
Subtraction (-)
In the following table, the row header is the minuend (left side) and the column header is the subtrahend (right
side):
For example, if a date is used in a subtraction operation with any other data type, both values are converted to
dates, and the return value is also a date.
NOTE
Tabular models also support the unary operator, - (negative), but this operator does not change the data type of the
operand.
Multiplication (*)
For example, if an integer is combined with a real number in a multiplication operation, both numbers are
converted to real numbers, and the return value is also REAL.
Division (/)
In the following table the row header is the numerator and the column header is the denominator.
(Row/Column)
For example, if an integer is combined with a currency value in a division operation, both values are converted to
real numbers, and the result is also a real number.
Comparison operators
Only a limited set of mixed data-type combinations for comparison operations is supported. To learn more, see
DAX Operator Reference.
Handling of blanks, empty strings, and zero values
The following table summarizes the differences between DAX and in Microsoft Excel, in the way that blanks are
handled:
BLANK +5 5 5
For details on how a particular function or operator handles blanks, see the individual topics for each DAX
function, in the section, DAX Function Reference.
Impersonation
2/26/2019 • 5 minutes to read • Edit Online
Configuring impersonation
Where, and in what context a model exists determines how impersonation information is configured. When
creating a new model project, impersonation is configured in SQL Server Data Tools (SSDT) when you connect to
a data source to import data. Once a model is deployed, impersonation can be configured in a model database
connection string property by using SQL Server Management Studio (SSMS ). For tabular models in Azure
Analysis Services, you can use SSMS or the View as: Script mode in the browser-based designer to edit the
Model.bim file in JSON.
IMPORTANT
When authoring a model, ensure the credentials you are signed in with and the credentials specified for impersonation have
sufficient rights to fetch the data from the datasource.
Options
When configuring impersonation, or when editing properties for an existing datasource connection, specify one of
the following options:
Tabular 1400 and higher models
OPTION DESCRIPTION
Impersonate Account Specifies the model use a Windows user account to import or
process data from the datasource. The domain and name of
the user account uses the following format:<Domain
name>\<User account name>.
Impersonate Current User Specifies data should be accessed from the datasource using
the identity of the user who sent the request. This setting
applies only to DirectQuery mode.
Impersonate Service Account Specifies the model use the security credentials associated
with the Analysis Services service instance that manages the
model.
Impersonate Unattended Account Specifies the Analysis Services engine should use a pre-
configured unattended account to access the data.
IMPORTANT
Impersonate Current User is not supported in some environments. Impersonate Current User is not supported for tabular
models deployed to Azure Analysis Services that connect to on-premises data sources. Because an Azure Analysis Services
server resource is not connected to an organization's domain, client credentials cannot be authenticated against a data
source server in that domain. Azure Analysis Services also does not currently integrate with (Azure) SQL Database support
for single sign-on (SSO). Depending on your environment, other impersonation settings also have restrictions. When
attempting to use an impersonation setting that is not supported, an error is returned.
Tabular 1200 models
OPTION DESCRIPTION
Specific Windows user name and password This option specifies the model use a Windows user account
to import or process data from the datasource. The domain
and name of the user account uses the following
format:<Domain name>\<User account name>. When
creating a new model using the Table Import Wizard, this
setting is the default option.
Service Account This option specifies the model use the security credentials
associated with the Analysis Services service instance that
manages the model.
Security
Credentials used with impersonation are persisted in-memory by the VertiPaq™ engine. Credentials are never
written to disk. If the workspace database is not in-memory when the model is deployed, the user is prompted to
enter the credentials used to connect to the datasource and fetch data.
NOTE
It is recommended you specify a Windows user account and password for impersonation credentials. A Windows user
account can be configured to use least privileges necessary to connect to and read data from the datasource.
See also
DirectQuery mode
Tabular model solution deployment
Import data by using a native query
11/28/2018 • 2 minutes to read • Edit Online
APPLIES TO: SQL Server Analysis Services (starting with 2017) Azure Analysis Services
For tabular 1400 models, the new Get Data experience in Visual Studio Analysis Services projects provides
immense flexibility in how you can mashup your data during import. This article describes creating a connection to
a datasource and then creating a native SQL query to specify data import.
In order to complete the tasks described in this article, make sure you're using the latest version of SSDT. If you're
using Visual Studio 2017, make sure you've downloaded and installed the September 2017 or later Microsoft
Analysis Services Projects VSIX.
Download and install SSDT
Download Microsoft Analysis Services Projects VSIX
4. To create a table, in Queries, right-click the query, and then select Create New Table. The new table will have
the same name as the query.
Example
This native query creates an Employee table in the model that includes all columns from the Dimension.Employee
table at the datasource.
See also
Value.NativeQuery
Impersonation
DirectQuery mode
12/7/2018 • 5 minutes to read • Edit Online
Benefits
By default, tabular models use an in-memory cache to store and query data. When tabular models query data
residing in-memory, even complex queries can be incredibly fast. However, there are some limitations to using
cached data. Namely, large data sets can exceed available memory, and data freshness requirements can be
difficult if not impossible to achieve on a regular processing schedule.
DirectQuery overcomes these limitations while also leveraging RDBMS features making query execution more
efficient. With DirectQuery:
Data is up-to-date, and there is no extra management overhead of having to maintain a separate copy of
the data (in the in-memory cache). Changes to the underlying source data can be immediately reflected in
queries against the data model.
Datasets can be larger than the memory capacity of an Analysis Services server.
DirectQuery can take advantage of provider-side query acceleration, such as that provided by memory
optimized column indexes.
Security can be enforced by the back-end database , using row -level security features from the database
(alternatively, you can use row -level security in the model via DAX).
If the model contains complex formulas that might require multiple queries, Analysis Services can
perform optimization to ensure that the query plan for the query executed against the back-end database
will be as efficient as possible.
Restrictions
Tabular models in DirectQuery mode have some restrictions. Before switching modes, it's important to
determine whether the advantages of query execution on the backend server outweigh any reduction in
functionality.
If you change the mode of an existing model in SQL Server Data Tools, the model designer will notify you of any
features in your model that are incompatible with DirectQuery mode.
The following list summarizes the main feature restrictions to keep in mind:
Query limits Default row limit is one million rows, which you can increase
by specifying MaxIntermediateRowSize in the msmdsrv.ini
file. See DAX Properties for details.
Formula consistency In certain cases, the same formula can return different results
in a cached model compared to a DirectQuery model that
uses only the relational data store. These differences are a
consequence of the semantic differences between the in-
memory analytics engine and SQL Server.
No user-defined hierarchies.
Microsoft SQL Server 2008 and later OLE DB Provider for SQL Server, SQL
Server Native Client OLE DB Provider,
.NET Framework Data Provider for SQL
Client
Microsoft Azure SQL Database All OLE DB Provider for SQL Server, SQL
Server Native Client OLE DB Provider,
.NET Framework Data Provider for SQL
Client
Microsoft Azure SQL Data Warehouse All .NET Framework Data Provider for SQL
Client
Microsoft SQL Analytics Platform All OLE DB Provider for SQL Server, SQL
System (APS) Server Native Client OLE DB Provider,
.NET Framework Data Provider for SQL
Client
Teradata relational databases Teradata V2R6 and later .Net Data Provider for Teradata
If your model already has a connection to a data source and existing data, you'll be prompted to enter database
credentials used to connect to the relational database. Any data already existing within the model will be removed
from the in-memory cache.
If your model is partially or fully complete prior ti enabling DirectQuery mode, you might get errors about
incompatible features. In Visual Studio, open the Error List and resolve any problems that would prevent the
model from being switched to DirectQuery mode.
What's next?
You can now import data using the Table Import Wizard to get metadata for the model. You won't get rows of data,
but you will get tables, columns, and relationships to use as the basis for your model.
You can create a sample partition for each table and add sample data so that you can verify model behavior as you
build it. Any sample data that you add is used in Analyze for Excel or in other client tools that can connect to the
workspace database. See Add sample data to a DirectQuery model in design mode for details.
TIP
Even in DirectQuery mode on an empty model, you can always view a small built-in rowset for each table. In SQL Server Data
Tools, click Table > Table Properties to view the 50-row dataset.
See also
Enable DirectQuery mode in SSMS
Add sample data to a DirectQuery model in design mode
Enable DirectQuery mode in SSMS
12/7/2018 • 6 minutes to read • Edit Online
IMPORTANT
We recommend using SQL Server Data Tools instead of Management Studio to switch data storage modes. When you use
SQL Server Data Tools to change model, and then follow that up with deployment to the server, the model and database
stay in sync. Moreover, changing the storage modes in the model lets you review any validation errors that occur. When
using SQL Server Management Studio as described in this article, validation errors are not reported.
Requirements
Enabling the use of Direct Query mode on a tabular model is a multistep process:
Ensure that the model does not have features which might cause validation errors in DirectQuery mode,
and then change the data storage mode on the model from in-memory to DirectQuery.
A list of feature restrictions is documented in DirectQuery Mode.
Review the connection string and credentials used by the deployed database to retrieve data from the
backend external database. Make sure there is only one connection, and that its settings are suitable for
query execution.
Tabular databases that weren't specifically designed for DirectQuery could have multiple connections which
now need to be reduced to one, as required for DirectQuery mode.
Credentials originally used for processing data will now be used to query data. As part of DirectQuery
configuration, review and possibly change the account if you use different ones for dedicated operations.
DirectQuery mode is the only scenario in which Analysis Services does trusted delegation. If your solution
calls for delegation to get user-specific query results, the account used to connect to the backend database
must be allowed to delegate the identity of the user making the request, and user identities must have Read
permissions on the backend database.
As a last step, confirm that DirectQuery mode is operational through query execution.
When you change a tabular model to DirectQuery mode, the new data storage mode takes effect immediately.
3. In the trace, you should see evidence of query execution on the relational database.
See also
Compatibility level
Data sources supported
Extended events
Add sample data to a DirectQuery model in Design
Mode
12/7/2018 • 2 minutes to read • Edit Online
TIP
Even in DirectQuery mode on an empty model, you can always view a small built-in rowset for each table. In SQL Server
Data Tools, click Table > Table Properties to view the 50-row dataset.
4. Select the copied partition and then click the SQL Query Editor button to add a filter. Reduce your sample
data size while authoring your model. For example, if you selected FactInternetSales from
AdventureWorksDW, your filter might look like the following:
NOTE
Although a table can have multiple partitions, in DirectQuery mode, only one of them can be designated for use in query
execution. The single partition requirement applies to DirectQuery models at all compatibility levels.
DirectQuery Never process this partition When the model is using DirectQuery
only, processing is never necessary.
DataView=Sample Allow partition to be processed If the model is using sample data, you
can process the table to return a filtered
Applies to Tabular models using sample dataset that provides visual cues during
data views model design.
CONNECTION STRING PROPERTY PROCESSING OPTION PROPERTY NOTES
DirectQueryUsage=InMemory With Allow partition to be processed If the model is using hybrid mode, you
DirectQuery should use the same partition for
queries against the in-memory and
Applies to Tabular 1100 or 1103 DirectQuery data source.
models running in a combination of in-
memory and DirectQuery mode
See also
Partitions
Test a model in DirectQuery mode
12/7/2018 • 2 minutes to read • Edit Online
Test in Excel
When designing your model in SSDT, you can use the Analyze in Excel feature to test your modeling decisions
against a sample dataset in-memory, or against the relational database. When you click Analyze in Excel, a dialog
box opens where you can specify options.
If your model's DirectQuery mode is on, you can specify DirectQuery connection mode, where you'll have two
options:
Sample data view - With this option, any queries from Excel are directed to sample partitions containing a
sample dataset in-memory. This option is helpful when you want to make sure any DAX formulas you have
in measures, calculated columns, or row -level security perform correctly.
Full data view - With this option, any queries from Excel are sent to Analysis Services, and then on to the
relational database. This option is, in-effect, fully functioning DirecQuery mode.
Other clients
When you use Analyze in Excel, an .odc connection file is created. You can use the connection string information
from this file to connect to your model from other client applications. An additional parameter, DataView=Sample,
is added to specify the client should connect to sample data partitions.
SUPPORTED IN ALL DAX FORMULAS SUPPORTED IN MEASURE AND QUERY FORMULAS ONLY
ABS ALL
ACOS ALLEXCEPT
ACOT ALLNOBLANKROW
AND ALLSELECTED
ASIN AVERAGE
ATAN AVERAGEA
BLANK AVERAGEX
CEILING CALCULATE
CONCATENATE CALCULATETABLE
COS COUNT
COT COUNTA
CURRENCY COUNTAX
DATE COUNTROWS
DATEDIFF COUNTX
DATEVALUE DISTINCT
DAY DISTINCTCOUNT
DEGREES FILTER
DIVIDE FILTERS
EDATE HASONEFILTER
EOMONTH HASONEVALUE
EXACT ISCROSSFILTERED
EXP ISFILTERED
FALSE MAXA
FIND MAXX
HOUR MIN
IF MINA
INT MINX
ISBLANK RELATEDTABLE
ISO.CEILING STDEV.P
KEEPFILTERS STDEV.S
LEFT STDEVX.P
SUPPORTED IN ALL DAX FORMULAS SUPPORTED IN MEASURE AND QUERY FORMULAS ONLY
LEN STDEVX.S
LN SUM
LOG SUMX
LOG10 VALUES
LOWER VAR.P
MAX VAR.S
MID VARX.P
MIN VARX.S
MINUTE
MOD
MONTH
MROUND
NOT
NOW
OR
PI
POWER
QUOTIENT
RADIANS
RAND
RELATED
REPT
RIGHT
ROUND
ROUNDDOWN
ROUNDUP
SEARCH
SECOND
SIGN
SIN
SQRT
SQRTPI
SUBSTITUTE
SWITCH
TAN
TIME
TIMEVALUE
TODAY
TRIM
TRUE
TRUNC
UNICODE
UPPER
USERNAME
USERELATIONSHIP
VALUE
WEEKDAY
WEEKNUM
YEAR
Semantic differences
This section lists the types of semantic differences that you can expect, and describes any limitations that might
apply to the usage of functions or to query results.
Comparisons
DAX in in-memory models support comparisons of two expressions that resolve to scalar values of different data
types. However, models that are deployed in DirectQuery mode use the data types and comparison operators of
the relational engine, and therefore might return different results.
The following comparisons will always return an error when used in a calculation on a DirectQuery data source:
Numeric data type compared to any string data type
Numeric data type compared to a Boolean value
Any string data type compared to a Boolean value
In general, DAX is more forgiving of data type mismatches in in-memory models and will attempt an implicit cast
of values up to two times, as described in this section. However, formulas sent to a relational data store in
DirectQuery mode are evaluated more strictly, following the rules of the relational engine, and are more likely to
fail.
Comparisons of strings and numbers
EXAMPLE: "2" < 3
The formula compares a text string to a number. The expression is true in both DirectQuery mode and in-memory
models.
In an in-memory model, the result is true because numbers as strings are implicitly cast to a numerical data type
for comparisons with other numbers. SQL also implicitly casts text numbers as numbers for comparison to
numerical data types.
Note that this represents a change in behavior from the first version of Power Pivot, which would return false,
because the text "2" would always be considered larger than any number.
Comparison of text with Boolean
EXAMPLE: "VERDADERO" = TRUE
This expression compares a text string with a Boolean value. In general, for DirectQuery or In-Memory models,
comparing a string value to a Boolean value results in an error. The only exceptions to the rule are when the string
contains the word true or the word false; if the string contains any of true or false values, a conversion to Boolean
is made and the comparison takes place giving the logical result.
Comparison of nulls
EXAMPLE: EVALUATE ROW("X", BLANK() = BLANK())
This formula compares the SQL equivalent of a null to a null. It returns true in in-memory and DirectQuery
models; a provision is made in DirectQuery model to guarantee similar behavior to in-memory model.
Note that in Transact-SQL, a null is never equal to a null. However, in DAX, a blank is equal to another blank. This
behavior is the same for all in-memory models. It is important to note that DirectQuery mode uses, most of, the
semantics of SQL Server; but, in this case it separates from it giving a new behavior to NULL comparisons.
Casts
There is no cast function as such in DAX, but implicit casts are performed in many comparison and arithmetic
operations. It is the comparison or arithmetic operation that determines the data type of the result. For example,
Boolean values are treated as numeric in arithmetic operations, such as TRUE + 1, or the function MIN
applied to a column of Boolean values. A NOT operation also returns a numeric value.
Boolean values are always treated as logical values in comparisons and when used with EXACT, AND, OR,
&&, or ||.
Cast from string to Boolean
In in-memory and DirectQuery models, casts are permitted to Boolean values from these strings only: "" (empty
string), "true", "false"; where an empty string casts to false value.
Casts to the Boolean data type of any other string results in an error.
Cast from string to date/time
In DirectQuery mode, casts from string representations of dates and times to actual datetime values behave the
same way as they do in SQL Server.
Models that use the in-memory data store support a more limited range of text formats for dates than the string
formats for dates that are supported by SQL Server. However, DAX supports custom date and time formats.
Cast from string to other non Boolean values
When casting from strings to non-Boolean values, DirectQuery mode behaves the same as SQL Server. For more
information, see CAST and CONVERT (Transact-SQL ).
Cast from numbers to string not allowed
EXAMPLE: CONCATENATE(102,",345")
Casting from numbers to strings is not allowed in SQL Server.
This formula returns an error in tabular models and in DirectQuery mode; however, the formula produces a result
in Power Pivot.
No support for two-try casts in DirectQuery
In-memory models often attempt a second cast when the first one fails. This never happens in DirectQuery mode.
EXAMPLE: TODAY() + "13:14:15"
In this expression, the first parameter has type datetime and second parameter has type string. However, the
casts when combining the operands are handled differently. DAX will perform an implicit cast from string to
double. In in-memory models, the formula engine attempts to cast directly to double, and if that fails, it will try to
cast the string to datetime.
In DirectQuery mode, only the direct cast from string to double will be applied. If this cast fails, the formula will
return an error.
Math functions and arithmetic operations
Some mathematical functions will return different results in DirectQuery mode because of differences in the
underlying data type or the casts that can be applied in operations. Also, the restrictions described above on the
allowed range of values might affect the outcome of arithmetic operations.
Order of addition
When you create a formula that adds a series of numbers, an in-memory model might process the numbers in a
different order than a DirectQuery model. Therefore, when you have many very large positive numbers and very
large negative numbers, you may get an error in one operation and results in another operation.
Use of the POWER function
EXAMPLE: POWER(-64, 1/3)
In DirectQuery mode, the POWER function cannot use negative values as the base when raised to a fractional
exponent. This is the expected behavior in SQL Server.
In an in-memory model, the formula returns -4.
Numerical overflow operations
In Transact-SQL, operations that result in a numerical overflow return an overflow error; therefore, formulas that
result in an overflow also raise an error in DirectQuery mode.
However, the same formula when used in an in-memory model returns an eight-byte integer. That is because the
formula engine does not perform checks for numerical overflows.
LOG functions with blanks return different results
SQL Server handles nulls and blanks differently than the xVelocity engine. As a result, the following formula
returns an error in DirectQuery mode, but return infinity (-inf) in in-memory mode.
EXAMPLE: LOG(blank())
The same limitations apply to the other logarithmic functions: LOG10 and LN.
For more information about the blank data type in DAX, see DAX Syntax Reference.
Division by 0 and division by Blank
In DirectQuery mode, division by zero (0) or division by BLANK will always result in an error. SQL Server does not
support the notion of infinity, and because the natural result of any division by 0 is infinity, the result is an error.
However, SQL Server supports division by nulls, and the result must always equal null.
Rather than return different results for these operations, in DirectQuery mode, both types of operations (division
by zero and division by null) return an error.
Note that, in Excel and in Power Pivot models, division by zero also returns an error. Division by a blank returns a
blank.
The following expressions are all valid in in-memory models, but will fail in DirectQuery mode:
1/BLANK
1/0
0.0/BLANK
0/0
The expression BLANK/BLANK is a special case that returns BLANK in both for in-memory models, and in
DirectQuery mode.
Supported numeric and date -time ranges
Formulas in in-memory tabular model are subject to the same limitations as Excel with regard to maximum
allowed values for real numbers and dates. However, differences can arise when the maximum value is returned
from a calculation or query, or when values are converted, cast, rounded, or truncated.
If values of types Currency and Real are multiplied, and the result is larger than the maximum possible
value, in DirectQuery mode, no error is raised, and a null is returned.
In in-memory models, no error is raised, but the maximum value is returned.
In general, because the accepted date ranges are different for Excel and SQL Server, results can be guaranteed to
match only when dates are within the common date range, which is inclusive of the following dates:
Earliest date: March 1, 1990
Latest date: December 31, 9999
If any dates used in formulas fall outside this range, either the formula will result in an error, or the results will not
match.
Floating point values supported by CEILING
EXAMPLE: EVALUATE ROW("x", CEILING(-4.398488E+30, 1))
The Transact-SQL equivalent of the DAX CEILING function only supports values with magnitude of 10^19 or less.
A rule of thumb is that floating point values should be able to fit into bigint.
Datepart functions with dates that are out of range
Results in DirectQuery mode are guaranteed to match those in in-memory models only when the date used as the
argument is in the valid date range. If these conditions are not satisfied, either an error will be raised, or the
formula will return different results in DirectQuery than in in-memory mode.
EXAMPLE: MONTH(0) or YEAR(0)
The results of this expression will match only when the data supplied as a parameter is within the valid date range.
EXAMPLE: EOMONTH(blank(), blank()) or EDATE(blank(), blank())
The results of this expression should be the same in DirectQuery mode and in-memory mode.
Truncation of time values
EXAMPLE: SECOND(1231.04097222222)
In DirectQuery mode, the result is truncated, following the rules of SQL Server, and the expression evaluates to
59.
In in-memory models, the results of each interim operation are rounded; therefore, the expression evaluates to 0.
The following example demonstrates how this value is calculated:
1. The fraction of the input (0.04097222222) is multiplied by 24.
2. The resulting hour value (0.98333333328) is multiplied by 60.
3. The resulting minute value is 58.9999999968.
4. The fraction of the minute value (0.9999999968) is multiplied by 60.
5. The resulting second value (59.999999808) rounds up to 60.
6. 60 is equivalent to 0.
SQL Time data type not supported
In-memory models do not support use of the new SQL Time data type. In DirectQuery mode, formulas that
reference columns with this data type will return an error. Time data columns cannot be imported into an in-
memory model.
However, sometimes the engine casts the time value to an acceptable data type, and the formula returns a result.
This behavior affects all functions that use a date column as a parameter.
Currency
In DirectQuery mode, if the result of an arithmetic operation has the type Currency, the value must be within the
following range:
Minimum: -922337203685477.5808
Maximum: 922337203685477.5807
Combining currency and REAL data types
EXAMPLE: Currency sample 1
If Currency and Real types are multiplied, and the result is larger than 9223372036854774784 (0x7ffffffffffffc00),
DirectQuery mode will not raise an error.
In an in-memory model, an error is raised if the absolute value of the result is larger than
922337203685477.4784.
Operation results in an out-of-range value
EXAMPLE: Currency sample 2
If operations on any two currency values result in a value that is outside the specified range, an error is raised in
in-memory models, but not in DirectQuery models.
Combining currency with other data types
Division of currency values by values of other numeric types can result in different results.
Aggregation functions
Statistical functions on a table with one row return different results. Aggregation functions over empty tables also
behave differently in in-memory models than they do in DirectQuery mode.
Statistical functions over a table with a single row
If the table that is used as argument contains a single row, in DirectQuery mode, statistical functions such as
STDEV and VARx return null.
In an in-memory model, a formula that uses STDEV or VARx over a table with a single row returns a division by
zero error.
Text functions
Because relational data stores provide different text data types than does Excel, you may see different results when
searching strings or working with substrings. The length of strings also can be different.
In general, any string manipulation functions that use fixed-size columns as arguments can have different results.
Additionally, in SQL Server, some text functions support additional arguments that are not provided in Excel. If the
formula requires the missing argument you can get different results or errors in the in-memory model.
Operations that return a character using LEFT, RIGHT, etc. may return the correct character but in a
different case, or no results
EXAMPLE: LEFT(["text"], 2)
In DirectQuery mode, the case of the character that is returned is always exactly the same as the letter that is
stored in the database. However, the xVelocity engine uses a different algorithm for compression and indexing of
values, to improve performance.
By default, the Latin1_General collation is used, which is case-insensitive but accent-sensitive. Therefore, if there
are multiple instances of a text string in lower case, upper case, or mixed case, all instances are considered the
same string, and only the first instance of the string is stored in the index. All text functions that operate on stored
strings will retrieve the specified portion of the indexed form. Therefore, the example formula would return the
same value for the entire column, using the first instance as the input.
This behavior also applies to other text functions, including RIGHT, MID, and so forth.
String length affects results
EXAMPLE: SEARCH("within string", "sample target text", 1, 1)
If you search for a string using the SEARCH function, and the target string is longer than the within string,
DirectQuery mode raises an error.
In an in-memory model, the searched string is returned, but with its length truncated to the length of <within
text>.
EXAMPLE: EVALUATE ROW("X", REPLACE("CA", 3, 2, "California") )
If the length of the replacement string is greater than the length of the original string, in DirectQuery mode, the
formula returns null.
In in-memory models, the formula follows the behavior of Excel, which concatenates the source string and the
replacement string, which returns CACalifornia.
Implicit TRIM in the middle of strings
EXAMPLE: TRIM(" A sample sentence with leading white space")
DirectQuery mode translates the DAX TRIM function to the SQL statement LTRIM(RTRIM(<column>)) . As a result,
only leading and trailing white space is removed.
In contrast, the same formula in an in-memory model removes spaces within the string, following the behavior of
Excel.
Implicit RTRIM with use of LEN function
EXAMPLE: LEN('string_column')
Like SQL Server, DirectQuery mode automatically removes white space from the end of string columns: that is, it
performs an implicit RTRIM. Therefore, formulas that use the LEN function can return different values if the string
has trailing spaces.
In-memory supports additional parameters for SUBSTITUTE
EXAMPLE: SUBSTITUTE([Title],"Doctor","Dr.")
EXAMPLE: SUBSTITUTE([Title],"Doctor","Dr.", 2)
In DirectQuery mode, you can use only the version of this function that has three (3) parameters: a reference to a
column, the old text, and the new text. If you use the second formula, an error is raised.
In in-memory models, you can use an optional fourth parameter to specify the instance number of the string to
replace. For example, you can replace only the second instance, etc.
Restrictions on string lengths for REPT operations
In in-memory models, the length of a string resulting from an operation using REPT must be less than 32,767
characters.
This limitation does not apply in DirectQuery mode.
Substring operations return different results depending on character type
EXAMPLE: MID([col], 2, 5)
If the input text is varchar or nvarchar, the result of the formula is always the same.
However, if the text is a fixed-length character and the value for <num_chars> is greater than the length of the
target string, in DirectQuery mode, a blank is added at the end of the result string.
In an in-memory model, the result terminates at the last string character, with no padding.
See also
DirectQuery Mode
Tables and Columns
12/7/2018 • 3 minutes to read • Edit Online
Benefits
Tables, in tabular models, provide the framework in which columns and other metadata are defined. Tables include:
Table Definition
The table definition includes the set of columns. Columns can be imported from a data source or added manually,
such as with calculated columns.
Table Metadata
Relationships, measures, roles, perspectives, and pasted data are all metadata the define objects within the context
of a table.
Data
Data is populated in table columns when you first import tables by using the Table Import Wizard or by creating
new data in calculated columns. When data changes at the source, or when a model is removed from memory, you
must run a process operation to re-populate the data into the tables.
Related Tasks
TOPIC DESCRIPTION
Add columns to a table Describes how to add a source column to a table definition.
Delete a Column Describes how to delete a model table column by using the
model designer or by using the Table Properties dialog box.
Change table, column, or row filter mappings Describes how to change table, column, or row filter mappings
by using the table preview or SQL query editor in the Edit
Table Properties dialog box.
Specify Mark as Date Table for use with Time Intelligence Describes how to use the Mark as Date Table dialog box to
specify a date table and unique identifier column. Specifying a
date table and unique identifier is necessary when using time
intelligence functions in DAX formulas.
Add a table Describes how to add a table from a data source by using an
existing data source connection.
Rename a Table or Column Describes how to rename a table or column to make it more
identifiable in your model.
Set the Data Type of a Column Describes how to change the data type of a column. The data
type defines how data in the column is stored and presented.
Hide or freeze columns Describes how to hide columns that you don't want to display
and how to keep an area of a model visible while you scroll to
another area of the model by freezing (locking) specific
columns in one area.
Calculated Columns Topics in this section describe how you can use calculated
columns to add aggregated data to your model.
Filter and Sort Data Topics in this section describe how you can filter or sort data
by using controls in the model designer.
Add columns to a table
12/7/2018 • 4 minutes to read • Edit Online
IMPORTANT
When adding a column to a table that contains two or more partitions, before adding the column to the table definition by
using the Edit Table Properties dialog box, you must first use Partition Manager to add the column to all defined partitions.
After you have added the column to the defined partitions, you can then add the same column to the table definition by
using the Edit Table Properties dialog box.
NOTE
If you used a SQL Query to select tables and columns when you initially used the Table Import Wizard to import data, you
must again use a SQL Query in the Edit Table Properties dialog box to add columns to the model table.
To add a column from the data source by using the Edit Table Properties dialog box
1. In the model designer, click on the table you want to add a column to, then click the Table menu, and then
click Table Properties.
2. In the Edit Table Properties dialog box, in the table preview window, select the source column you want to
add, and then click OK. Columns already included in the table definition will already be checked.
See also
Edit table properties dialog box
Change table, column, or row filter mappings
Delete a Column
12/7/2018 • 2 minutes to read • Edit Online
See Also
Add columns to a table
Partitions
Change table, column, or row filter mappings
12/7/2018 • 2 minutes to read • Edit Online
NOTE
If your table has more than one partition, you cannot use the Edit Table Properties dialog box to change row filter mappings.
To change row filter mappings for tables with multiple partitions, use Partition Manager. For more information, see
Partitions.
DATE
7/1/2010 12:00:00 AM
7/2/2010 12:00:00 AM
7/3/2010 12:00:00 AM
7/4/2010 12:00:00 AM
7/5/2010 12:00:00 AM
4. If necessary, create any relationships between fact tables and the date table.
See Also
Calculations
Time-intelligence Functions (DAX)
Add a table
12/7/2018 • 2 minutes to read • Edit Online
NOTE
The Select Tables and Views page will not show tables that were previously imported as checked. If you select a
table that was previously imported using this connection, and you did not give the table a different friendly name, a 1
will be appended to the friendly name. You do not need to re-select any tables that were previously imported by
using this connection.
4. If necessary, use Preview & Filter to select only certain columns or apply filters to the data to be imported.
5. Click Finish to import the new table.
NOTE
When importing multiple tables at the same time from a single data source, any relationships between those tables at the
source will automatically be created in the model. When adding a table later; however, you may need to manually create
relationships in the model between newly added tables and the tables that were previously imported.
See also
Import Data
Delete a Table
Delete a table
12/7/2018 • 2 minutes to read • Edit Online
See also
Tables and columns
Create a calculated table
12/19/2018 • 2 minutes to read • Edit Online
=DimDate
Summarized or filtered dataset
In the Formula bar, enter a DAX expression that filters, summarizes, or otherwise manipulates a dataset to contain
the rows you want. This example groups by sales by color and currency.
=SUMMARIZECOLUMNS(DimProduct[Color]
, DimCurrency[CurrencyName]
, "Sales" , SUM(FactInternetSales[SalesAmount])
)
=CROSSJOIN(DimProductCategory, DimCurrency)
See also
Compatibility level
Data Analysis Expressions (DAX) in Analysis Services
Understanding DAX in tabular models
Rename a Table or Column
12/7/2018 • 2 minutes to read • Edit Online
NOTE
You can edit other properties of a table, including the connection information and column mappings, by using the
Edit Table Properties dialog box. However, you cannot change the name in this dialog box.
To rename a column
1. In the model designer, double-click the header of the column that you want to rename, or right-click the
header and select Rename Column from the context menu.
2. Type the new name.
See Also
Tables and Columns
Import from Power Pivot
Import from Analysis Services
Set the Data Type of a Column
12/7/2018 • 3 minutes to read • Edit Online
See Also
Data Types Supported
Hide or freeze columns
12/7/2018 • 2 minutes to read • Edit Online
IMPORTANT
The ability to hide columns is not intended to be used for data security, only to simplify and shorten the list of columns
visible in the model designer or reports. To secure data, you can define security roles. Roles can limit viewable metadata and
data to only those objects defined in the role. For more information, see Roles.
When you hide a column, you have the option to hide the column while you are working in the model designer or
in reports. If you hide all columns, the entire table appears blank in the model designer.
NOTE
If you have many columns to hide, you can create a perspective instead of hiding and unhiding columns. A perspective is a
custom view of the data that makes it easier to work with subset of related data. For more information, see Create and
Manage Perspectives
See Also
Tables and Columns
Perspectives
Roles
Calculated Columns
12/7/2018 • 4 minutes to read • Edit Online
Benefits
Formulas in calculated columns are much like formulas in Excel. Unlike Excel, however, you cannot create
different formulas for different rows in a table; instead, the DAX formula is automatically applied to the entire
column.
When a column contains a formula, the value is computed for each row. The results are calculated for the column
when you enter a valid formula. Column values are then recalculated as necessary, such as when the underlying
data is refreshed.
You can create calculated columns that are based on measures and other calculated columns. For example, you
might create one calculated column to extract a number from a string of text, and then use that number in
another calculated column.
A calculated column is based on data that you already have in an existing table, or created by using a DAX
formula. For example, you might choose to concatenate values, perform addition, extract substrings, or compare
the values in other fields. To add a calculated column, you must have at least one table in your model.
This example demonstrates a simple formula in a calculated column:
=EOMONTH([StartDate],0])
This formula extracts the month from the StartDate column. It then calculates the end of the month value for each
row in the table. The second parameter specifies the number of months before or after the month in StartDate; in
this case, 0 means the same month. For example, if the value in the StartDate column is 6/1/2001, the value in the
calculated column will be 6/30/2001.
Related tasks
TOPIC DESCRIPTION
Create a Calculated Column Tasks in this topic describe how to add a new calculated
column to a table.
See also
Tables and Columns
Measures
Calculations
Create a Calculated Column
12/7/2018 • 2 minutes to read • Edit Online
TIP
You can use DAX Formula AutoComplete in the middle of an existing formula with nested functions. The text immediately
before the insertion point is used to display values in the drop-down list, and all of the text after the insertion point remains
unchanged.
See Also
Calculated Columns
Measures
Sort Data in a Table
12/7/2018 • 2 minutes to read • Edit Online
NOTE
In some cases, data imported from another application might have leading spaces inserted before data. You must
remove the leading spaces in order to correctly sort the data.
NOTE
If the results are not what you expected, the column might contain numbers stored as text and not as numbers. For
example, negative numbers imported from some accounting systems, or a number entered with a leading '
(apostrophe), are stored as text.
See Also
Filter and Sort Data
Perspectives
Roles
Filter Data in a Table
12/7/2018 • 2 minutes to read • Edit Online
NOTE
The filter preview window limits the number of different values displayed. If the limit is exceeded, a message is displayed.
See Also
Filter and Sort Data
Perspectives
Roles
Relationships
12/7/2018 • 11 minutes to read • Edit Online
TIP
If your model contains many relationships, Diagram View can better help you better visualize and create new relationships
between tables.
Benefits
A relationship is a connection between two tables of data, based on one or more columns in each table. To see
why relationships are useful, imagine that you track data for customer orders in your business. You could track all
the data in a single table that has a structure like the following:
CUSTOMERI DISCOUNTR
D NAME EMAIL ATE ORDERID ORDERDATE PRODUCT QUANTITY
This approach can work, but it involves storing a lot of redundant data, such as the customer e-mail address for
every order. Storage is cheap, but you have to make sure you update every row for that customer if the e-mail
address changes. One solution to this problem is to split the data into multiple tables and define relationships
between those tables. This is the approach used in relational databases like SQL Server. For example, a database
that you import into a model might represent order data by using three related tables:
Customers
[CUSTOMERID] NAME EMAIL
1 Ashton chris.ashton@contoso.com
2 Jaworski michal.jaworski@contoso.com
CustomerDiscounts
[CUSTOMERID] DISCOUNTRATE
1 .05
2 .10
Orders
[CUSTOMERID] ORDERID ORDERDATE PRODUCT QUANTITY
If you import these tables from the same database, the Table Import Wizard can detect the relationships between
the tables based on the columns that are in [brackets], and can reproduce these relationships in the model
designer. For more information, see Automatic Detection and Inference of Relationships in this topic. If you
import tables from multiple sources, you can manually create relationships as described in Create a Relationship
Between Two Tables.
Columns and keys
Relationships are based on columns in each table that contain the same data. For example, the Customers and
Orders tables can be related to each other because they both contain a column that stores a customer ID. In the
example, the column names are the same, but this is not a requirement. One could be CustomerID and another
CustomerNumber, as long as all of the rows in the Orders table contain an ID that is also stored in the Customers
table.
In a relational database, there are several types of keys, which are typically just columns with special properties.
The following four types of keys can be used in relational databases:
Primary key: uniquely identifies a row in a table, such as CustomerID in the Customers table.
Alternate key (or candidate key): a column other than the primary key that is unique. For example, an
Employees table might store an employee ID and a social security number, both of which are unique.
Foreign key: a column that refers to a unique column in another table, such as CustomerID in the Orders
table, which refers to CustomerID in the Customers table.
Composite key: a key that is composed of more than one column. Composite keys are not supported in
tabular models. For more information, see "Composite Keys and Lookup Columns" in this topic.
In tabular models, the primary key or alternate key is referred to as the related lookup column, or just lookup
column. If a table has both a primary and alternate key, you can use either as the lookup column. The foreign key
is referred to as the source column or just column. In our example, a relationship would be defined between
CustomerID in the Orders table (the column) and CustomerID (the lookup column) in the Customers table. If you
import data from a relational database, by default the model designer chooses the foreign key from one table and
the corresponding primary key from the other table. However, you can use any column that has unique values for
the lookup column.
Types of relationships
The relationship between Customers and Orders is a one-to -many relationship. Every customer can have multiple
orders, but an order cannot have multiple customers. The other types of relationships are one-to -one and many-
to -many. The CustomerDiscounts table, which defines a single discount rate for each customer, is in a one-to-one
relationship with the Customers table. An example of a many-to-many relationship is a direct relationship
between Products and Customers, in which a customer can buy many products and the same product can be
bought by many customers. The model designer does not support many-to-many relationships in the user
interface. For more information, see "Many-to-Many Relationships" in this topic.
The following table shows the relationships between the three tables:
Inference of relationships
In some cases, relationships between tables are automatically chained. For example, if you create a relationship
between the first two sets of tables below, a relationship is inferred to exist between the other two tables, and a
relationship is automatically established.
Products and Category -- created manually
Category and SubCategory -- created manually
Products and SubCategory -- relationship is inferred
In order for relationships to be automatically chained, the relationships must go in one direction, as shown above.
If the initial relationships were between, for example, Sales and Products, and Sales and Customers, a relationship
is not inferred. This is because the relationship between Products and Customers is a many-to-many relationship.
The relationship cannot be created because both columns To create a valid relationship, at least one column of the pair
selected contain duplicate values. that you select must contain only unique values.
The column contains a null or empty value. Data columns cannot be joined to each other on a null value.
For every row, there must be a value in both of the columns
that are used in a relationship.
Related tasks
TOPIC DESCRIPTION
Create a Relationship Between Two Tables Describes how to manually create a relationship between two
tables.
Bi-directional cross filters for tabular models in SQL Server Describes two-way cross filtering for related tables. A filter
2016 Analysis Services context of one table relationship can be used when querying
across a second table relationship if tables are related and bi-
directional cross filters are define.
See also
Tables and Columns
Import Data
Create a relationship
12/7/2018 • 2 minutes to read • Edit Online
See also
Delete relationships
Relationships
Delete relationships
12/7/2018 • 2 minutes to read • Edit Online
Delete Relationships
To delete a relationship by using Diagram View
1. In SQL Server Data Tools (SSDT), click the Model menu, then point to Model View, and then click
Diagram View.
2. Right-click a relationship line between two tables, and then click Delete.
To delete a relationship by using the Manage Relationships dialog box
1. In SQL Server Data Tools, click the Table menu, and then click Manage Relationships.
2. In the Manage Relationships dialog box, select one or more relationships from the list.
To select multiple relationships, hold down CTRL while you click each relationship.
3. Click Delete Relationship.
4. In the Manage Relationships dialog box, click Close.
See Also
Relationships
Create a relationship
Bi-directional cross filters in tabular models
12/7/2018 • 7 minutes to read • Edit Online
There are two types of cross filters: One-way and two-way filtering. One-way is the traditional many-to-one filter
direction between fact and dimensional tables in that relationship. Two-way is a cross-filter that enables the filter
context of one relationship to be used as the filter context for another table relationship, with one table common
to both relationships.
Given DimDate and DimProduct with foreign key relationships to FactOnlineSales, a two-way cross filter is
equivalent of FactOnlineSales-to-DimDate plus FactOnlineSales-to-DimProduct used simultaneously.
Bi-directional cross filters can be an easy fix to the many-to-many query design problem that has challenged
tabular and Power Pivot developers in the past. If you've used the DAX workaround for many-to-many
relationships in tabular or Power Pivot models, you can try applying a two-way filter to see if it produces expected
results.
When creating a bi-directional cross filter, keep the following points in mind:
Think before you enable two-way filters.
If you enable two-way filters everywhere, your data could be over-filtered in ways that you might not
expect. You might also inadvertently introduce ambiguity by creating more than one potential query path.
To avoid both issues, plan on using a combination of one-way and two-way filters.
Do incremental testing to verify the impact of each filter change on your model. Analyze in Excel works
well for incremental testing. As a best practice, periodically follow that up with tests using other reporting
clients so that there are no surprises later.
NOTE
Starting in CTP 3.2, SSDT includes a default that determines whether bi-directional cross filters are attempted automatically.
If you enable bi-directional filters by default, SSDT will enable two-way filtering only if the model clearly articulates one
query path through a chain of table relationships.
Walkthrough an example
The best way to appreciate the value of bi-directional cross filtering is through an example. Consider the
following dataset from ContosoRetailDW, reflecting the cardinality and cross-filters that are created by default.
NOTE
By default, during data import, table relationships are created for you in many-to-one configurations derived from the
foreign key and primary key relationships between the fact table and related dimension tables.
Notice that the filter direction is from dimension tables to the fact table -- promotions, products, dates, customer,
and customer geography are all valid filters that successfully yield some aggregation of a measure, with the actual
value varying based on the dimensions used.
For this simple star schema, testing in Excel confirms that data slices nicely when filtering flows from dimension
tables on rows and columns to aggregated data provided by a Sum of Sales measure located in the central
FactOnlineSales table.
As long as measures are pulled from the fact table and the filter context terminates at the fact table, the
aggregations will be filtered correctly for this model. But what happens if you want to create measures elsewhere,
such as a distinct count in the products or customer table, or an average discount in the promotion table, and
have an existing filter context extend to that measure.
Let's try it out by adding a distinct count from DimProducts to the PivotTable. Notice the repeating values for
Count Products. At first glance, this looks like a missing table relationship, but in our model, we can see that all
the relationships are fully defined and active. In this case, the repeating values occur because there is no date filter
on rows in the product table.
After adding a two-way cross filter between FactOnlineSales and DimProduct, the rows in the product table
are now correctly filtered by manufacturer and date.
Learn step-by-step
You can try out bi-directional cross filters by stepping through this walkthrough. To follow along, you'll need:
SQL Server 2016 Analysis Services instance, tabular mode, latest CTP release
SQL Server Data Tools for Visual Studio 2015 (SSDT), co-released with the latest CTP.
ContosoRetailDW
Read permissions on this data.
Excel (for use with Analyze in Excel)
Create a project
1. Start SQL Server Data Tools for Visual Studio 2015.
2. Click File > New > Project > Analysis Services Tabular Model.
3. In Tabular Model Designer, set the workspace database to a SQL Server 2016 Preview Analysis Services
instance in tabular server mode.
4. Verify model compatibility level is set to SQL Server 2016 RTM (1200) or higher.
Click OK to create the project.
Add Data
1. Click Model > Import from Data Source > Microsoft SQL Server.
2. Specify the server, database, and authentication method.
3. Choose the ContosoRetailDW database.
4. Click Next.
5. On table selection, ctrl-select the following tables:
FactOnlineSales
DimCustomer
DimDate
DimGeography
DimPromotion
You can edit the names at this point if you want them to be more readable in the model.
Alternatively, click Table > Manage Relationships to view the same information in a table layout.
Create measures
You'll need an aggregation to sum sale amounts by different facets of dimensional data. In DimProduct, you can
create a measure that counts products, and then use it in an analysis of product merchandising that shows a
count of how many products participated in sales for a given year, a given region, or customer type.
1. Click Model > Model View > Diagram View.
2. Click FactOnlineSales.
3. Select the SalesAmount column.
4. Click Column > AutoSum > Sum to create a measure for sales.
5. Click DimProduct.
6. Select the ProductKeycolumn.
7. Click Column > AutoSum > DistinctCount to create a measure for unique products.
Analyze in Excel
1. Click Model > Analyze in Excel to bring all the data together in a PivotTable.
2. Select the two measures you just created from the field list.
3. Select Products > Manufacturer.
4. Select Date > Calendar Year.
Notice that sales are broken out by year and manufacturer as expected. This is because the default filter context
between FactOnlineSales, DimProduct, and DimDate works correctly for measures on the 'many' side of the
relationship.
At the same time, you can see that product count is not picking up on the same filter context as sales. While
product counts are correctly filtered by manufacturer (both manufacturer and product counts are in the same
table), the date filter is not propagated to product count.
Change the cross-filter
1. Back in the model, select Table > Manage Relationships.
2. Edit the relationship between FactOnlineSales and DimProduct.
Change the filter direction to both tables.
3. Save the settings.
4. In the workbook, click Refresh to re-read the model.
You should now see that both product counts and sales are filtered by the same filter context, one that includes
not only manufacturers from DimProducts but also calendar year from DimDate.
Next steps
Understanding when and how a bi-directional cross filter can be a matter of trial and error to see how it works in
your scenario. At times, you'll find that the built-in behaviors are not sufficient and will need to fall back on DAX
computations to get the job done. In the See Also section, you'll find several links to additional resources on this
subject.
In practical terms, cross-filtering can enable forms of data exploration typically delivered only through a many-to-
many construction. Having said that, it's important to recognize that bi-directional cross-filtering is not a many-
to-many construct. An actual many-to-many table configuration remains unsupported in the designer for tabular
models in this release.
See also
Create and manage relationships in Power BI Desktop
A practical example of how to handle simple many-to-manay relationships in Power Pivot and tabular models
Resolving many-to-many relationships leveraging DAX cross-table filtering
Many to many revolution (SQLBI blog)
Calculations in tabular models
12/6/2018 • 2 minutes to read • Edit Online
In this section
TOPIC DESCRIPTION
Understanding DAX in Tabular Models Describes the Data Analysis Expressions (DAX) formula
language used to create calculations for calculated columns,
measures, and row filters in tabular models.
DAX formula compatibility in DirectQuery mode Describes the differences, lists the functions that are not
supported in DirectQuery mode, and lists the functions that
are supported but could return different results.
Data Analysis Expressions (DAX) Reference This section provides detailed descriptions of DAX syntax,
operators, and functions.
NOTE
Step-by-step tasks for creating calculations are not provided in this section. Because calculations are specified in calculated
columns, measures, and row filters (in roles), instructions on where to create DAX formulas are provided in tasks related to
those features. For more information, see Create a Calculated Column, Create and Manage Measures, and Create and
Manage Roles.
NOTE
While DAX can also be used to query a tabular model, topics in this section focus specifically on using DAX formulas to
create calculations.
DAX in Tabular Models
12/7/2018 • 30 minutes to read • Edit Online
NOTE
Calculated columns are not supported for models that retrieve data from a relational data source using DirectQuery mode.
When a calculated column contains a valid DAX formula, values are calculated for each row as soon as the formula
is entered. Values are then stored in the database. For example, in a Date table, when the formula
=[Calendar Year] & " Q" & [Calendar Quarter] is entered into the formula bar, a value for each row in the table is
calculated by taking values from the Calendar Year column (in the same Date table), adding a space and the capital
letter Q, and then adding the values from the Calendar Quarter column (in the same Date table). The result for
each row in the calculated column is calculated immediately and appears, for example, as 2010 Q1. Column values
are only recalculated if the data is re-processed.
For more information, see Calculated Columns.
Measures
Measures are dynamic formulas where the results change depending on context. Measures are used in reporting
formats that support combining and filtering model data by using multiple attributes such as a Power BI report or
Excel PivotTable or PivotChart. Measures are defined by the model author by using the measure grid (and formula
bar) in the model designer in SSDT.
A formula in a measure can use standard aggregation functions automatically created by using the Autosum
feature, such as COUNT or SUM, or you can define your own formula by using DAX. When you define a formula
for a measure in the formula bar, a Tooltip feature shows a preview of what the results would be for the total in the
current context, but otherwise the results are not immediately output anywhere. Other measure details also
appear in the Properties pane.
The reason you cannot see the (filtered) results of the calculation immediately is because the result of a measure
cannot be determined without context. To evaluate a measure requires a reporting client application that can
provide the context needed to retrieve the data relevant to each cell and then evaluate the expression for each cell.
That client might be an Excel PivotTable or PivotChart, a Power BI report, or an MDX query. Regardless of the
reporting client, a separate query is run for each cell in the results. That is to say, each combination of row and
column headers in a PivotTable, or each selection of slicers and filters in a Power BI report, generates a different
subset of data over which the measure is calculated. For example, in a measure with the formula,
Total Sales:=SUM([Sales Amount]) , when a user places the TotalSales measure in the Values window in a
PivotTable, and then places the DimProductCategory column from a DimProduct table into the Filters window, the
sum of Sales Amount is calculated and displayed for each product category.
Unlike calculated columns and row filters, the syntax for a measure includes the measure's name preceding the
formula. In the example just provided, the name Total Sales: appears preceding the formula. After you have
created a measure, the name and its definition appear in the reporting client application Field List and depending
on perspectives and roles is available to all users of the model.
For more information, see Measures.
Row filters
Row filters define which rows in a table are visible to members of a particular role. Row filters can be created for
each table in a model by using DAX formulas. Row filters are created for a particular role by using Role Manager
in SSDT. Row filters can also be defined for a deployed model by using Role Properties in SQL Server
Management Studio (SSMS ).
In a row filter, a DAX formula, which must evaluate to a Boolean TRUE/FALSE condition, defines which rows can
be returned by the results of a query by members of that particular role. Rows not included in the DAX formula
cannot be returned. For example, for members of the Sales role, the Customers table with the following DAX
formula, =Customers[Country] = "USA" , members of the Sales role will only be able to view data for customers in
the USA, and aggregates, such as SUM are returned only for customers in the USA.
When you define a row filter by using DAX formula, you are creating an allowed row set. This does not deny
access to other rows; rather, they are simply not returned as part of the allowed row set. Other roles can allow
access to the rows excluded by the DAX formula. If a user is a member of another role, and that role's row filters
allow access to that particular row set, the user can view data for that row.
Row filters apply to the specified rows as well as related rows. When a table has multiple relationships, filters
apply security for the relationship that is active. Row filters will be intersected with other row filters defined for
related tables.
For more information, see Roles.
Whole Number A 64 bit (eight-bytes) integer value 1, 2 Numbers that have no decimal places.
Integers can be positive or negative
numbers, but must be whole numbers
between -9,223,372,036,854,775,808
(-2^63) and
9,223,372,036,854,775,807 (2^63-1).
DATA TYPE IN MODEL DATA TYPE IN DAX DESCRIPTION
Decimal Number A 64 bit (eight-bytes) real number 1, 2 Real numbers are numbers that can
have decimal places. Real numbers
cover a wide range of values:
Zero
Tabular models also include the Table data type as the input or output to many DAX functions. For example, the
FILTER function takes a table as input and outputs another table that contains only the rows that meet the filter
conditions. By combining table functions with aggregation functions, you can perform complex calculations over
dynamically defined data sets.
While data types are typically automatically set, it is important to understand data types and how they apply, in-
particular, to DAX formulas. Errors in formulas or unexpected results, for example, are often caused by using a
particular operator that cannot be used with a data type specified in an argument. For example, the formula,
= 1 & 2 , returns a string result of 12. The formula, = "1" + "2" , however, returns an integer result of 3.
For detailed information about data types in tabular models and explicit and implicit conversions of data types in
DAX, see Data Types Supported.
DAX Operators
The DAX language uses four different types of calculation operators in formulas:
Comparison operators to compare values and return a logical TRUE\FALSE value.
Arithmetic operators to perform arithmetic calculations that return numeric values.
Text concatenation operators to join two or more text strings.
Logical operators that combine two or more expressions to return a single result.
For detailed information about operators used in DAX formulas, see DAX Operator Reference.
DAX formulas
DAX formulas are essential for creating calculations in calculated columns and measures, and securing your data
by using row level filters. To create formulas for calculated columns and measures, you will use the formula bar
along the top of the model designer window or the DAX Editor. To create formulas for row filters, you will use the
Role Manager dialog box. Information in this section is meant to get you started with understanding the basics of
DAX formulas.
Formula basics
DAX enables tabular model authors to define custom calculations in both model tables, as part of calculated
columns, and as measures associated with tables, but not appearing directly in them. DAX also enables model
authors to secure data, by creating calculations that return a Boolean value defining which rows in a particular or
related table can be queried by member users of the associated role.
DAX formulas can be very simple or quite complex. The following table shows some examples of simple formulas
that could be used in a calculated column.
Formula Description
=[Column1] + [Column2] Adds the values in the same row of [Column1] and [Column2]
and puts the results in the calculated column of the same row.
Whether the formula you create is simple or complex, you can use the following steps when building a formula:
1. Each formula must begin with an equal sign.
2. You can either type or select a function name, or type an expression.
3. Begin to type the first few letters of the function or name you want, and AutoComplete displays a list of
available functions, tables, and columns. Press TAB to add an item from the AutoComplete list to the
formula.
You can also click the Fx button to display a list of available functions. To select a function from the
dropdown list, use the arrow keys to highlight the item, and click OK to add the function to the formula.
4. Supply the arguments to the function by selecting them from a dropdown list of possible tables and
columns, or by typing in values.
5. Check for syntax errors: ensure that all parentheses are closed and columns, tables and values are
referenced correctly.
6. Press ENTER to accept the formula.
NOTE
In a calculated column, as soon as you enter the formula and the formula is validated, the column is populated with values.
In a measure, pressing ENTER saves the measure definition in the measure grid with the table. If a formula is invalid, an error
will be displayed.
In this example, we will look at a more complex formula in a measure named Days in Current Quarter:
This measure is used to create a comparison ratio between an incomplete period and the previous period. The
formula must take into account the proportion of the period that has elapsed, and compare it to the same
proportion in the previous period. In this case, [Days Current Quarter to Date]/[Days in Current Quarter] gives the
proportion elapsed in the current period.
This formula contains the following elements:
[Date] Specifies the Date column in the Date table. Columns are in
brackets.
LASTDATE The LASTDATE function returns the last date of the quarter.
NOTE
Some limits are applied within measures on nesting of functions to ensure that performance is not affected by the many
calculations required by dependencies among columns.
DAX functions
This section provides an overview of the types of functions supported in DAX. For more detailed information, see
DAX Function Reference.
DAX provides a variety of functions you can use perform calculations using dates and times, create conditional
values, work with strings, perform lookups based on relationships, and the ability to iterate over a table to perform
recursive calculations. If you are familiar with Excel formulas, many of these functions will appear very similar;
however, DAX formulas are different in the following important ways:
A DAX function always references a complete column or a table. If you want to use only particular values
from a table or column, you can add filters to the formula.
If you need to customize calculations on a row -by-row basis, DAX provides functions that let you use the
current row value or a related value as a kind of parameter, to perform calculations that vary by context. To
understand how these functions work, see Context in DAX Formulas later in this topic.
DAX includes many functions that return a table, rather than a value. The table is not displayed in a
reporting client, but is used to provide input to other functions. For example, you can retrieve a table and
then count the distinct values in it, or calculate dynamic sums across filtered tables or columns.
DAX functions include a variety of time-intelligence functions. These functions let you define or select date
ranges, and perform dynamic calculations based on these dates or range. For example, you can compare
sums across parallel periods.
Date and time functions
The date and time functions in DAX are similar to date and time functions in Microsoft Excel. However, DAX
functions are based on the datetime data types used by Microsoft SQL Server. For more information, see Date
and Time Functions (DAX).
Filter functions
The filter functions in DAX return specific data types, look up values in related tales, and filter by related values.
The lookup functions work by using tables and relationships, like a database. The filtering functions let you
manipulate data context to create dynamic calculations. For more information, see Filter Functions (DAX).
Information functions
An information function looks at the cell or row that is provided as an argument and tells you whether the value
matches the expected type. For example, the ISERROR function returns TRUE if the value that you reference
contains an error. For more information, see Information Functions (DAX).
Logical functions
Logical functions act upon an expression to return information about the values in the expression. For example,
the TRUE function lets you know whether an expression that you are evaluating returns a TRUE value. For more
information, see Logical Functions (DAX).
Mathematical and trigonometric functions
The mathematical functions in DAX are very similar to the Excel mathematical and trigonometric functions. Some
minor differences exist in the numeric data types used by DAX functions. For more information, see Math and Trig
Functions (DAX).
Other functions
These functions perform unique actions that cannot be defined by any of the categories most other functions
belong to. For more information, see Other Functions (DAX).
Statistical functions
DAX provides statistical functions that perform aggregations. In addition to creating sums and averages, or finding
the minimum and maximum values, in DAX you can also filter a column before aggregating or create
aggregations based on related tables. For more information, see Statistical Functions (DAX).
Text functions
The text functions in DAX are very similar to their counterparts in Excel. You can return part of a string, search for
text within a string, or concatenate string values. DAX also provides functions for controlling the formats for dates,
times, and numbers. For more information, see Text Functions (DAX).
Time -intelligence functions
The time-intelligence functions provided in DAX let you create calculations that use built-in knowledge about
calendars and dates. By using time and date ranges in combination with aggregations or calculations, you can
build meaningful comparisons across comparable time periods for sales, inventory, and so on. For more
information, see Time-intelligence Functions (DAX).
Table -valued functions
There are DAX functions that output tables, take tables as input, or do both. Because a table can have a single
column, table-valued functions also take single columns as inputs. Understanding how to use these table-valued
functions is important for fully utilizing DAX formulas. DAX includes the following types of table-valued functions:
Filter functions - Return a column, table, or values related to the current row.
Aggregation functions - Aggregate any expression over the rows of a table.
Time-intelligence functions - Return a table of dates, or use a table of dates to calculate an aggregation.
Context in DAX formulas
Context is an important concept to understand when creating formulas using DAX. Context is what enables you to
perform dynamic analysis, as the results of a formula change to reflect the current row or cell selection and also
any related data. Understanding context and using context effectively are critical for building high-performing,
dynamic analyses, and for troubleshooting problems in formulas.
Formulas in tabular models can be evaluated in a different context, depending on other design elements:
Filters applied in a PivotTable or report
Filters defined within a formula
Relationships specified by using special functions within a formula
There are different types of context: row context, query context, and filter context.
Row context
Row context can be thought of as "the current row". If you create a formula in a calculated column, the row context
for that formula includes the values from all columns in the current row. If the table is related to another table, the
content also includes all the values from the other table that are related to the current row.
For example, suppose you create a calculated column, =[Freight] + [Tax] , that adds together values from two
columns, Freight and Tax, from the same table. This formula automatically gets only the values from the current
row in the specified columns.
Row context also follows any relationships that have been defined between tables, including relationships defined
within a calculated column by using DAX formulas, to determine which rows in related tables are associated with
the current row.
For example, the following formula uses the RELATED function to fetch a tax value from a related table, based on
the region that the order was shipped to. The tax value is determined by using the value for region in the current
table, looking up the region in the related table, and then getting the tax rate for that region from the related table.
= [Freight] + RELATED('Region'[TaxRate])
This formula gets the tax rate for the current region from the Region table and adds it to the value of the Freight
column. In DAX formulas, you do not need to know or specify the specific relationship that connects the tables.
Multiple row context
DAX includes functions that iterate calculations over a table. These functions can have multiple current rows, each
with its own row context. In essence, these functions let you create formulas that perform operations recursively
over an inner and outer loop.
For example, suppose your model contains a Products table and a Sales table. Users might want to go through
the entire sales table, which is full of transactions involving multiple products, and find the largest quantity
ordered for each product in any one transaction.
With DAX you can build a single formula that returns the correct value, and the results are automatically updated
any time a user adds data to the tables.
=MAXX(FILTER(Sales,[ProdKey]=EARLIER([ProdKey])),Sales[OrderQty])
For a detailed walkthrough of this formula, see the EARLIER Function (DAX).
To summarize, the EARLIER function stores the row context from the operation that preceded the current
operation. At all times, the function stores in memory two sets of context: one set of context represents the current
row for the inner loop of the formula, and another set of context represents the current row for the outer loop of
the formula. DAX automatically feeds values between the two loops so that you can create complex aggregates.
Query context
Query context refers to the subset of data that is implicitly retrieved for a formula. When a user places a measure
or other value field into a PivotTable or into a report based on a tabular model, the engine examines the row and
column headers, Slicers, and report filters to determine the context. Then, the necessary queries are run against
the data source to get the correct subset of data, make the calculations defined by the formula, and then populate
each cell in the PivotTable or report. The set of data that is retrieved is the query context for each cell.
WARNING
For a model in DirectQuery mode, the context is evaluated, and then the set operations to retrieve the correct subset of
data and calculate the results are translated to SQL statements. Those statements are then directly run against the relational
data store. Therefore, although the method of getting the data and calculating the results is different, the context itself does
not change.
Because context changes depending on where you place the formula, the results of the formula can also change.
For example, suppose you create a formula that sums the values in the Profit column of the Sales table:
=SUM('Sales'[Profit]) . If you use this formula in a calculated column within the Sales table, the results for the
formula will be the same for the entire table, because the query context for the formula is always the entire data
set of the Sales table. Results will have profit for all regions, all products, all years, and so on.
However, users typically don't want to see the same result hundreds of times, but instead want to get the profit for
a particular year, a particular country, a particular product, or some combination of these, and then get a grand
total.
In a PivotTable, context can be changed by adding or removing column and row headers and by adding or
removing Slicers. Whenever users add column or row headings to the PivotTable, they change the query context
in which the measure is evaluated. Slicing and filtering operations also affect context. Therefore, the same formula,
used in a measure, is evaluated in a different query context for each cell.
Filter context
Filter context is the set of values allowed in each column, or in the values retrieved from a related table. Filters can
be applied to the column in the designer, or in the presentation layer (reports and PivotTables). Filters can also be
defined explicitly by filter expressions within the formula.
Filter context is added when you specify filter constraints on the set of values allowed in a column or table, by
using arguments to a formula. Filter context applies on top of other contexts, such as row context or query context.
In tabular models, there are many ways to create filter context. Within the context of clients that can consume the
model, such as Power BI reports, users can create filters on the fly by adding slicers or report filters on the row
and column headings. You can also specify filter expressions directly within the formula, to specify related values,
to filter tables that are used as inputs, or to dynamically get context for the values that are used in calculations. You
can also completely clear or selectively clear the filters on particular columns. This is very useful when creating
formulas that calculate grand totals.
For more information about how to create filters within formulas, see the FILTER Function (DAX).
For an example of how filters can be cleared to create grand totals, see the ALL Function (DAX).
For examples of how to selectively clear and apply filters within formulas, see the ALLEXCEPT Function (DAX).
Determining context in formulas
When you create a DAX formula, the formula is first tested for valid syntax, and then tested to make sure the
names of the columns and tables included in the formula can be found in the current context. If any column or
table specified by the formula cannot be found, an error is returned.
Context during validation (and recalculation operations) is determined as described in the preceding sections, by
using the available tables in the model, any relationships between the tables, and any filters that have been
applied.
For example, if you have just imported some data into a new table and it is not related to any other tables (and
you have not applied any filters), the current context is the entire set of columns in the table. If the table is linked
by relationships to other tables, the current context includes the related tables. If you add a column from the table
to a report that has Slicers and maybe some report filters, the context for the formula is the subset of data in each
cell of the report.
Context is a powerful concept that can also make it difficult to troubleshoot formulas. We recommend that you
begin with simple formulas and relationships to see how context works. The following section provides some
examples of how formulas use different types of context to dynamically return results.
Ex a m p l e s o f c o n t e x t i n fo r m u l a s
1. The RELATED Function (DAX) function expands the context of the current row to include values in a related
column. This lets you perform lookups. The example in this topic illustrates the interaction of filtering and
row context.
2. The FILTER Function (DAX) function lets you specify the rows to include in the current context. The
examples in this topic also illustrate how to embed filters within other functions that perform aggregates.
3. The ALL Function (DAX) function sets context within a formula. You can use it to override filters that are
applied as result of query context.
4. The ALLEXCEPT Function (DAX) function lets you remove all filters except one that you specify. Both topics
include examples that walk you through building formulas and understanding complex contexts.
5. The EARLIER Function (DAX) and EARLIEST Function (DAX) functions let you loop through tables by
performing calculations, while referencing a value from an inner loop. If you are familiar with the concept of
recursion and with inner and outer loops, you will appreciate the power that the EARLIER and EARLIEST
functions provide. If you are new to these concepts, you should follow the steps in the example carefully to
see how the inner and outer contexts are used in calculations.
When a formula is evaluated, the model designer first checks for general syntax, and then checks the names of
columns and tables that you provide against possible columns and tables in the current context. If the name is
ambiguous or if the column or table cannot be found, you will get an error on your formula (an #ERROR string
instead of a data value in cells where the error occurs). For more information about naming requirements for
tables, columns, and other objects, see "Naming Requirements" in DAX Syntax Reference.
Table relationships
By creating relationships between tables, you gain the ability to look up data in another table and use related
values to perform complex calculations. For example, you can use a calculated column to look up all the shipping
records related to the current reseller, and then sum the shipping costs for each. In many cases, however, a
relationship might not be necessary. You can use the LOOKUPVALUE function in a formula to return the value in
result_columnName for the row that meets criteria specified in the search_column and search_value parameters.
Many DAX functions require that a relationship exist between the tables, or among multiple tables, in order to
locate the columns that you have referenced and return results that make sense. Other functions will attempt to
identify the relationship; however, for best results you should always create a relationship where possible. For
more information, see Formulas and the Tabular Model earlier in this topic.
Additional resources
The Tabular Modeling (Adventure Works Tutorial) provides step-by-step instructions on how to create a tabular
model that includes many calculations in calculated columns, measures, and row filters. For most formulas, a
description about what the formula is meant to do is provided.
The Analysis Services Team Blog provides the latest information, tips, news and announcements.
The DAX Resource Center provides both internal and external information on DAX, including numerous DAX
solutions submitted by leading Business Intelligence professionals.
See Also
Data Analysis Expressions (DAX) Reference
Measures
Calculated Columns
Roles
KPIs
Data Sources Supported
Measures
12/7/2018 • 5 minutes to read • Edit Online
Benefits
Measures can be based on standard aggregation functions, such as AVERAGE, COUNT, or SUM, or you can
define your own formula by using DAX. In addition to the formula, each measure has properties defined by the
measure data type, such as Name, Table Detail, Format, and Decimal Places.
When measures have been defined in a model, users can then add them to a report or PivotTable. Depending on
perspectives and roles, measures appear in the Field List with their associated table, and are available to all users
of the model. Measures are usually created in Fact tables; however, measures can be independent of the table it is
associated with.
It is important to understand the fundamental differences between a calculated column and a measure. In a
calculated column, a formula evaluates to a value for each row in the column. For example, in a FactSales table, a
calculated column named TotalProfit with the following formula calculates a value for total profit for each row
(one row per sale) in the FactSales table:
The TotalProfit calculated column can then be used in a reporting client just as any other column.
A measure, on the other hand, evaluates to a value based on a user selection; a filter context set in a PivotTable or
report. For example, a measure in the FactSales table is created with the following formula:
A sales analyst, using Excel, wants to know the total profit for a category of products. Each product category is
comprised of multiple products. The sales analyst selects the ProductCategoryName column and adds it to the
Row Labels filter window of a PivotTable; a row for each product category is then displayed in the PivotTable. The
user then selects the Sum of TotalProfit measure. A measure will by default be added to the Values filter window.
The measure calculates the sum of total profit and displays the results for each product category. The sales
analyst can then further filter the sum of total profit for each product category by using a slicer, for example,
adding CalendarYear as a slicer to view the sum of total profit for each product category by year.
Audio $2,731,061,308.69
Computers $392,999,044.59
PRODUCTCATEGORYNAME SUM OF TOTALPROFIT
TIP
You can group measures from multiple tables into one table by creating an empty table, and then moving or create new
measures into it. Keep in-mind, you may need to include table names in DAX formulas when referencing columns in other
tables.
If perspectives have been defined for the model, measures are not automatically added to any of those
perspectives. You must manually add measures to a perspective by using the Perspectives dialog box. To learn
more, see Perspectives.
Measure Properties
Each measure has properties that define it. Measure properties, along with the associated column properties can
be edited in the Properties window. Measures have the following properties:
Format Automatically determined from the Format of the measure. For example,
data type of the column referenced in currency or percentage.
the formula expression.
Formula The formula entered in the formula bar The formula of the measure.
when the measure was created.
Measure Name If AutoSum is used, the measure name The name of the measure as it is
will precede the column name followed displayed in a reporting client Field List.
by a colon. If a custom formula is
entered, type a name followed by a
colon, and then type the formula.
Related tasks
TOPIC DESCRIPTION
Create and Manage Measures Describes how to create and manage measures using the
measure grid in the model designer.
See Also
KPIs
Create and Manage KPIs
Calculated Columns
Create and manage measures
12/7/2018 • 2 minutes to read • Edit Online
Tasks
To create and manage measures, you will use a table's measure grid. You can view the measure grid for a table in
the model designer in Data View only. You cannot create measures or view the measure grid when in Diagram
View; however, you can view existing measures in Diagram View. To show the measure grid for a table, click the
Table menu, and then click Show Measure Grid.
To create a measure using a standard aggregation formula
Click on the column for which you want to create the measure, then click the Column menu, then point to
AutoSum, and then click an aggregation type.
The measure will be created automatically with a default name, followed by the formula in the first cell in
the measure grid directly beneath the column.
To create a measure using a custom formula
In the measure grid, beneath the column for which you want to create the measure, click a cell, then in the
formula bar, type a name, followed by a colon (:), followed by an equals sign (=), followed by the formula. Press
ENTER to accept the formula.
To edit measure properties
In the measure grid, click a measure, and then In the Properties window, type or select a different property
value.
To rename a measure
In the measure grid, click on a measure, and then In the Properties window, in Measure Name, type a
new name, and then click ENTER.
You can also rename a measure in the formula bar. The measure name precedes the formula, followed by a
colon.
To delete a measure
In the measure grid, right-click a measure, and then click Delete.
See Also
Measures
KPIs
Calculated columns
KPIs
12/7/2018 • 4 minutes to read • Edit Online
Benefits
In business terminology, a Key Performance Indicator (KPI) is a quantifiable measurement for gauging business
objectives. A KPI is frequently evaluated over time. For example, the sales department of an organization may use
a KPI to measure monthly gross profit against projected gross profit. The accounting department may measure
monthly expenditures against revenue to evaluate costs, and a human resources department may measure
quarterly employee turnover. Each is an example of a KPI. Business professionals frequently consume KPIs that
are grouped together in a business scorecard to obtain a quick and accurate historical summary of business
success or to identify trends.
A KPI in a tabular model includes:
Base Value
A Base value is defined by a measure that resolves to a value. This value, for example, can be an aggregate of
actual Sales or a calculated measure such as Profit for a given period.
Target value
A Target value is defined by a measure that resolves to a value, or by an absolute value. For example, a target
value could be the amount by which the business managers of an organization want to increase sales or profit.
Status thresholds
A Status threshold is defined by the range between a low and high threshold or by a fixed value. The Status
threshold displays with a graphic to help users easily determine the status of the Base value compared to the
Target value.
Example
The sales manager at Adventure Works wants to create a PivotTable that she can use to quickly display whether
or not sales employees are meeting their sales quota for a given period (year). For each sales employee, she
wants the PivotTable to display the actual sales amount in dollars, the sales quota amount in dollars, and a simple
graphic display showing the status of whether or not each sales employee is below, at, or above their sales quota.
She wants to be able to slice the data by year.
To do this, the sales manager enlists the help of her organization's BI solution developer to add a Sales KPI to the
AdventureWorks Tabular Model. The sales manager will then use Excel to connect to the Adventure Works
Tabular Model as a data source and create a PivotTable with the fields (measures and KPI) and slicers to analyze
whether or not the sales force is meeting their quotas.
In the model, a measure on the SalesAmount column in the FactResellerSales table, which gives the actual sales
amount in dollars for each sales employee is created. This measure will define the Base value of the KPI.
The Sales measure is created with the following formula:
Sales:=Sum(FactResellerSales[SalesAmount])
The SalesAmountQuota column in the FactSalesQuota table has a sales amount quota defined for each
employee. The values in this column will serve as the Target measure (value) in the KPI.
The SalesAmountQuota measure is created with the following formula:
Target SalesAmountQuota:=Sum(FactSalesQuota[SalesAmountQuota])
NOTE
There is a relationship between the EmployeeKey column in the FactSalesQuota table and the EmployeeKey in the
DimEmployees table. This relationship is necessary so that each sales employee in the DimEmployee table is represented in
the FactSalesQuota table.
Now that measures have been created to serve as the Base value and Target value of the KPI, the Sales measure
is extended to a new Sales KPI. In the Sales KPI, the Target SalesAmountQuota measure is defined as the Target
value. The Status threshold is defined as a range by percentage, the target of which is 100% meaning actual sales
defined by the Sales measure met the quota amount defined in the Target SalesAmoutnQuota measure. Low and
High percentages are defined on the status bar, and a graphic type is selected.
The sales manager can now create a PivotTable adding the KPI's Base value, Target value, and Status to the
Values field. The Employees column is added to the RowLabel field, and the CalendarYear column is added as a
Slicer.
The sales manager can now slice by year the actual sales amount, sales quota amount, and status for each sales
employee. She can analyze sales trends over years to determine whether or not she needs to adjust the sales
quota for a sales employee.
Related Tasks
TOPIC DESCRIPTION
Create and Manage KPIs Describes how to create a KPI with a Base measure, a Target
measure, and status thresholds.
See Also
Measures
Perspectives
Create and manage KPIs
12/7/2018 • 2 minutes to read • Edit Online
Tasks
IMPORTANT
Before creating a KPI, you must first create a Base measure that evaluates to value. You then extend the Base measure to a
KPI. How to create measures are described in another topic, Create and Manage Measures. A KPI also requires a target
value. This value can be from another pre-defined measure or an absolute value. Once you have extended a Base measure to
a KPI, you can then select the target value and define status thresholds in the Key Performance Indicator dialog box.
To create a KPI
1. In the measure grid, right-click the measure that will serve as the Base measure (value), and then click
Create KPI.
2. In the Key Performance Indicator dialog box, in Define target value, select from one of the following:
Select Measure, and then select a target measure from the listbox.
Select Absolute value, and then type a numerical value.
3. In Define status thresholds, click and slide the low and high threshold values.
4. In Select icon style, click an image type.
5. Click on Descriptions, and then type descriptions for KPI, Value, Status, and Target.
TIP
You can use the Analyze in Excel feature to test your KPI. For more information, see Analyze in Excel.
To edit a KPI
In the measure grid, right-click the measure that serves as the Base measure (value) of the KPI, and then click
Edit KPI Settings.
To delete a KPI and the base measure
In the measure grid, right-click the measure that serves as the Base measure (value) of the KPI, and then click
Delete.
To delete a KPI, but keep the base measure
In the measure grid, right-click the measure that serves as the Base measure (value) of the KPI, and then click
Delete KPI.
ALT shortcuts
UI SECTION KEY COMMAND
Measure ALT+M
Trend ALT+T
Descriptions ALT+D
Trend ALT+T
See also
KPIs
Measures
Create and managemeasures
Hierarchies
12/7/2018 • 4 minutes to read • Edit Online
Benefits
Tables can include dozens or even hundreds of columns with unusual column names in no apparent order. This
can lead to an unordered appearance in reporting client field lists, making it difficult for users to find and include
data in a report. Hierarchies can provide a simple, intuitive view of an otherwise complex data structure.
For example, in a Date table, you can create a Calendar hierarchy. Calendar Year is used as the top-most parent
level, with Month, Week, and Day included as child levels (Calendar Year->Month->Week->Day). This hierarchy
shows a logical relationship from Calendar Year to Day. A client user can then select Calendar Year from a Field
List to include all levels in a PivotTable, or expand the hierarchy, and select only particular levels to be included in
the PivotTable.
Because each level in a hierarchy is a representation of a column in a table, the level can be renamed. While not
exclusive to hierarchies (any column can be renamed in a tabular model), renaming hierarchy levels can make it
easier for users to find and include levels in a report. Renaming a level does not rename the column it references;
it simply makes the level more identifiable. In our Calendar Year hierarchy example, in the Date table in Data View,
the columns: CalendarYear, CalendarMonth, CalendarWeek, and CalendarDay were renamed to Calendar Year,
Month, Week, and Day to make them more easily identifiable. Renaming levels has the additional benefit of
providing consistency in reports, since users will less likely need to change column names to make them more
readable in PivotTables, charts, etc.
Hierarchies can be included in perspectives. Perspectives define viewable subsets of a model that provide focused,
business-specific, or application-specific viewpoints of the model. A perspective, for example, could provide users
a viewable list (hierarchy) of only those data items necessary for their specific reporting requirements. For more
information, see Perspectives.
Hierarchies are not meant to be used as a security mechanism, but as a tool for providing a better user experience.
All security for a particular hierarchy is inherited from the underlying model. Hierarchies cannot provide access to
model objects to which a user does not already have access. Security for the model database must be resolved
before access to objects in the model can be provided through a hierarchy. Security roles can be used to secure
model metadata and data. For more information, see Roles.
Defining hierarchies
You create and manage hierarchies by using the model designer in Diagram View. Creating and managing
hierarchies is not supported in the model designer in Data View. To view the model designer in Diagram View,
click the Model menu, then point to Model View, and then click Diagram View.
To create a hierarchy, right-click a column you want to specify as the parent level, and then click Create
Hierarchy. You can multi-select any number of columns (within a single table) to include, or you can later add
columns as child levels by clicking and dragging columns to the parent level. When multiple columns are selected,
columns are automatically placed in an order based on cardinality. You can change the order by clicking and
dragging a column (level) to a different order or by using Up and Down navigation controls on the context menu.
When adding a column as a child level, you can use auto-detect by dragging and dropping the column onto the
parent level.
A column can appear in more than one hierarchy. Hierarchies cannot include non-column objects such as
measures or KPIs. A hierarchy can be based on columns from within a single table only. If you multi-select a
measure along with one or more columns, or if you select columns from multiple tables, the Create Hierarchy
command is disabled in the context menu. To add a column from a different table, use the RELATED DAX function
to add a calculated column that references the column from the related table. The function uses the following
syntax: =RELATED(TableName[ColumnName]) . For more information, see RELATED Function.
By default, new hierarchies are named hierarchy1, hierarchy 2, etc. You should change hierarchy names to reflect
the nature of the parent-child relationship, making them more identifiable to users.
After you have created hierarchies, you can test their efficacy by using the Analyze in Excel feature. For more
information, see Analyze in Excel.
Related tasks
TASK DESCRIPTION
Create and Manage Hierarchies Describes how to create and manage hierarchies by using the
model designer in Diagram View.
See Also
Tabular Model Designer
Perspectives
Roles
Create and manage hierarchies
12/7/2018 • 3 minutes to read • Edit Online
Create a hierarchy
You can create a hierarchy by using the columns and table context menu. When you create a hierarchy, a new
parent level displays with selected columns as child levels.
To create a hierarchy from the context menu
1. In the model designer (Diagram View ), in a table window, right-click on a column, and then click Create
Hierarchy.
To select multiple columns, click each column, then right-click to open the context menu, and then click
Create Hierarchy.
A parent hierarchy level is created at the bottom of the table window and the selected columns are copied
under the hierarchy as child levels.
2. Type a name for the hierarchy.
You can drag additional columns into your hierarchy's parent level, which copies the columns. Drop the child level
to place it where you want it to appear in the hierarchy.
NOTE
The Create Hierarchy command is disabled in the context menu if you multi-select a measure along with one or more
columns or you select columns from multiple tables.
Edit a hierarchy
You can rename a hierarchy, rename a child level, change the order of the child levels, add additional columns as
child levels, remove a child level from a hierarchy, show the source name of a child level (the column name), and
hide a child level if it has the same name as the hierarchy parent level.
To change the name of a hierarchy or child level
1. Right-click the hierarchy parent level or a child level, and the click Rename.
2. Type a new name or edit the existing name.
To change the order of a child level in a hierarchy
Click and drag a child level into a new position in the hierarchy.
Or, right-click a child level of the hierarchy, and then click Move Up to move the level up in the list, or click
Move Down to move the level down in the list.
Or, click a child level to select it, and then press Alt + Up Arrow to move the level up, or press Alt+Down
Arrow to move the level down in the list.
To add another child level to a hierarchy
Click and drag a column onto the parent level or into a specific location of the hierarchy. The column is
copied as a child level of the hierarchy.
Or, right-click a column, point to Add to Hierarchy, and then click the hierarchy.
NOTE
You can add a hidden column (a column that is hidden from reports) as a child level to the hierarchy. The child level is not
hidden.
NOTE
If you rename a hierarchy child level, it no longer shares the same name as the column that it is copied from. Use the Show
Source Name command to see which column it was copied from.
Delete a Hierarchy
To delete a hierarchy and remove its child levels
Right-click the parent hierarchy level, and then click Delete Hierarchy.
Or, click the parent hierarchy level, and then press Delete. This also removes all the child levels.
See Also
Tabular Model Designer
Hierarchies
Measures
Partitions
1/18/2019 • 3 minutes to read • Edit Online
Benefits
Partitions, in tabular models, divide a table into logical partition objects. Each partition can then be processed
independent of other partitions. For example, a table may include certain row sets that contain data that rarely
changes, but other row sets have data that changes often. In these cases, there is no need to process all of the
data when you really just want to process a portion of the data. Partitions enable you to divide portions of data
you need to process frequently from the data that can be processed less frequently.
Effective model design utilizes partitions to eliminate unnecessary processing and subsequent processor load on
Analysis Services servers, while at the same time, making certain that data is processed and refreshed often
enough to reflect the most recent data from data sources. How you implement and utilize partitions during
model authoring can be very different from how partitions are implemented and utilized for deployed models.
Keep in-mind that during the model authoring phase, you may be working with only a subset of the data that will
ultimately be in your deployed model.
Processing partitions
For deployed models, processing occurs by using SSMS, or by running a script which includes the process
command and specifies processing options and settings. When authoring models by using SSDT, you can run
process operations by using a Process command from the Model menu or toolbar. A Process operation can be
specified for a partition, a table, or all.
When a process operation is run, a connection to the data source is made using the data connection. New data is
imported into the model tables, relationships and hierarchies are rebuilt for each table, and calculations in
calculated columns and measures are re-calculated.
By further dividing a table into logical partitions, you can selectively determine what, when, and how the data in
each partition is processed. When you deploy a model, processing of partitions can be completed manually
using the Partitions dialog box in SSMS, or by using a script that executes a process command.
Partitions in the model workspace database
You can create new partitions, edit, merge, or delete partitions using the Partition Manager in SSDT. Depending
on the compatibility level of the model you are authoring, Partition Manager provides two modes for selecting
tables, rows, and columns for a partition: For tabular 1400 models, partitions are defined by using an M query,
or you can use Design mode to open Query Editor. For tabular 1100, 1103, 1200 models, use Table Preview
mode and SQL query mode.
Partitions in a deployed model database
When you deploy a model, the partitions for the deployed model database will appear as database objects in
SSMS. You can create, edit, merge, and delete partitions for a deployed model by using the Partitions dialog box
in SSMS. Managing partitions for a deployed model in SSMS is outside the scope of this topic. To learn about
managing partitions in SSMS, see Create and Manage Tabular Model Partitions.
Related tasks
TOPIC DESCRIPTION
Create and Manage Partitions in the Workspace Database Describes how to create and manage partitions in the model
workspace database by using Partition Manager in SSDT.
Process Partitions in the Workspace Database Describes how to process (refresh) partitions in the model
workspace database.
See also
DirectQuery Mode
Process Data
Create and manage partitions in the workspace
database
1/18/2019 • 2 minutes to read • Edit Online
NOTE
You cannot merge partitions in the model workspace database by using the Partition Manager dialog box. Partitions can be
merged in a deployed model only by using SQL Server Management Studio.
Tasks
To create and manage partitions, you will use the Partitions Manager dialog box. To view the Partitions
Manager dialog box, in SQL Server Data Tools, click the Table menu, and then click Partitions.
To create a new partition
1. In the model designer, select the table for which you want to define a partition.
2. Click on the Table menu, and then click Partitions.
3. In Partition Manager, in the Table listbox, verify or select the table you want to partition, and then click
New.
4. In Partition Name, type a name for the partition. By default, the name of the default partition will be
incrementally numbered for each new partition.
5. You can select the rows and columns to be included in the partition by using Table Preview mode or by
using a SQL query created using Query Editor mode.
To use Table Preview mode (default), click the Table Preview button near the upper-right corner of the
preview window. Select the columns you want to include in the partition by selecting the checkbox next to
the column name. To filter rows, right click a cell value, and click Filter by Selected Cell Value.
To use a SQL statement, click the Query Editor button near the upper-right corner of the preview window,
then type or paste a SQL query statement into the query window. To validate your statement, click
Validate. To use the Query Designer, click Design.
To copy a partition
1. In Partition Manager, in the Table listbox, verify or select the table that contains the partition you want to
copy.
2. In the Partitions list, select the partition you want to copy and then click Copy.
3. In Partition Name, type a new name for the partition.
To delete a partition
1. In Partition Manager, in the Table listbox, verify or select the table that contains the partition you want to
delete.
2. In the Partitions list, select the partition you want to delete and then click Delete.
See also
Partitions
Process partitions in the workspace database
Process Partitions in the Workspace Database
1/18/2019 • 2 minutes to read • Edit Online
MODE DESCRIPTION
Process Full Processes a partition object and all the objects that it
contains. When Process Full is run for an object that has
already been processed, Analysis Services drops all data in
the object, and then processes the object. This kind of
processing is required when a structural change has been
made to an object.
3. In the Process checkbox column, select the partitions you want to process with the selected mode, and then
click Ok.
See Also
Partitions
Create and Manage Partitions in the Workspace Database
Perspectives in tabular models
12/6/2018 • 2 minutes to read • Edit Online
Benefits
Tabular models can be very complex for users to explore. A single model can represent the contents of a
complete data warehouse with many tables, measures, and dimensions. Such complexity can be daunting to
users who may only need to interact with a small part of the model in order to satisfy their business intelligence
and reporting requirements.
In a perspective, tables, columns, and measures (including KPIs) are defined as field objects. You can select the
viewable fields for each perspective. For example, a single model may contain product, sales, financial, employee,
and geographic data. While a sales department requires product, sales, promotions, and geography data, they
likely do not require employee and financial data. Similarly, a human resources department does not require
data about sales promotions and geography.
When a user connects to a model (as a data source) with defined perspectives, the user can select the
perspective they want to use. For example, when connecting to a model data source in Excel, users in Human
Resources can select the Human Resources perspective on the Select Tables and Views page of the Data
Connection Wizard. Only fields (tables, columns, and measures) defined for the Human Resources perspective
will be visible in the PivotTable Field List.
Perspectives are not meant to be used as a security mechanism, but as a tool for providing a better user
experience. All security for a particular perspective is inherited from the underlying model. Perspectives cannot
provide access to model objects to which a user does not already have access. Security for the model database
must be resolved before access to objects in the model can be provided through a perspective. Security roles
can be used to secure model metadata and data. For more information, see Roles.
Testing perspectives
When authoring a model, you can use the Analyze in Excel feature in the model designer to test the efficacy of
the perspectives you have defined. From the Model menu in the model designer, when you click Analyze in
Excel, before Excel opens, the Choose Credentials and Perspective dialog box appears. In this dialog, you can
specify the current username, a different user, a role, and a perspective with which you will use to connect to the
model workspace database as a data source and view data.
Related tasks
TOPIC DESCRIPTION
Create and Manage Perspectives Describes how to create and manage perspectives using the
Perspectives dialog box in the model designer.
See Also
Roles
Hierarchies
Create and manage perspectives
12/7/2018 • 2 minutes to read • Edit Online
Tasks
To create perspectives, you will use the Perspectives dialog box, where you can add, edit, delete, copy, and view
perspectives. To view the Perspectives dialog box, in SQL Server Data Tools (SSDT), click on the Model menu,
and then click Perspectives.
To add a perspective
To add a new perspective, click New Perspective. You can then check and uncheck field objects to be
included and provide a name for the new perspective.
If you create an empty perspective with all of the field object fields, then a user using this perspective will
see an empty Field List. Perspectives should contain at least one table and column.
To edit a perspective
To modify a perspective, check and uncheck fields in the perspective's column, which adds and removes field
objects from the perspective.
To rename a perspective
When you hover over a perspective's column header (the name of the perspective), the Rename button
appears. To rename the perspective, click Rename, and then enter a new name or edit the existing name.
To delete a perspective
When you hover over a perspective's column header (the name of the perspective), the Delete button appears.
To delete the perspective, click the Delete button, and then click Yes in the confirmation window.
To copy a perspective
When you hover over a perspective's column header, theCopy button appears. To create a copy of that
perspective, click the Copy button. A copy of the selected perspective is added as a new perspective to the right
of existing perspectives. The new perspective inherits the name of the copied perspective and a - Copy
annotation is appended to the end of the name. For example, if a copy of the Sales perspective is created, the
new perspective is called Sales - Copy.
See also
Perspectives
Hierarchies
Translations in Tabular models (Analysis Services)
5/16/2018 • 4 minutes to read • Edit Online
Don't delete any unspecified metadata from the file. It should match the file upon which it is based. Just add the
strings you want, and then save the file.
Although it might look like something you should modify, the referenceCulture section contains the metadata in
the default culture of the model. Any changes made to the referenceCulture section will not be read in during
import and will be ignored.
The following example shows translated captions and description for the DimProduct and DimCustomer tables.
TIP
You can use any JSON editor to open the file, but we recommend using the JSON editor in Visual Studio so that you can
also use the View Code command in Solution explorer to view the Tabular model definition in SSDT. To get the JSON editor,
you need a full version installation of Visual Studio 2015. The free Community edition includes the JSON editor.
Overwrite existing translations Replaces all existing captions or descriptions of the same
language as the file being imported.
Write import results to a log file Log files are saved to the project folder by default. The
exact path to the file is provided after import concludes.
The log file name is SSDT_Translations_Log_<timestamp>.
Back up translations to a JSON file before importing Backs up an existing translation that matches the culture
of the strings being imported. If the culture being
imported is not present in the model, then the backup will
be empty.
If you need to restore this file later, you can replace the
contents of the model.bim with this JSON file.
4. Click Import.
5. Optionally, if you generated a log file or backup, you can find the files in the project folder (for example,
C:\Users\Documents\Visual Studio 2015\Projects\Tabular1200-AW\Tabular1200-AW ).
6. To verify the import, follow these steps:
Right-click the model.bim file in Solution Explorer and choose View Code. Click Yes to close the
design view and reopen model.bim in code view. If you installed a full version of Visual Studio, such
as the free Community edition, the file opens in the built-in JSON editor.
Search for Culture or for a specific translated string to verify the strings you expect to see are
actually there.
When you create a PivotTable, you should see the translated table and column names.
See Also
Compatibility Level for Tabular models in Analysis Services
Globalization scenarios for Analysis Services
Analyze in Excel
Roles
12/7/2018 • 8 minutes to read • Edit Online
IMPORTANT
When using SSDT to create roles and add organizational users to a tabular model project that will be deployed to Azure
Analysis Services, use Integrated workspace.
IMPORTANT
For users to connect to a deployed model by using a reporting client application, you must create at least one role with
at least Read permission to which those users are members.
Information in this topic is meant for tabular model authors who define roles by using the Role Manager
dialog box in SSDT. Roles defined during model authoring apply to the model workspace database. After a
model database has been deployed, model database administrators can manage (add, edit, delete) role
members by using SSMS. To learn about managing members of roles in a deployed database, see Tabular
Model Roles.
Understanding roles
Roles are used in Analysis Services to manage model data access. There are two types of roles:
The server role, a fixed role that provides administrator access to an Analysis Services server instance.
Database roles, roles defined by model authors and administrators to control access to a model
database and data for non-administrator users.
Roles defined for a tabular model are database roles. That is, the roles contain members consisting of users or
groups that have specific permissions that define the action those members can take on the model database. A
database role is created as a separate object in the database, and applies only to the database in which that
role is created. Users and groups are included in the role by the model author, which, by default, has
Administrator permissions on the workspace database server; for a deployed model, by an administrator.
Roles in tabular models can be further defined with row filters. Row filters use DAX expressions to define the
rows in a table, and any related rows in the many direction, that a user can query. Row filters using DAX
expressions can only be defined for the Read and Read and Process permissions. To learn more, see Row
Filters later in this topic.
By default, when you create a new tabular model project, the model project does not have any roles. Roles can
be defined by using the Role Manager dialog box in SSDT. When roles are defined during model authoring,
they are applied to the model workspace database. When the model is deployed, the same roles are applied to
the deployed model. After a model has been deployed, members of the server role ([Analysis Services
Administrator) and database administrators can manage the roles associated with the model and the members
associated with each role by using SSMS.
Permissions
Each role has a single defined database permission (except for the combined Read and Process permission).
By default, a new role will have the None permission. That is, once members are added to the role with the
None permission, they cannot modify the database, run a process operation, query data, or see the database
unless a different permission is granted.
A group or user can be a member of any number of roles, each role with a different permission. When a user
is a member of multiple roles, the permissions defined for each role are cumulative. For example, if a user is a
member of a role with the Read permission, and also a member of a role with None permission, that user will
have Read permissions.
Each role can have one the following permissions defined:
None Members cannot make any Row filters do not apply. No data is
modifications to the model database visible to users in this role
schema and cannot query data.
Read Members are allowed to query data Row filters can be applied. Only data
(based on row filters) but cannot see specified in the row filter DAX formula
the model database in SSMS, cannot is visible to users.
make any changes to the model
database schema, and the user cannot
process the model.
Read and Process Members are allowed to query data Row filters can be applied. Only data
(based on row-level filters) and run specified in the row filter DAX formula
process operations by running a script can be queried.
or package that contains a process
command, but cannot make any
changes to the database. Cannot view
the model database in SSMS.
Process Members can run process operations Row filters do not apply. No data can
by running a script or package that be queried in this role
contains a process command. Cannot
modify the model database schema.
Cannot query data. Cannot query the
model database in SSMS.
Administrator Members can make modifications to Row filters do not apply. All data can
the model schema and can query all be queried in this role.
data in the model designer, reporting
client, and SSMS.
Row filters
Row filters define which rows in a table can be queried by members of a particular role. Row filters are defined
for each table in a model by using DAX formulas.
Row filters can be defined only for roles with Read and Read and Process permissions. By default, if a row filter
is not defined for a particular table, members of a role that has Read or Read and Process permission can
query all rows in the table unless cross-filtering applies from another table.
Once a row filter is defined for a particular table, a DAX formula, which must evaluate to a TRUE/FALSE value,
defines the rows that can be queried by members of that particular role. Rows not included in the DAX
formula will cannot be queried. For example, for members of the Sales role, the Customers table with the
following row filters expression, =Customers [Country ] = "USA", members of the Sales role, will only be able
to see customers in the USA.
Row filters apply to the specified rows as well as related rows. When a table has multiple relationships, filters
apply security for the relationship that is active. Row filters will be intersected with other row filers defined for
related tables, for example:
Region =Region[Country]="USA"
ProductCategory =ProductCategory[Name]="Bicycles"
Transactions =Transactions[Year]=2008
The net effect of these permissions on the Transactions table is that members will be allowed to query rows of
data where the customer is in the USA, and the product category is bicycles, and the year is 2008. Users would
not be able to query any transactions outside of the USA, or any transactions that are not bicycles, or any
transactions not in 2008 unless they are a member of another role that grants these permissions.
You can use the filter, =FALSE (), to deny access to all rows for an entire table.
Dynamic security
Dynamic security provides a way to define row level security based on the user name of the user currently
logged on or the CustomData property returned from a connection string. In order to implement dynamic
security, you must include in your model a table with login (Windows user name) values for users as well as a
field that can be used to define a particular permission; for example, a dimEmployees table with a login ID
(domain\username) as well as a department value for each employee.
To implement dynamic security, you can use the following functions as part of a DAX formula to return the
user name of the user currently logged on, or the CustomData property in a connection string:
FUNCTION DESCRIPTION
USERNAME Function (DAX) Returns the domain\ username of the user currently logged
on.
You can use the LOOKUPVALUE function to return values for a column in which the Windows user name is
the same as the user name returned by the USERNAME function or a string returned by the CustomData
function. Queries can then be restricted where the values returned by LOOKUPVALUE match values in the
same or related table.
For example, using this formula:
='dimDepartmentGroup'[DepartmentGroupId]=LOOKUPVALUE('dimEmployees'[DepartmentGroupId],
'dimEmployees'[LoginId], USERNAME(), 'dimEmployees'[LoginId], 'dimDepartmentGroup'[DepartmentGroupId])
The LOOKUPVALUE function returns values for the dimEmployees[DepartmentId] column where the
dimEmployees[LoginId] is the same as the LoginID of the user currently logged on, returned by USERNAME,
and values for dimEmployees[DepartmentId] are the same as values for
dimDepartmentGroup[DepartmentId]. The values in DepartmentId returned by LOOKUPVALUE are then
used to restrict the rows queried in the dimDepartment table, and any tables related by DepartmentId. Only
rows where DepartmentId are also in the values for the DepartmentId returned by LOOKUPVALUE function
are returned.
dimEmployees
dimDepartment
DEPARTMENTID DEPARTMENTNAME
1 Corporate
3 Inventory Management
4 Manufacturing
5 Quality Assurance
Testing roles
When authoring a model project, you can use the Analyze in Excel feature to test the efficacy of the roles you
have defined. From the Model menu in the model designer, when you click Analyze in Excel, before Excel
opens, the Choose Credentials and Perspective dialog box appears. In this dialog, you can specify the
current username, a different username, a role, and a perspective with which you will use to connect to the
workspace model as a data source. To learn more, see Analyze in Excel.
Related tasks
TOPIC DESCRIPTION
TOPIC DESCRIPTION
Create and Manage Roles Tasks in this topic describe how to create and manage roles
by using the Role Manager dialog box.
See Also
Perspectives
Analyze in Excel
USERNAME Function (DAX)
LOOKUPVALUE Function (DAX)
CUSTOMDATA Function (DAX)
Create and manage roles
12/7/2018 • 2 minutes to read • Edit Online
IMPORTANT
If you're deploying your project to Azure Analysis Services, use Integrated Workspace as your workspace database. To
learn more, see Workspace database.
The tasks in this article describe how to create and manage roles during model authoring by using the Role
Manager dialog box in SQL Server Data Tools (SSDT). For information about managing roles in a deployed
model database, see Tabular Model Roles.
Tasks
To create, edit, copy, and delete roles, you will use the Role Manager dialog box. To view the Role Manager
dialog box, in SQL Server Data Tools, click the Model menu, and then click Role Manager.
To create a new role
1. In SQL Server Data Tools, click the Model menu, and then click Role Manager.
2. In the Role Manager dialog box, click New.
A new highlighted role is added to the Roles list.
3. In the Roles list, in the Name field, type a name for the role.
By default, the name of the default role will be incrementally numbered for each new role. It is
recommended you type a name that clearly identifies the member type, for example, Finance Managers or
Human Resources Specialists.
4. In the Permissions field, click the down arrow and then select one of the following permission types:
PERMISSION DESCRIPTION
Read and Process Members are allowed to query data (based on row-level
filters) and run Process and Process All operations, but
cannot make any changes to the model schema.
5. To enter a description for the role, click the Description field, and then type a description.
6. If the role you are creating has Read or Read and Process permission, you can add row filters using a DAX
formula. To add row filters, click the Row Filters tab, then select a table, then click the DAX Filter field, and
then type a DAX formula.
7. To add members to the role, click the Members tab, and then click Add.
NOTE
Role members can also be added to a deployed model by using SQL Server Management Studio. For more
information, see Manage Roles by using SSMS.
8. In the Select Users or Groups dialog box, enter Windows user or Windows group objects as members.
9. Click Ok.
See also
Roles
Perspectives
Analyze in Excel
USERNAME Function (DAX)
CUSTOMDATA Function (DAX)
Object-level security
12/7/2018 • 2 minutes to read • Edit Online
Table-level security
With table-level security, you can not only restrict access to table data, but also sensitive table names, helping
prevent malicious users from discovering if a table exists.
Table-level security is set in the JSON -based metadata in the Model.bim, Tabular Model Scripting Language
(TMSL ), or Tabular Object Model (TOM ). Set the metadataPermission property of the tablePermissions class in
the Roles object to none.
In this example, the metadataPermission property of the tablePermissions class for the Product table is set to none:
"roles": [
{
"name": "Users",
"description": "All allowed users to query the model",
"modelPermission": "read",
"tablePermissions": [
{
"name": "Product",
"metadataPermission": "none"
}
]
}
Column-level security
Similar to table-level security, with column-level security you can not only restrict access to column data, but also
sensitive column names, helping prevent malicious users from discovering a column.
Column-level security is set in the JSON -based metadata in the Model.bim, Tabular Model Scripting Language
(TMSL ), or Tabular Object Model (TOM ). Set the metadataPermission property of the columnPermissions class
in the Roles object to none.
In this example, the metadataPermission property of the columnPermissions class for the Base Rate column in the
Employees table is set to none:
"roles": [
{
"name": "Users",
"description": "All allowed users to query the model",
"modelPermission": "read",
"tablePermissions": [
{
"name": "Employee",
"columnPermissions": [
{
"name": "Base Rate",
"metadataPermission": "none"
}
]
}
]
}
Restrictions
Table-level security cannot be set for a model if it breaks a relationship chain. An error is generated at
design time. For example, if there are relationships between tables A and B, and B and C, you cannot secure
table B. If table B is secured, a query on table A cannot transit the relationships between table A and B, and
B and C. In this case, a separate relationship could be configured between tables A and B.
Row -level security and object-level security cannot be combined from different roles because it could
introduce unintended access to secured data. An error is generated at query time for users who are
members of such a combination of roles.
Dynamic calculations (measures, KPIs, DetailRows) are automatically restricted if they reference a secured
table or column. While there is no mechanism to explicitly secure a measure, it is possible to implicitly
secure a measure by updating the expression to refer to a secured table or column.
Relationships that reference a secured column work provided the table the column is in is not secured.
See Also
Roles
Roles object (TMSL )
Tabular Model Scripting Language (TMSL )
Tabular Object Model (TOM ).
Analyze in Excel
12/6/2018 • 2 minutes to read • Edit Online
Benefits
The Analyze in Excel feature provides model authors the ability to test the efficacy of a model project by using
the common data analysis application, Microsoft Excel. In order to use the Analyze in Excel feature, you must
have Microsoft Office 2003 or later installed on the same computer as SSDT.
The Analyze in Excel feature opens Excel and creates a new Excel workbook (.xls). A data connection from the
workbook to the model workspace database is created. A blank PivotTable is added to the worksheet and model
object metadata is populated in the PivotTable Field list. You can then add viewable data and slicers to the
PivotTable.
When using the Analyze in Excel feature, by default, the user account currently logged on is the effective user.
This account is typically an Administrator with no view restrictions to model objects or data. You can, however,
specify a different effective username or role. This allows you to browse a model project in Excel within the
context of a specific user or role. Specifying the effective user includes the following options:
Current Windows User
Uses the user account with which you are currently logged on.
Other Windows User
Uses a specified Windows username rather than the user currently logged on. Using a different Windows user
does not require a password. Objects and data can only be viewed in Excel within the context of the effective
username. No changes to model objects or data can be made in Excel.
Role
A role is used to define user permissions on the object metadata and data. Roles are usually defined for a
particular Windows user or Windows user group. Certain roles can include additional row -level filters defined in
a DAX formula. When using the Analyze in Excel feature, you can optionally select a role to be used. Object
metadata and data views will be restricted by the permission and filters defined for the role. For more
information, see Create and Manage Roles.
In addition to the effective user or role, you can specify a perspective. Perspectives enable model authors to
define particular business scenario views of model objects and data. By default, no perspective is used. In order
to use a perspective with Analyze in Excel, perspectives must already be defined by using the Perspectives dialog
box in SSDT. If a perspective is specified, the PivotTable Field List will contain only those objects selected in the
perspective. For more information, see Create and Manage Perspectives.
Related tasks
TOPIC DESCRIPTION
Analyze a tabular model in Excel This article describes how to use the Analyze in Excel feature
in the model designer to open Excel, create a data source
connection to the model workspace database, and add a
PivotTable to the worksheet.
See also
Analyze a tabular model in Excel
Roles
Perspectives
Analyze a tabular model in Excel
12/7/2018 • 2 minutes to read • Edit Online
NOTE
To use the Analyze in Excel feature, you must have Microsoft Office 2003 or later installed on the same computer as SQL
Server Data Tools. If Office is not installed on the same computer, you can use Excel on another computer and connect to
the model workspace database as a data source. You can then manually add a PivotTable to the worksheet. Model objects
(tables, columns, measures, and KPIs) are included as fields in the PivotTable field list.
Tasks
To analyze a tabular model project by using the Analyze in Excel feature
1. In SQL Server Data Tools, click the Model menu, and then click Analyze in Excel.
2. In the Choose Credential and Perspective dialog box, select one of the following credential options to
connect to the model workspace data source:
To use the current user account, select Current Windows User.
To use a different user account, select Other Windows User.
Typically, this user account will be a member of a role. No password is required. The account can
only be used in the context of an Excel connection to the workspace database.
To use a security role, select Role, and then in the listbox, select one or more roles.
Security roles must be defined using the Role Manager. For more information, see Create and
Manage Roles.
3. To use a perspective, in the Perspective listbox, select a perspective.
Perspectives (other than default) must be defined using the Perspectives dialog box. For more information,
see Create and Manage Perspectives.
NOTE
The PivotTable Field List in Excel does not refresh automatically as you make changes to the model project in the model
designer. To refresh the PivotTable Field List, in Excel, on the Options ribbon, click Refresh.
See also
Analyze in Excel
String storage and collation in tabular models
12/7/2018 • 6 minutes to read • Edit Online
Storage
In tabular models all data is highly compressed to better fit in memory. As a consequence, all strings that can be
considered lexically equivalent are stored only once. The first instance of the string is used as the canonical
representation and thereafter each equivalent string is indexed to the same compressed value as the first
occurrence.
The key question is: what constitutes a lexically equivalent string? Two strings are considered lexically equivalent if
they can be considered as the same word. For example, in English when you search for the word violin in a
dictionary, you might find the entry Violin or violin, depending on the editorial policy of the dictionary, but
generally you consider both words equivalent, and disregard the difference in capitalization. In a tabular model, the
factor that determines whether two strings are lexically equivalent is not editorial policy or even user preference,
but the locale and collation order assigned to the column.
Therefore, the decision of whether uppercase and lowercase letters should be handled as the same or different
depends on the collation and locale. For any particular word within that locale, the first occurrence of the word that
is found within a particular column therefore serves as the canonical representation of that word and that string is
stored in uncompressed format. All other strings are tested against the first occurrence, and if they match the
equivalence test, they are assigned to the compressed value of the first occurrence. Later, when the compressed
values are retrieved they are represented using the uncompressed value of the first occurrence of the string.
An example will help to clarify how this works. The following column "Classification - English" was extracted from a
table that contains information about plants and trees. For each plant (the names of the plants are not shown here)
the classification column shows the general category of plant.
CLASSIFICATION - ENGLISH
trEE
PlAnT
TREE
PLANT
Plant
CLASSIFICATION - ENGLISH
Tree
plant
tReE
tree
pLaNt
tREE
Perhaps the data came from many different sources, and so the casing and use of accents was inconsistent, and the
relational database stored those differences as is. But in general the values are either Plant or Tree, just with
different casing.
When these values are loaded into a tabular model that uses the default collation and sorting order for American
English, case is not important, so only two values would be stored for the entire column:
CLASSIFICATION - ENGLISH
trEE
PlAnT
If you use the column, Classification - English, in your model, wherever you display plant classification you will
see not the original values, with their various uses of upper and lower case, but only the first instance. The reason is
that all the uppercase and lowercase variants of tree are considered equivalent in this collation and locale;
therefore, only one string was preserved and the first instance of that string that is encountered by the system is
the one that is saved.
WARNING
You might decide that you want to define which string will be the first to store, according to what you consider correct, but
this could be very hard to so. There is no simple way to determine in advance which row should be processed first by the
engine, given that all values are considered to be the same. Instead, if you need to set the standard value, you should cleanse
all your strings before loading the model.
Benefits
Deploying a tabular model creates a model database in a test, staging, or production environment. Users can then
connect to the deployed model through a .bism connection file in Sharepoint or by using a data connection
directly from reporting client applications such as Microsoft Excel, Power View, or a custom application. The
model workspace database, created when you create a new tabular model project in SQL Server Data Tools
(SSDT), and used to author the model will remain on the workspace server instance, allowing you to make
changes to the model project and then re-deploying to the test, staging, or production environment when
necessary.
Deployment properties
The project deployment options and deployment server properties specify how and where a model is deployed
to a staging or production Analysis Services environment. While default property settings are defined for all
model projects, depending on your particular deployment requirements, you can change these property settings
for each project. For more information about setting default deployment properties, see Configure default data
modeling and deployment properties.
Deployment options properties
Deployment options properties include the following:
Edition The same edition as the instance in This property specifies the edition of
which the Workspace Server is located. the Analysis Services server to which
the model will be deployed. The server
edition defines various features that
can be incorporated into the project. By
default, the edition will be of the local
Analysis Services server. If you specify a
different Analysis Services server, for
example, a production Analysis Services
server, be sure to specify the edition of
that Analysis Services server.
ImpersonateCurrentUser - This
setting specifies the user account of the
user currently logged on will be used
when connecting to all data sources.
Deployment methods
There are several methods you can use to deploy a tabular model project. Most of the deployment methods that
can be used for other Analysis Services projects, such as multidimensional, can also be used to deploy tabular
model projects.
Deploy command in SQL Server The Deploy command provides a Deploy From SQL Server Data Tools
Data Tools simple and intuitive method to deploy
a tabular model project from the SQL
Server Data Tools authoring
environment.
Analysis Management Objects AMO provides a programmatic Developing with Analysis Management
(AMO) Automation interface to the complete command set Objects (AMO)
for Analysis Services, including
commands that can be used for
solution deployment. As an approach
for solution deployment, AMO
automation is the most flexible, but it
also requires a programming effort. A
key advantage to using AMO is that
you can use SQL Server Agent with
your AMO application to run
deployment on a preset schedule.
METHOD DESCRIPTION LINK
XMLA Use SQL Server Management Studio to Deploy Model Solutions Using XMLA
generate an XMLA script of the
metadata of an existing Analysis
Services database, and then run that
script on another server to recreate the
initial database. XMLA scripts are easily
formed in SQL Server Management
Studio by defining the deployment
process, then codifying it and saving it
in an XMLA script. Once you have the
XMLA script in a saved file, you can
easily run the script according to a
schedule, or embed the script in an
application that connects directly to an
instance of Analysis Services.
Deployment Wizard Use the Deployment Wizard to use the Deploy Model Solutions Using the
XMLA output files generated by an Deployment Wizard
Analysis Services project to deploy the
project's metadata to a destination
server. With the Deployment Wizard,
you can deploy directly from the
Analysis Services file, as created by the
output directory by project build.
Deployment Utility The Deployment utility lets you start Deploy Model Solutions with the
the Analysis Services deployment Deployment Utility
engine from a command prompt.
METHOD DESCRIPTION LINK
Synchronize Database Wizard Use the Synchronize Database Wizard Synchronize Analysis Services
to synchronize the metadata and data Databases
between any two Analysis Services
databases.
Backup and Restore Backup offers the simplest approach to Backup and Restore of Analysis Services
transferring Analysis Services Databases
databases. From the Backup dialog
box, you can set the options
configuration, and then you can run
the backup from the dialog box itself.
Or, you can create a script that can be
saved and run as frequently as
required.
Related tasks
TASK DESCRIPTION
Deploy From SQL Server Data Tools Describes how to configure deployment properties and
deploy a tabular model project by using the Deploy
command in SQL Server Data Tools.
TASK DESCRIPTION
Deploy Model Solutions Using the Deployment Wizard Topics in this section describe how to use the Analysis
Services Deployment Wizard to deploy both tabular and
multidimensional model solutions.
Deploy Model Solutions with the Deployment Utility Describes how to use the Analysis Services Deployment
Utility to deploy tabular and multidimensional model
solutions.
Deploy Model Solutions Using XMLA Describes how to use XMLA to deploy Analysis Services
tabular and multidimensional solutions.
Synchronize Analysis Services Databases Describes how to use the Synchronize Database Wizard to
synchronize the metadata and data between any two
Analysis Services tabular or multidimensional databases.
See Also
Connect to a tabular model database
Deploy From SQL Server Data Tools
12/7/2018 • 2 minutes to read • Edit Online
NOTE
For models in cached mode, Query Mode is always In-Memory.
NOTE
You cannot specify Impersonation Settings for models in DirectQuery mode.
3. In Deployment Server, specify the Server (name), Edition, Database (name), and Cube Name property
settings, if different from the default settings, and then click OK.
NOTE
You can also specify the Default Deployment Server property setting so any new projects you create will automatically be
deployed to the specified server. For more information, see Configure default data modeling and deployment properties.
Deploy Status
The Deploy dialog box enables you to monitor the progress of a Deploy operation. A deploy operation can also
be stopped.
Status
Indicates whether the Deploy operation was successful or not.
Details
Lists the metadata items that were deployed, the status for each metadata item, and provides a message of any
issues.
Stop Deploy
Click to halt the Deploy operation. This option is useful if the Deploy operation is taking too long, or if there are
too many errors.
See also
Tabular model solution deployment
Configure default data modeling and deployment properties
Manage Deployed Tabular Model Databases
12/7/2018 • 2 minutes to read • Edit Online
In This Section
Process Database, Table, or Partition (Analysis Services)
Tabular Model Roles
Tabular Model Partitions
Connect to a tabular model database
Restore from Power Pivot
See also
Tabular Model Solutions
Move an Analysis Services Database
Synchronize Analysis Services Databases
Switch an Analysis Services database between ReadOnly and ReadWrite modes
Modify or Delete an Analysis Services Database
Document and Script an Analysis Services Database
Backup and Restore of Analysis Services Databases
Attach and Detach Analysis Services Databases
Process Database, Table, or Partition (Analysis
Services)
5/16/2018 • 3 minutes to read • Edit Online
Tasks
To process a database
1. In SQL Server Management Studio, right-click on the database you want to process, and then click Process
Database.
2. In the Process Database dialog box, in the Mode listbox, select one of the following process modes:
MODE DESCRIPTION
Process Full Processes a database and all the objects that it contains.
When Process Full is run for an object that has already
been processed, Analysis Services drops all data in the
object, and then processes the object. This kind of
processing is required when a structural change has been
made to an object. This option requires the most
resources.
3. In the Process checkbox column, select the partitions you want to process with the selected mode, and then
click Ok.
To process a table
1. In SQL Server Management Studio, in the tabular model database which contains the table you want to
process, expand the Tables node, then right-click on the table you want to process, and then click Process
Table.
2. In the Process Table dialog box, in the Mode listbox, select one of the following process modes:
MODE DESCRIPTION
Process Default Detects the process state of a table object, and performs
processing necessary to deliver unprocessed or partially
processed objects to a fully processed state. Data for
empty tables and partitions is loaded; hierarchies,
calculated columns, and relationships are built or rebuilt
(recalculated).
Process Full Processes a table object and all the objects that it
contains. When Process Full is run for an object that has
already been processed, Analysis Services drops all data in
the object, and then processes the object. This kind of
processing is required when a structural change has been
made to an object. This option requires the most
resources.
Process Clear Removes all data from a table and any table partitions.
3. In the table checkbox column, verify the table and optionally select any additional tables you want to
process, and then click Ok.
To process one or more partitions
1. In SQL Server Management Studio, right-click on the table that has the partitions you want to process, and
then click Partitions.
2. In the Partitions dialog box, in Partitions, click the Process button.
3. In the Process Partition dialog box, in the Mode listbox, select one of the following process modes:
MODE DESCRIPTION
Process Full Processes a partition object and all the objects that it
contains. When Process Full is run for an object that has
already been processed, Analysis Services drops all data in
the object, and then processes the object. This kind of
processing is required when a structural change has been
made to an object.
4. In the Process checkbox column, select the partitions you want to process with the selected mode, and then
click Ok.
See Also
Tabular Model Partitions
Create and Manage Tabular Model Partitions
Tabular Model Roles
12/7/2018 • 2 minutes to read • Edit Online
Related Tasks
TASK DESCRIPTION
Manage Roles by using SSMS Describes how to create roles, add and remove members from
a role, change permissions for a role, and add, edit, or remove
row-level filters by using DAX.
Manage Roles by using SSMS
12/7/2018 • 2 minutes to read • Edit Online
Re-deploying a tabular model project with roles defined by using Role Manager in SQL Server Data Tools will
overwrite roles defined in a deployed tabular model.
Cau t i on
Using SQL Server Management Studio to manage a tabular model workspace database while the model project is
open in SQL Server Data Tools (SSDT) may cause the Model.bim file to become corrupted. When creating and
managing roles for a tabular model workspace database, use Role Manager in SQL Server Data Tools.
To create a new role
1. In SQL Server Management Studio, expand the tabular model database for which you want to create a new
role, then right click on Roles, and then click New Role.
2. In the Create Role dialog box, in the Select a page window, click General.
3. In the general settings window, in the Name field, type a name for the role.
By default, the name of the default role will be incrementally numbered for each new role. It is
recommended you type a name that clearly identifies the member type, for example, Finance Managers or
Human Resources Specialists.
4. In Set the database permissions for this role, select one of the following permissions options:
PERMISSION DESCRIPTION
Full control (Administrator) Members can make modifications to the model schema
and can view all data.
Process database Members can run Process and Process All operations.
Cannot modify the model schema and cannot view data.
5. In the Create Role dialog box, in the Select a page window, click Membership.
6. In the membership settings window, click Add, and then in the Select Users or Groups dialog box, add the
Windows users or groups you want to add as members.
7. If the role you are creating has Read permissions, you can add row filters for any table using a DAX formula.
To add row filters, in the Role Properties - <rolename> dialog box, in Select a page, click on Row
Filters.
8. In the row filters window, select a table, then click on the DAX Filter field, and then in the DAX Filter -
<tablename> field, type a DAX formula.
NOTE
The DAX Filter - <tablename> field does not contain an AutoComplete query editor or insert function feature. To use
AutoComplete when writing a DAX formula, you must use a DAX formula editor in SQL Server Data Tools.
See Also
Roles
Tabular Model Partitions
12/7/2018 • 4 minutes to read • Edit Online
Benefits
Effective model design utilizes partitions to eliminate unnecessary processing and subsequent processor load on
Analysis Services servers, while at the same time, making certain that data is processed and refreshed often
enough to reflect the most recent data from data sources.
For example, a tabular model can have a Sales table which includes sales data for the current 2011 fiscal year and
each of the previous fiscal years. The model's Sales table has the following three partitions:
Sales2010-2001 Fiscal years 2001, 2002, 2003, 2004, 2005, 2006. 2007, 2008,
2009, 2010
As new sales data is added for the current 2011 fiscal year; that data must be processed daily to accurately be
reflected in current fiscal year sales data analysis, thus the Sales2011 partition is processed nightly.
There is no need to process data in the Sales2010-2001 partition nightly; however, because sales data for the
previous ten fiscal years can still occasionally change because of product returns and other adjustments, it must
still be processed regularly, thus data in the Sales2010-2001 partition is processed monthly. Data in the SalesOld
partition never changes therefore only processed annually.
When entering the 2012 fiscal year, a new Sales2012 partition is added to the mode's Sales table. The Sales2011
partition can then be merged with the Sales2010-2001 partition and renamed to Sales2011-2002. Data from the
2001 fiscal year is eliminated from the new Sales2011-2002 partition and moved into the SalesOld partition. All
partitions are then processed to reflect changes.
How you implement a partition strategy for your organization's tabular models will largely be dependent on your
particular model data processing needs and available resources.
Permissions
In order to create, manage, and process partitions in SQL Server Management Studio, you must have the
appropriate Analysis Services permissions defined in a security role. Each security role has one of the following
permissions:
PERMISSION ACTIONS
To learn more about creating roles during model authoring by using SQL Server Data Tools (SSDT), see Roles. To
learn more about managing role members for deployed tabular model roles by using SQL Server Management
Studio, see Tabular Model Roles.
Parallel Processing
Analysis Services includes parallel processing for tables with two or more partitions, increasing processing
performance. There are no configuration settings for parallel processing (see notes). Parallel processing occurs by
default when you Process Table or you select multiple partitions for the same table and Process. You can still
choose to process a tables partitions independently.
NOTE
To specify whether refresh operations run sequentially or in parallel, you can use the maxParallism property option with
the Sequence command (TMSL).
NOTE
If re-encoding is detected, parallel processing can cause increased use of system resources. This is because multiple partition
operations need to be interrupted and re-started with the new encoding in-parallel.
Process Partitions
Partitions can be processed (refreshed) independent of other partitions by using the Partitions dialog box in
Management Studio or by using a script. Processing has the following options:
MODE DESCRIPTION
Process Default Detects the process state of a partition object, and performs
processing necessary to deliver unprocessed or partially
processed partition objects to a fully processed state. Data for
empty tables and partitions is loaded; hierarchies, calculated
columns, and relationships are built or rebuilt.
MODE DESCRIPTION
Process Full Processes a partition object and all the objects that it
contains. When Process Full is run for an object that has
already been processed, Analysis Services drops all data in the
object, and then processes the object. This kind of processing
is required when a structural change has been made to an
object.
Related Tasks
TASK DESCRIPTION
Create and Manage Tabular Model Partitions Describes how to create and manage partitions in a deployed
tabular model by using SQL Server Management Studio.
Process Tabular Model Partitions Describes how to process partitions in a deployed tabular
model by using SQL Server Management Studio.
Create and manage tabular model partitions
5/16/2018 • 2 minutes to read • Edit Online
NOTE
Partitions in tabular models created at the 1400 compatibility level are defined using an M query statement. To learn more,
see M Reference.
Tasks
To create and manage partitions for a deployed tabular model database, you will use the Partitions dialog box in
SQL Server Management Studio. To view the Partitions dialog box, in SQL Server Management Studio, right-
click on a table, and then click Partitions.
To create a new partition
1. In the Partitions dialog box, click the New button.
2. In Partition Name, type a name for the partition. By default, the name of the default partition will be
incrementally numbered for each new partition.
3. In Query Statement, type or paste a SQL or M query statement that defines the columns and any clauses
you want to include in the partition into the query window.
4. To validate the statement, click Check Syntax.
To copy a partition
1. In the Partitions dialog box, in the Partitions list, select the partition you want to copy, and then click the
Copy button.
2. In Partition Name, type a new name for the partition.
3. In Query Statement, edit the query statement.
To merge two or more partitions
In the Partitions dialog box, in the Partitions list, use Ctrl+click to select the partitions you want to merge,
and then click the Merge button.
IMPORTANT
Merging partitions does not update the partition metadata. You must edit the SQL or M statement for the resulting
partition to make sure processing operations process all data in the merged partition.
To delete a partition
In the Partitions dialog box, in the Partitions list, select the partition you want to delete, and then click the
Delete button.
See also
Tabular model partitions
Process tabular model partitions
Process Tabular Model Partitions
12/7/2018 • 2 minutes to read • Edit Online
MODE DESCRIPTION
Process Full Processes a partition object and all the objects that it
contains. When Process Full is run for an object that has
already been processed, Analysis Services drops all data in
the object, and then processes the object. This kind of
processing is required when a structural change has been
made to an object.
4. In the Process checkbox column, select the partitions you want to process with the selected mode, and then
click Ok.
See Also
Tabular Model Partitions
Create and Manage Tabular Model Partitions
Connect to a tabular model database
12/7/2018 • 6 minutes to read • Edit Online
NOTE
By default, remote connections to Analysis Services are not available until you configure the firewall. Be sure that you have
opened the appropriate port if you are configuring a named or default instance for client connections. For more information,
see Configure the Windows Firewall to Allow Analysis Services Access.
Re-deploying a tabular model project with roles defined by using Role Manager in SQL Server Data Tools will
overwrite roles defined in a deployed tabular model.
See also
Tabular model solution deployment
Restore from Power Pivot
12/7/2018 • 2 minutes to read • Edit Online
NOTE
The Import from Power Pivot project template in SQL Server Data Tools provides similar functionality. For more information,
see Import from Power Pivot.
When using Restore from Power Pivot, keep the following in mind:
In order to use Restore from Power Pivot, you must be logged on as a member of the Server Administrators
role on the Analysis Services instance.
The Analysis Services instance service account must have Read permissions on the workbook file you are
restoring from.
By default, when you restore a database from Power Pivot, the Tabular model database Data Source
Impersonation Info property is set to Default, which specifies the Analysis Services instance service account.
It is recommended you change the impersonation credentials to a Windows user account in Database
Properties. For more information, see Impersonation.
Data in the Power Pivot data model will be copied into an existing or new Tabular model database on the
Analysis Services instance. If your Power Pivot workbook contains linked tables, they will be recreated as a
table without a data source, similar to a table created using Paste To New table.
To Restore from Power Pivot
1. In SSMS, in the Active Directory instance you want to restore to, right click Databases, and then click
Restore from Power Pivot.
2. In the Restore from Power Pivot dialog box, in Restore Source, in Backup file, click Browse, and then
select an .abf or .xslx file to restore from.
3. In Restore Target, in Restore database, type a name for a new database or for an existing database. If you
do not specify a name, the name of the workbook is used.
4. In Storage location, click Browse, and then select a location to store the database.
5. In Options, leave Include security information checked. When restoring from a Power Pivot workbook,
this setting does not apply.
See Also
Tabular Model Databases
Import from Power Pivot
Multidimensional models
5/16/2018 • 2 minutes to read • Edit Online
In This Section
Multidimensional Model Solutions
Multidimensional Model Databases
Processing a multidimensional model (Analysis Services)
Roles and Permissions (Analysis Services)
Power View for Multidimensional Models
Multidimensional Model Assemblies Management
Multidimensional Model Solutions (SSAS)
5/16/2018 • 2 minutes to read • Edit Online
In This Section
The following topics provide guidance on designing Analysis Services multidimensional database objects.
Multidimensional Model Databases
Describes how to define an Analysis Services database.
Supported Data Sources (SSAS - Multidimensional)
Describes how to define Analysis Services data source objects.
Data Source Views in Multidimensional Models
Describes how to design Analysis Services data source views.
Dimensions in Multidimensional Models
Describes how to design Analysis Services dimension objects.
Cubes in Multidimensional Models
Describes how to design Analysis Services cube objects.
Schema Generation Wizard (Analysis Services)
Describes how to design multidimensional database objects without an existing relational schema.
Analysis Services Personalization Extensions
Describes how to design Personalization Extensions for SQL Server 2008 Analysis Services.
Creating Multidimensional Models Using SQL Server
Data Tools (SSDT)
5/16/2018 • 6 minutes to read • Edit Online
PROJECT DESCRIPTION
Analysis Services Project Contains the object definitions for a single Analysis Services
database. For more information about how to create an
Analysis Services project, see Create an Analysis Services
Project (SSDT).
Import Analysis Services 2008 Database Provides a wizard that you can use to create a new Analysis
Services project by importing object definitions from an
existing Analysis Services database.
Integration Services Project Contains the object definitions for a set of Integration Services
packages. For more information, see SQL Server Integration
Services.
Report Project Wizard Provides a wizard that guides you through the process of
creating a Report project using Reporting Services. For more
information, see Reporting Services (SSRS).
Report Model Project Contains the object definitions for a Reporting Services report
model. For more information, see Reporting Services (SSRS).
Report Server Project Contains the object definitions for one or more Reporting
Services reports. For more information, see Reporting Services
(SSRS).
SQL Server Management Studio also contains several project types that focus on various queries or scripts, as
shown in the following table.
PROJECT DESCRIPTION
Analysis Services Scripts Contains DMX, MDX, and XMLA scripts for Analysis Services,
as well as connections to Analysis Services instances against
which these scripts can be executed. For more information,
see Analysis Services Scripts Project in SQL Server
Management Studio.
SQL Server Compact Scripts Contains SQL scripts for SQL Server Compact, as well as
connections to SQL Server Compact instances against which
these scripts can be executed.
SQL Server Scripts Contains Transact-SQL and XQuery scripts for a SQL Server
Database Engine instance, as well as connections to SQL
Server Database Engine instances against which these scripts
can be executed. For more information, see SQL Server
Database Engine.
For more information about solutions and projects, see "Managing Solutions, Projects, and Files," either in the
Microsoft Visual Studio .NET documentation or in the MSDN Library.
In This Section
Create an Analysis Services Project (SSDT)
Configure Analysis Services Project Properties (SSDT)
Build Analysis Services Projects (SSDT)
Deploy Analysis Services Projects (SSDT)
Working with Analysis Services Projects and Databases During the Development Phase
Working with Analysis Services Projects and Databases in a Production Environment
See Also
Create an Analysis Services Project (SSDT)
Analysis Services Scripts Project in SQL Server Management Studio
Multidimensional Model Databases
Create an Analysis Services Project (SSDT)
11/28/2018 • 10 minutes to read • Edit Online
NOTE
By default, SQL Server Data Tools (SSDT) processes only objects changed by the deployment script and dependent objects
when deploying a solution. You can change this functionality by using the Property Pages dialog box for the Analysis
Services project to change the Processing Option configuration property.
Build and deploy the solution to an instance of Analysis Services for testing. Building a solution validates the
object definitions and dependencies in the project and generates a deployment script. Deploying a solution uses
the Analysis Services deployment engine to send the deployment script to a specified instance.
After you deploy the project, review and test the deployed database. You can then modify object definitions, build,
and deploy again until the project is complete.
After the project is complete, you can use the Deployment Wizard to deploy the deployment script, generated
when you build the solution, to destination instances for final testing, staging, and deployment.
FOLDER DESCRIPTION
Data Sources Contains data sources for an Analysis Services project. You
create these objects with the Data Source Wizard and edit
them in Data Source Designer.
Data Source Views Contains data source views for an Analysis Services project.
You create these objects with the Data Source View Wizard
and edit them in Data Source View Designer.
Miscellaneous Contains any type of file except for Analysis Services file
types. Use this folder to add any miscellaneous files, such as
text files that contain notes on the project.
NOTE
Copying a file for an object to a project folder does not add the object to the project. You must use the Add command
from the project's context menu in SQL Server Data Tools (SSDT) to add an existing object definition to a project.
The project folder for an Analysis Services project can contain the file types listed in the following table.
Analysis Services project definition file (.dwproj) Contains metadata about the items, configurations, and
assembly references defined and included in the Analysis
Services project.
Analysis Services project user settings (.dwproj.user) Contains configuration information for the Analysis Services
project, for a specific user.
Data source file (.ds) Contains Analysis Services Scripting Language (ASSL)
elements that define metadata for a data source.
Data source view file (.dsv) Contains ASSL elements that define metadata for a data
source view.
Cube file (.cube) Contains ASSL elements that define metadata for a cube,
including measure groups, measures, and cube dimensions.
Partition file (.partitions) Contains ASSL elements that define metadata for the
partitions of a specified cube.
Dimension file (.dim) Contains ASSL elements that define metadata for a database
dimension.
Mining structure file (.dmm) Contains ASSL elements that define metadata for a mining
structure and associated mining models.
FILE TYPE DESCRIPTION
Database file (.database) Contains ASSL elements that define metadata for a database,
including account types, translations, and database
permissions.
Database role file (.role) Contains ASSL elements that define metadata for a database
role, including role members.
Analysis Services Project Items Cube Starts the Cube Wizard to add a new
cube to the Analysis Services project.
See Also
Configure Analysis Services Project Properties (SSDT)
Build Analysis Services Projects (SSDT)
Deploy Analysis Services Projects (SSDT)
Configure Analysis Services Project Properties
(SSDT)
12/20/2018 • 3 minutes to read • Edit Online
Property Description
The following table describes each project property, lists its default value, and provides information about
changing its value.
Build / Deployment Server Edition The SQL Server edition used to develop Specifies the edition of the server to
the project which projects will finally be deployed.
When working with multiple
developers on a project, developers
need to understand the server edition
to know which features to incorporate
into the Analysis Services project.
Build / Deployment Server Version The version used to develop the Specifies the version of the server to
projects which projects will finally be deployed.
Build / Outputs /bin The relative path for the output of the
project build process
Debugging / Start Object <Currently Active Object> Determines that object that will be
started when you start debugging.
PROPERTY DEFAULT SETTING DESCRIPTION
Deployment / Deployment Mode Deploy Changes Only By default, only changes to project
objects are deployed (provided that no
other changes were made to the
objects directly outside of the project).
You can also choose to have all project
objects deployed during each
deployment. For best performance, use
Deploy Changes Only.
Property Configurations
Properties are defined on a per configuration basis. Project configurations enable developers to work with an
Analysis Services project with different build, debugging, and deployment settings without editing the
underlying XML project files directly.
A project is initially created with a single configuration, called Development. You can create additional
configurations and switch between configurations using the Configuration Manager.
Until additional configurations are created, all developers use this common configuration. However, during the
various phases of project development - such as during the initial development and testing of a project -
different developers will may use different data sources and deploy the project to different servers for different
purposes. Configurations enable you to retain these different settings in different configuration files.
See Also
Build Analysis Services Projects (SSDT)
Deploy Analysis Services Projects (SSDT)
Build Analysis Services Projects (SSDT)
10/26/2018 • 3 minutes to read • Edit Online
Building a Project
When you build an Analysis Services project, SQL Server Data Tools (SSDT) will build a complete set of XML files
in the output folder containing all of the necessary ASSL commands needed to build all of the Analysis Services
database objects in the project. If the project was previously built and incremental deployment specified for the
active configuration, SQL Server Data Tools (SSDT) will also build an XML file containing the ASSL commands to
perform an incremental update to the deployed objects. This XML file is written to the ..\obj\<active
configuration> folder for the project. Incremental builds can save time when deploying and processing a very
large project or database.
NOTE
You can use the Rebuild All command to ignore the incremental deployment setting.
Building an Analysis Services project validates the object definitions in the project. The validation includes any
referenced assemblies. Build errors appear in the Task List window, along with the Analysis Management Objects
(AMO ) error text. You can click an error to open the designer that is required to fix the error.
Successful validation does not guarantee that objects can be created on the destination server during deployment
or processed successfully after deployment. The following issues can prevent successful deployment or
processing after deployment:
Security checks for the server are not performed, so locks can prevent deployment.
Physical locations are not validated on the server.
Details of data source views are not checked against the actual data source on the destination server.
If validation is successful, SQL Server Data Tools (SSDT) generates the XML files. After the build, the output
folder will contain the files described in the following table.
Projectname.asdatabase Contains the ASSL elements that define metadata for the
objects in the Analysis Services project in a deployment script
file. This file is used by the deployment engine to deploy the
objects to an Analysis Services database.
FILES (IN BIN FOLDER) DESCRIPTION
<Configuration Name>\LastBuilt.xml Contains the time stamp and hash code that identifies the
last time the Analysis Services project was built.
These XML files do not contain <Create> and <Alter> tags, which are constructed during deployment.
Referenced assemblies (excluding standard system and Analysis Services assemblies) are also copied to the
output directory. When references are to other projects in a solution, those projects are built first, using the
appropriate project configuration and build dependencies established by the project references, and then are
copied to the project output folder.
See Also
Analysis Services Scripting Language (ASSL for XMLA)
Deploy Analysis Services Projects (SSDT)
Deploy Analysis Services Projects (SSDT)
5/16/2018 • 2 minutes to read • Edit Online
Deploying a Project
You can deploy a project independently, or you can deploy all of the projects within the solution. When you
deploy a project, several things happen in sequence. First, the project is built. This step creates the output files
that define the Analysis Services database and its constituent objects. Next, the destination server is validated.
Finally, the destination database and its objects are created on the destination server. During deployment, the
deployment engine totally replaces any pre-existing database with the contents of the project unless those
objects were created by the project during a previous deployment.
After an initial deployment, an IncrementalSnapshot.xml file is generated in the <Project Name>\obj folder. This
file is used to determine if the database or its objects on the destination server have changed outside of the
project. If so, you will be prompted to overwrite all objects in the destination database. If all changes were made
within the project and the project is configured for incremental deployment, only the changes will be deployed
to the destination server.
The project configuration and its associated settings determine the deployment properties that will be used to
deploy the project. For a shared project, each developer can use their own configuration with their own project
configuration options. For example, each developer can specify a different test server to work in isolation from
other developers.
See Also
Create an Analysis Services Project (SSDT)
Create and Run an MDX Script in SQL Server Data
Tools
5/16/2018 • 2 minutes to read • Edit Online
See Also
The Basic MDX Script (MDX)
MDX Scripting Fundamentals (Analysis Services)
MDX Scripting Statements (MDX)
View the XML for an Analysis Services Project (SSDT)
5/16/2018 • 2 minutes to read • Edit Online
NOTE
You cannot view the xml code for an entire project, but rather you view the code for each object because a separate file exists
for each object. The only way to view the code for an entire project is to build the project and view the ASSL code in the
<project name>.asdatabase file.
See Also
Build Analysis Services Projects (SSDT)
Connect in Online Mode to an Analysis Services
Database
5/16/2018 • 2 minutes to read • Edit Online
See Also
Working with Analysis Services Projects and Databases During the Development Phase
Creating Multidimensional Models Using SQL Server Data Tools (SSDT)
Work with Analysis Services Projects and Databases
in Development
5/16/2018 • 2 minutes to read • Edit Online
Single Developer
When only a single developer is developing the entire Analysis Services database and all of its constituent objects,
the developer can use SQL Server Data Tools (SSDT) in either project mode or online mode at any time during
the lifecycle of the business intelligence solution. In the case of a single developer, the choice of modes is not
particularly critical. The maintenance of an offline project file integrated with a source control system has many
benefits, such as archiving and rollback. However, with a single developer you will not have the problem of
communicating changes with another developer.
Multiple Developers
When multiple developers are working on a business intelligence solution, problems will arise if the developers do
not work in project mode with source control under most, if not all circumstances. Source control ensures that two
developers are not making changes to the same object at the same time.
For example, suppose a developer is working in project mode and making changes to selected objects. While the
developer is making these changes, suppose that another developer makes a change to the deployed database in
online mode. A problem will arise when the first developer attempts to deploy his or her modified Analysis
Services project. Namely, SQL Server Data Tools (SSDT) will detect that objects have changed within the deployed
database and prompt the developer to overwrite the entire database, overwriting the changes of the second
developer. Since SQL Server Data Tools (SSDT) has no means of resolving the changes between the Analysis
Services database instance and the objects in the project about to be overwritten, the only real choice the first
developer has is to discard all of his or her changes and starting anew from a new project based on the current
version of the Analysis Services database.
Work with Analysis Services Projects and Databases
in Production
5/16/2018 • 2 minutes to read • Edit Online
Supported Data Sources (SSAS - Multidimensional) Describes the types of data sources that can be used in a
multidimensional model.
Create a Data Source (SSAS Multidimensional) Explains how to add a data source object to a
multidimensional model.
Delete a Data Source in Solution Explorer (SSAS Use this procedure to delete a data source object from a
Multidimensional) multidimensional model.
Set Data Source Properties (SSAS Multidimensional) Describes each property and explains how to set each one.
TOPIC DESCRIPTION
Set Impersonation Options (SSAS - Multidimensional) Explains how to configure options in the Impersonation
Information dialog box.
See Also
Database Objects (Analysis Services - Multidimensional Data)
Logical Architecture (Analysis Services - Multidimensional Data)
Data Source Views in Multidimensional Models
Data Sources and Bindings (SSAS Multidimensional)
Supported Data Sources (SSAS - Multidimensional)
5/16/2018 • 2 minutes to read • Edit Online
NOTE
Third party providers, such as the Oracle OLE DB Provider, may also be used to connect to third party databases, with
support provided by those third parties.
Access databases Microsoft Access 2010, .accdb or .mdb Microsoft Jet 4.0 OLE DB
2013, 2016 provider
SQL Server relational Microsoft SQL Server 2008, (not applicable) OLE DB Provider for SQL
databases* 2008 R2, 2012, 2014, 2016, Server
Azure SQL Database, Azure
SQL Data Warehouse, SQL Server Native Client
Microsoft Analytics Platform OLE DB Provider
System (APS)
SQL Server Native 11.0
Client OLE DB Provider
Oracle relational databases Oracle 9i, 10g, 11g, 12g (not applicable) Oracle OLE DB Provider
OraOLEDB
MSDASQL
Teradata relational Teradata V2R6, V12 (not applicable) TDOLEDB OLE DB provider
databases
.Net Data Provider for
Teradata
See Also
Data Sources Supported
Data Sources in Multidimensional Models
Data Source Views in Multidimensional Models
Create a Data Source (SSAS Multidimensional)
11/27/2018 • 12 minutes to read • Edit Online
NOTE
By default, SQL Server Data Tools (SSDT) does not save passwords with the connection string. If the password is not saved,
Analysis Services prompts you to enter the password when it is needed. If you choose to save the password, the password
is stored in encrypted format in the data connection string. Analysis Services encrypts password information for data
sources using the database encryption key of the database that contains the data source. With encrypted connection
information, you must use SQL Server Configuration Manager to change the Analysis Services service account or password
or the encrypted information cannot be recovered. For more information, see SQL Server Configuration Manager.
IMPORTANT
Connection Manager includes a Save my password checkbox for connections that use SQL Server
authentication. Although the checkbox is always visible, it is not always used.
Conditions under which Analysis Services does not use this checkbox include refreshing or processing the
SQL Server relational data used in active Analysis Services database. Regardless of whether you clear or
select Save my password, Analysis Services will always encrypt and save the password. The password is
encrypted and stored in both .abf and data files. This behavior exists because Analysis Services does not
support session-based password storage on the server.
This behavior only applies to databases that a) are persisted on an Analysis Services server instance, and b)
use SQL Server authentication to refresh or process relational data. It is does not apply to data source
connections that you set up in SQL Server Data Tools (SSDT) that are used only for the duration of a session.
While there is no way to remove a password that is already stored, you can use different credentials, or
Windows authentication, to overwrite the user information that is currently stored with the database.
c. Select or enter a database name or Attach a database file are used to specify the database.
d. In the left side of the dialog box, click All to view additional settings for this connection, including all
default settings for this provider.
e. Change settings as appropriate for your environment and then click OK.
The new connection appears in the Data Connection pane of the Select how to define the
connection page of the Data Source Wizard.
6. Click Next.
7. In Impersonation Information, specify the Windows credentials or user identity that Analysis Services
will use when connecting to the external data source. If you are using database authentication, these
settings are ignored for connection purposes.
Guidelines for choosing an impersonation option vary depending on how you are using the data source.
For processing tasks, the Analysis Services service must run in the security context of its service account or
a specified user account when connecting to a data source.
Use a specific Windows user name and password to specify a unique set of least privilege
credentials.
Use the service account to process the data using the service identity.
The account you specify must have Read permissions on the data source.
8. Click Next. In Completing the Wizard, enter a data source name or use the default name. The default
name is the name of the database specified in the connection. The Preview pane displays the connection
string for this new data source.
9. Click Finish. The new data source appears in the Data Sources folder in Solution Explorer.
NOTE
If multiple data sources are defined and data is queried from multiple sources in a single query, such as for a snow-flaked
dimension, you must define a data source that supports remote queries using OpenRowset. Typically, this will be a
Microsoft SQL Server data source.
See Also
Supported Data Sources (SSAS - Multidimensional)
Data Source Views in Multidimensional Models
Delete a Data Source in Solution Explorer (SSAS
Multidimensional)
5/16/2018 • 2 minutes to read • Edit Online
IMPORTANT
Data sources on which other objects depend cannot be deleted from an Analysis Services database opened by SQL Server
Data Tools (SSDT) in online mode. You must delete all objects in the Analysis Services database that depend on that data
source before deleting the data source. For more information about online mode, see Connect in Online Mode to an Analysis
Services Database.
See Also
Data Sources in Multidimensional Models
Supported Data Sources (SSAS - Multidimensional)
Set Data Source Properties (SSAS Multidimensional)
5/16/2018 • 4 minutes to read • Edit Online
Name, ID, Description Name, ID, and Description are used to identify and describe
the data source object in the multidimensional model.
<Hours>:<Minutes>:<Seconds>
Connection String Specifies the physical location of a database that provides data
to a multidimensional model, and the data provider used for
the connection. This information is provided to a client library
making the connection request. The provider determines
which properties can be set on the connection string.
Impersonation Info Specifies the Windows identity that Analysis Services runs
under when connecting to a data source that uses Windows
authentication. Options include using a predefined set of
Windows credentials, the service account, the identity of the
current user, or an inherit option that can be useful if your
model contains multiple data source objects. For more
information, see Set Impersonation Options (SSAS -
Multidimensional).
See Also
Data Sources in Multidimensional Models
Create a Data Source (SSAS Multidimensional)
Set Impersonation Options (SSAS -
Multidimensional)
11/28/2018 • 5 minutes to read • Edit Online
Impersonation options
All options are available in the dialog box, but not all options are appropriate for every scenario. Use the
following information to determine the best option for your scenario.
Use a specific user name and password
Select this option to have the Analysis Services object use the security credentials of a Windows user account
specified in this format: <Domain name>\<User account name>.
Choose this option to use a dedicated, least-privilege Windows user identity that you have created specifically for
data access purposes. For example, if you routinely create a general purpose account for retrieving data used in
reports, you can specify that account here.
For multidimensional databases, the specified credentials will be used for processing, ROLAP queries, out-of-line
bindings, local cubes, mining models, remote partitions, linked objects, and synchronization from target to
source.
For DMX OPENQUERY statements, this option is ignored and the credentials of the current user will be used
rather than the specified user account.
Use the service account
Select this option to have the Analysis Services object use the security credentials associated with the Analysis
Services service that manages the object. This is the default option. In previous releases, this was the only option
you could use. You might prefer this option to monitor data access at the service level rather than individual user
accounts.
In SQL Server 2017, depending on the operating system you are using, the service account might be
NetworkService or a built-in virtual account created for a specific Analysis Services instance. If you choose the
service account for a connection that uses Windows authentication, remember to create a database login for this
account and grant read permissions, as it will be used to retrieve data during processing. For more information
about the service account, see Configure Windows Service Accounts and Permissions.
NOTE
When using database authentication, you should choose the Use the service account impersonation option if the service
is running under the dedicated virtual account for Analysis Services. This account will have permissions to access local files.
If the service runs as NetworkService, a better alternative is to use a least privilege Windows user account that has Allow
log on locally permissions. Depending on the account you provide, you might also need to grant file access permissions
on the Analysis Services program folder.
For multidimensional databases, the service account credentials will be used for processing, ROLAP queries,
remote partitions, linked objects, and synchronization from target to source.
For DMX OPENQUERY statements, local cubes, and mining models, the credentials of the current user will be
used even if you choose the service account option. The service account option is not supported for out-of-line
bindings.
NOTE
Errors can occur when processing a data mining model from a cube if the service account does not have administrator
permissions on the Analysis Services instance. For more information, see Mining Structure: Issue while Processing when
DataSource is OLAP Cube.
See Also
Create a Data Source (SSAS Multidimensional)
Set Data Source Properties (SSAS Multidimensional)
Data Source Views in Multidimensional Models
5/16/2018 • 2 minutes to read • Edit Online
Related Tasks
Defining a Data Source View (Analysis Services)
Adding or Removing Tables or Views in a Data Source View (Analysis Services)
Change Properties in a Data Source View (Analysis Services)
Define Logical Relationships in a Data Source View (Analysis Services)
Define Logical Primary Keys in a Data Source View (Analysis Services)
Define Named Calculations in a Data Source View (Analysis Services)
Define Named Queries in a Data Source View (Analysis Services)
Replace a Table or a Named Query in a Data Source View (Analysis Services)
Work with Diagrams in Data Source View Designer (Analysis Services)
Explore Data in a Data Source View (Analysis Services)
Delete a Data Source View (Analysis Services)
Refresh the Schema in a Data Source View (Analysis Services)
See Also
Schema Generation Wizard (Analysis Services)
Supported Data Sources (SSAS - Multidimensional)
Data Sources and Bindings (SSAS Multidimensional)
11/28/2018 • 13 minutes to read • Edit Online
BigInt A 64-bit signed integer. This data type maps to the Int64 data
type inside Microsoft .NET Framework and the DBTYPE_I8
data type inside OLE DB.
Bool A Boolean value. This data type maps to the Boolean data
type inside the .NET Framework and the DBTYPE_BOOL data
type inside OLE DB.
Integer A 32-bit signed integer. This data type maps to the Int32 data
type inside the .NET Framework and the DBTYPE_I4 data type
inside OLE DB.
SmallInt A 16-bit signed integer. This data type maps to the Int16 data
type inside the .NET Framework and the DBTYPE_I2 data type
inside OLE DB.
TinyInt An 8-bit signed integer. This data type maps to the SByte data
type inside the .NET Framework and the DBTYPE_I1 data type
inside OLE DB.
UnsignedBigInt A 64-bit unsigned integer. This data type maps to the UInt64
data type inside .NET Framework and the DBTYPE_UI8 data
type inside OLE DB.
UnsignedInt A 32-bit unsigned integer. This data type maps to the UInt32
data type inside the .NET Framework and the DBTYPE_UI4
data type inside OLE DB.
UnsignedSmallInt A 16-bit unsigned integer. This data type maps to the UInt16
data type inside the .NET Framework and the DBTYPE_UI2
data type inside OLE DB.
All data that is received from the data source is converted to the SSAS type specified in the binding (usually
during processing). An error is raised if the conversion cannot be performed (for example, String to Int). SQL
Server Data Tools (SSDT) usually sets the data type in the binding to the one that best matches the source type in
the data source. For example, the SQL types Date, DateTime, SmallDateTime, DateTime2, DateTimeOffset are
mapped to SSAS Date, and the SQL type Time is mapped to String.
Bindings for Dimensions
Each attribute of a dimension is bound to a column in a DSV. All the attributes of a dimension must come from a
single data source. However, the attributes can be bound to columns in different tables. The relationships between
the tables are defined in the DSV. In the case where more than one set of relationships exists to the same table, it
might be necessary to introduce a named query in the DSV to act as an 'alias' table. Expressions and filters are
defined in the DSV by using named calculations and named queries.
Product(ProductID, ProductName,Category)
``
Relation: Sales.OrderedProductID -> Product.ProductID
``
If you analyze by the ordered product, for the Ordered Product on Sales dimension role, the Product granularity
attribute would be bound to Sales.OrderedProductID.
However, there may be times when the GranularityAttributes might not exist as columns on the fact table. For
example, the GranularityAttributes might not exist as columns in the following circumstances:
The OLAP granularity is coarser than the granularity in the source.
An intermediate table interposes between the fact table and the dimension table.
The dimension key is not the same as the primary key in the dimension table.
In all such cases, the DSV must be defined so that the GranularityAttributes exist on the fact table. For example, a
named query or calculated column can be introduced.
For example, in the same example tables as above, if the granularity were by Category, then a view of the Sales
could be introduced:
SalesWithCategory(RequestedDate, OrderedProductID, ReplacementProductID, Qty, OrderedProductCategory)
ON Sales.OrderedProductID = Product.ProductID
``
In this case, the GranularityAttribute Category is bound to SalesWithCategory.OrderedProductCategory.
Migrating from Decision Support Objects
Decision Support Objects (DSO ) 8.0 allows PartitionMeasures to be rebound. Therefore, the migration strategy
in these cases is to construct the appropriate query.
Similarly, it is not possible to rebind the dimension attributes within a partition, although DSO 8.0 allows this
rebinding also. The migration strategy in these cases is to define the necessary named queries in the DSV so that
the same tables and columns exist in the DSV for the partition as the tables and columns that are used for the
dimension. These cases may require the adoption of the simple migration, in which the From/Join/Filter clause is
mapped to a single named query rather than to a structured set of related tables. As DSO 8.0 allows
PartitionDimensions to be rebound even when the partition is using the same data source, migration may also
require multiple DSVs for the same data source.
In DSO 8.0, the corresponding bindings can be expressed in two different ways, depending on whether optimized
schemas are employed, by binding to either the primary key on the dimension table or the foreign key on the fact
table. In ASSL, the two different forms are not distinguished.
The same approach to bindings applies even for a partition using a data source that does not contain the
dimension tables, because the binding is made to the foreign key column in the fact table, not to the primary key
column in the dimension table.
Out-of-Line Bindings
Out-of-Line bindings enable you to temporarily change the existing data bindings for the duration of a command.
Out-of-line bindings refer to bindings that are included in a command and are not persisted. Out-of-line bindings
apply only while that particular command executes. In contrast, inline bindings are contained in the ASSL object
definition, and persist with the object definition within server metadata.
ASSL allows out-of-line bindings to be specified on either a Process command, if it is not in a batch, or on a
Batch command. If out-of-line bindings are specified on the Batch command, all bindings specified in the Batch
command create a new binding context in which all Process commands of the batch run. This new binding context
includes objects that are indirectly processed because of the Process command.
When out-of-line bindings are specified on a command, they override the inline bindings contained in the
persisted DDL for the specified objects. These processed objects may include the object directly named in the
Process command, or they may include other objects whose processing is automatically initiated as a part of the
processing.
Out-of-line bindings are specified by including the optional Bindings collection object with the processing
command. The optional Bindings collection contains the following elements.
All elements that relate to out-of-line bindings are optional. For any elements not specified, ASSL uses the
specification contained in the DDL of the persisted object. Specification of DataSource or DataSourceView in
the Process command is optional. If DataSource or DataSourceView are specified, they are not instantiated
and do not persist after the Process command has completed.
Definition of the Out-of-line Binding Type
Inside the out-of-line Bindings collection, ASSL allows a collection of bindings for multiple objects, each a
Binding. Each Binding has an extended object reference, which is similar to the object reference, but it can refer
to minor objects as well (for example, dimension attributes and measure group attributes). This object takes the
flat form typical of the Object element in Process commands, except that the <Object></Object> tags are not
present.
Each object for which the binding is specified is identified by an XML element of the form <object>ID (for
example, DimensionID ). After you have identified the object as specifically as possible with the form <object>ID,
then you identify the element for which the binding is being specified, which is usually Source. A common case to
note is that in which Source is a property on the DataItem, which is the case for column bindings in an attribute.
In this case, you do not specify the DataItem tag; instead, you simply specify the Source property, as if it were
directly on the column to be bound.
KeyColumns are identified by their ordering inside the KeyColumns collection. There it is not possible to specify,
for example, only the first and third key columns of an attribute, because there is no way to indicate that the
second key column is to be skipped. All of the key columns must be present in the out-of-line binding for a
dimension attribute.
Translations, although they have no ID, are semantically identified by their language. Therefore, the Translations
inside a Binding need to include their language identifier.
One additional element allowed within a Binding that does not exist directly in the DDL is ParentColumnID,
which is used for nested tables for data mining. In this case, it is necessary to identify the parent column in the
nested table for which the binding is being provided.
Defining a Data Source View (Analysis Services)
11/28/2018 • 8 minutes to read • Edit Online
NOTE
Alternatively, you can construct dimensions and cubes first, and then generate a DSV for the model using the Schema
Generation wizard. For more information, see Schema Generation Wizard (Analysis Services).
1. In Solution Explorer, right-click the Data Source Views folder and then click New Data Source View.
2. Specify a new or existing data source object that provides connection information to an external relational
database (you can only select one data source in the wizard).
3. On the same page, click Advanced to choose specific schemas, apply a filter, or exclude table relationship
information.
Choose Schemas
For very large data sources containing multiple schemas, you can select which schemas to use in a comma
delimited list, with no spaces.
Retrieve Relationships
You can purposely omit table relationship information by clearing the Retrieve relationships checkbox in
the Advanced Data Source View Options dialog box, allowing you to manually create relationships between
tables in the Data Source View Designer.
4. Filter Available Objects
If the Available objects list contains a very large number of objects, you can reduce the list by applying a
simple filter that species a string as selection criteria. For example, if you type dbo and click the Filter
button, then only those items starting with "dbo" show up in the Available objects list. The filter can be a
partial string (for example, "sal" returns sales and salary) but it cannot include multiple strings or operators.
5. For relational data sources that do not have table relationships defined, a Name Matching page appears
so that you can select the appropriate name matching method. For more information, see the Specify Name
Matching Criteria for Relationships section in this topic.
NOTE
You are prompted to provide name matching criteria only if no foreign key relationships are detected in the underlying data
source. If foreign key relationships are detected, then the detected relationships are used and you must manually define any
additional relationships you want to include in the DSV, including logical primary keys. For more information, see Define
Logical Relationships in a Data Source View (Analysis Services) and Define Logical Primary Keys in a Data Source View
(Analysis Services).
The Data Source View Wizard uses your response to match column names and create relationships between
different tables in the DSV. You can specify any one of the criteria listed in the following table.
Same name as primary key The foreign key column name in the source table is the same
as the primary key column name in the destination table. For
example, the foreign key column Order.CustomerID is the
same as the primary key column Customer.CustomerID .
Same name as destination table name The foreign key column name in the source table is the same
as the name of the destination table. For example, the foreign
key column Order.Customer is the same as the primary key
column Customer.CustomerID .
NAME MATCHING CRITERIA DESCRIPTION
Destination table name + primary key name The foreign key column name in the source table is the same
as the destination table name concatenated with the primary
key column name. A space or underscore separator is
permissible. For example, the following foreign-primary key
pairs all match:
The criteria you select changes the NameMatchingCriteria property setting of the DSV. This setting determines
how the wizard adds related tables. When you change the data source view with Data Source View Designer, this
specification determines how the designer matches columns to create relationships between tables in the DSV.
You can change the NameMatchingCriteria property setting in Data Source View Designer. For more
information, see Change Properties in a Data Source View (Analysis Services).
NOTE
After you complete the Data Source View Wizard, you can add or remove relationships in the schema pane of Data Source
View Designer. For more information, see Define Logical Relationships in a Data Source View (Analysis Services).
See Also
Adding or Removing Tables or Views in a Data Source View (Analysis Services)
Define Logical Primary Keys in a Data Source View (Analysis Services)
Define Named Calculations in a Data Source View (Analysis Services)
Define Named Queries in a Data Source View (Analysis Services)
Replace a Table or a Named Query in a Data Source View (Analysis Services)
Work with Diagrams in Data Source View Designer (Analysis Services)
Explore Data in a Data Source View (Analysis Services)
Delete a Data Source View (Analysis Services)
Refresh the Schema in a Data Source View (Analysis Services)
Adding or Removing Tables or Views in a Data
Source View (Analysis Services)
5/16/2018 • 2 minutes to read • Edit Online
WARNING
Use caution when removing a table. Removing a table deletes all the associated columns and relationships from the DSV
and invalidates all objects bound to that table.
NOTE
Adding or removing objects in a data source view does not affect the underlying data source.
See Also
Data Source Views in Multidimensional Models
Work with Diagrams in Data Source View Designer (Analysis Services)
Explore Data in a Data Source View (Analysis
Services)
5/16/2018 • 2 minutes to read • Edit Online
See Also
Data Source Views in Multidimensional Models
Work with Diagrams in Data Source View Designer
(Analysis Services)
11/28/2018 • 5 minutes to read • Edit Online
Add a Diagram
DSV diagrams are created automatically when you create the DSV. After the DSV exists, you can create
additional diagrams, remove them, or hide specific objects to create a more manageable representation of the
DSV.
To create a new diagram, right-click anywhere in the Diagram Organizer pane, click New Diagram.
When you initially define a data source view (DSV ) in an Analysis Services project, all tables and views added to
the data source view are added to the <All Tables> diagram. This diagram appears in the Diagram Organizer
pane in Data Source View Designer, the tables in this diagram (and their columns and relationships) are listed in
the Tables pane, and the tables in this diagram (and their columns and relationships) are displayed graphically in
the schema pane. However, as you add tables, views and named queries to the <All Tables> diagram, the sheer
number of objects in this diagram makes it difficult to visualize relationships-particularly as multiple fact tables
are added to the diagram, and dimension tables relate to multiple fact tables.
To reduce the visual clutter when you only want to view a subset of the tables in the data source view, you can
define sub-diagrams (simply called diagrams) consisting of selected subsets of the tables, views, and named
queries in the data source view. You can use diagrams to group items in the data source view according to
business or solution needs.
You can group related tables and named queries in separate diagrams for business purposes, and to make it
easier to understand a data source view that contains many tables, views, and named queries. The same table or
named query can be included in multiple diagrams except for the <All Tables> diagram. In the <All Tables>
diagram, all objects that are contained in the data source view are shown exactly once.
Although you can hide objects individually, bringing them back using the Show Related Tables command returns
all related objects to the diagram. To control which objects are returned to the workspace, drag them from the
Tables pane instead.
See Also
Data Source Views in Multidimensional Models
Data Source View Designer (Analysis Services - Multidimensional Data)
Refresh the Schema in a Data Source View (Analysis
Services)
11/28/2018 • 3 minutes to read • Edit Online
IMPORTANT
If you are aware that a table has been renamed in a data source, you may want to use the Replace Table command to
replace the table with the renamed table before you refresh the data source view. For more information, see Replace a Table
or a Named Query in a Data Source View (Analysis Services).
After you examine the report, you can either accept the changes or cancel the update to reject any changes. All
changes must be accepted or rejected together. You cannot choose individual items in the list. You can also save a
report of the changes.
See Also
Data Source Views in Multidimensional Models
Replace a Table or a Named Query in a Data Source
View (Analysis Services)
5/16/2018 • 2 minutes to read • Edit Online
IMPORTANT
If you rename a table in a data source, follow the steps for replacing a table and specify the renamed table as the source of
the corresponding table in the DSV before you refresh a DSV. Completing the replacement and renaming process preserves
the table, the table's references, and the table's relationships in the DSV. Otherwise, when you refresh the DSV, a renamed
table in data source is interpreted as being deleted. For more information, see Refresh the Schema in a Data Source View
(Analysis Services).
See Also
Data Source Views in Multidimensional Models
Define Logical Relationships in a Data Source View
(Analysis Services)
5/16/2018 • 3 minutes to read • Edit Online
NOTE
The relationships defined in a DSV are logical and may not reflect the actual relationships defined in the underlying data
source. You can create relationships in Data Source View Designer that do not exist in the underlying data source, and
remove relationships created by Data Source View Designer from existing foreign key relationships in the underlying data
source.
Relationships are directed. For every value in the source column, there is a corresponding value in the destination
column. In a data source view diagram, such as the diagrams displayed in the Diagram pane, an arrow on the line
between two tables indicates the direction of the relationship.
This topic includes the following sections:
To add a relationship between tables, named queries, or views
To view or modify a relationship in the Diagram pane
To view or modify a relationship in the Tables pane
See Also
Data Source Views in Multidimensional Models
Define Logical Primary Keys in a Data Source View
(Analysis Services)
5/16/2018 • 2 minutes to read • Edit Online
See Also
Data Source Views in Multidimensional Models
Define Named Calculations in a Data Source View (Analysis Services)
Define Named Calculations in a Data Source View
(Analysis Services)
5/16/2018 • 3 minutes to read • Edit Online
When you create a named calculation, you specify a name, the SQL expression, and, optionally, a description of
the calculation. The SQL expression can refer to other tables in the data source view. After the named calculation
is defined, the expression in a named calculation is sent to the provider for the data source and validated as the
following SQL statement in which <Expression> contains the expression that defines the named calculation.
SELECT
<Table Name in Data Source>.*,
<Expression> AS <Column Name>
FROM
<Table Name in Data Source> AS <Table Name in Data Source View>
The data type of the column is determined by the data type of the scalar value returned by the expression. If the
provider does not find any errors in the expression, the column is added to the table.
Columns referenced in the expression should not be qualified or should be qualified by the table name only. For
example, to refer to the SaleAmount column in a table, SaleAmount or Sales.SaleAmount is valid, but
dbo.Sales.SaleAmount generates an error.
The expression is not automatically enclosed between parentheses. Therefore, if an expression, such as a
SELECT statement, requires parentheses, you must type the parentheses in the Expression box. For example,
the following expression is valid only if you type the parentheses.
(SELECT Description FROM Categories WHERE Categories.CategoryID = CategoryID)
NOTE
To locate a table or view, you can use the Find Table option by either clicking the Data Source View menu or
right-clicking in an open area of the Tables or Diagram panes.
See Also
Define Named Queries in a Data Source View (Analysis Services)
Define Named Queries in a Data Source View
(Analysis Services)
5/16/2018 • 2 minutes to read • Edit Online
When you create a named query, you specify a name, the SQL query returning the columns and data for the table,
and optionally, a description of the named query. The SQL expression can refer to other tables in the data source
view. After the named query is defined, the SQL query in a named query is sent to the provider for the data
source and validated as a whole. If the provider does not find any errors in the SQL query, the column is added to
the table.
Tables and columns referenced in the SQL query should not be qualified or should be qualified by the table name
only. For example, to refer to the SaleAmount column in a table, SaleAmount or Sales.SaleAmount is valid, but
dbo.Sales.SaleAmount generates an error.
Note When defining a named query that queries a SQL Server 2000 (8.x) or SQL Server 7.0 data source, a
named query that contains a correlated subquery and a GROUP BY clause will fail. For more information, see
Internal Error with SELECT Statement Containing Correlated Subquery and GROUP BY in the Microsoft
Knowledge Base.
NOTE
The query-building user interface (UI) depends on the data source. Instead of getting a graphical UI, you can get a
generic UI, which is text-based. You can accomplish the same things with these different UIs, but you must do so in
different ways. For more information, see Create or Edit Named Query Dialog Box (Analysis Services -
Multidimensional Data).
5. Click OK. An icon showing two overlapping tables appears in the table header to indicate that the table has
been replaced by a named query.
See Also
Data Source Views in Multidimensional Models
Define Named Calculations in a Data Source View (Analysis Services)
Delete a Data Source View (Analysis Services)
5/16/2018 • 2 minutes to read • Edit Online
See Also
Data Source Views in Multidimensional Models
Change Properties in a Data Source View (Analysis Services)
Change Properties in a Data Source View (Analysis
Services)
5/16/2018 • 5 minutes to read • Edit Online
NOTE
The Properties pane shows properties for the .dsv file as well as the DSV object. To view the properties of the object,
double-click it in Solution Explorer. The Properties will update to reflect the properties you see in the following table.
PROPERTY DESCRIPTION
Data Source Specifies the data source within the data source view whose
properties you are viewing
Name Specifies the name of the data source view that appears in
Solution Explorer or the Analysis Services database. You can
change the data source view name here or in Solution
Explorer.
NameMatchingCriteria The name matching criteria for the data source. The default is
(none) if primary key - foreign key relationships were
detected by the Data Source View Wizard. Regardless of
whether this property was set by the Data Source View
Wizard, you can specify a value here. If database relationships
exist and you specify name matching criteria, both will be
used to infer relationships between existing tables and newly
added tables.
PROPERTY DESCRIPTION
PROPERTY DESCRIPTION
DataSource Specifies the data source for the object. You cannot edit this
property.
Description Specifies the description for the table, view or named query. If
the underlying database table or view had a description
stored as an extended property, this value appears. You can
edit this property.
FriendlyName Specifies a name for the table or view that is easier for users
to understand or more relevant to the subject area. By
default, the FriendlyName property of a table or view is the
same as the Name property of the table or view. The
FriendlyName property is used by OLAP and data mining
objects when defining object names based on tables or views.
You can edit this property.
TableType Specifies the type of table for the table, view or named query.
This property is not editable.
PROPERTY DESCRIPTION
DataType Specifies the data type of the column based on the column in
the underlying table, value or named query. This property is
not directly editable. However, if you need to change the data
type of a column from a table or view, replace the table with a
named query that converts the column to the desired data
type.
FriendlyName Specifies the name for a column from a table or view that is
easier for users to understand or more relevant to the subject
area. By default, the FriendlyName property of a column
from a table or view is the same as the Name property of the
column. The FriendlyName property is used by OLAP and
data mining objects when defining attributes based on
columns from tables or views. You can edit this property.
See Also
Data Source Views in Multidimensional Models
Work with Diagrams in Data Source View Designer (Analysis Services)
Schema Generation Wizard (Analysis Services)
5/16/2018 • 2 minutes to read • Edit Online
In this section
The following table lists additional topics that explain how to work with the Schema Generation Wizard.
TOPIC DESCRIPTION
Use the Schema Generation Wizard (Analysis Services) Describes how to generate the schema for the subject area
and staging area databases.
Understanding the Database Schemas Describes the schema that is generated for the subject area
and staging area databases.
NOTE
To unbind Analysis Services dimensions and cubes from previously generated objects, delete the data source view to which
the Analysis Services cubes and dimensions are bound, and then define a new data source view for the cubes and dimensions
by using the Schema Generation Wizard.
Validation
Before it begins to generate the underlying relational schema, the Schema Generation Wizard validates the
Analysis Services cubes and dimensions. If the wizard detects errors, it stops and reports the errors to the Task List
window in SQL Server Data Tools (SSDT). Examples of errors that prevent generation include the following:
Dimensions that have more than one key attribute.
Parent attributes that have different data types than the key attributes.
Measure groups that do not have measures.
Degenerate dimensions or measures that are improperly configured.
Surrogate keys that are improperly configured, such as multiple attributes using the ScdOriginalID
attribute type or an attribute using the ScdOriginalID that is not bound to a column using the integer data
type.
Dimension Tables
For each dimension, the Schema Generation Wizard generates a dimension table to be included in the subject area
database. The structure of the dimension table depends on the choices made while designing the dimension on
which it is based.
Columns
The wizard generates one column for the bindings associated to each attribute in the dimension on which the
dimension table is based, such as the bindings for the KeyColumns, NameColumn, ValueColumn,
CustomRollupColumn, CustomRollupPropertiesColumn, and UnaryOperatorColumn properties of each
attribute.
Relationships
The wizard generates a relationship between the column for each parent attribute and the primary key of the
dimension table.
The wizard also generates a relationship to the primary key in each additional dimension table defined as a
referenced dimension in the cube, if applicable.
Constraints
The wizard generates a primary key constraint, by default, for each dimension table based on the key attribute of
the dimension. If the primary key constraint is generated, a separate name column is generated by default. A
logical primary key is created in the data source view even if you decide not to create the primary key in the
database.
NOTE
An error occurs if more than one key attribute is specified in the dimension on which the dimension table is based.
Translations
The wizard generates a separate table to hold the translated values for any attribute that requires a translation
column. The wizard also creates a separate column for each of the required languages.
Fact Tables
For each measure group in a cube, the Schema Generation Wizard generates a fact table to be included in the
subject area database. The structure of the fact table depends on the choices made while designing the measure
group on which it is based, and the relationships established between the measure group and any included
dimensions.
Columns
The wizard generates one column for each measure, except for measures that use the Count aggregation function.
Such measures do not require a corresponding column in the fact table.
The wizard also generates one column for each granularity attribute column of each regular dimension
relationship on the measure group, and one or more columns for the bindings associated to each attribute of a
dimension that has a fact dimension relationship to the measure group on which this table is based, if applicable.
Relationships
The wizard generates one relationship for each regular dimension relationship from the fact table to the dimension
table's granularity attribute. If the granularity is based on the key attribute of the dimension table, the relationship
is created in the database and in the data source view. If the granularity is based on another attribute, the
relationship is created only in the data source view.
If you chose to generate indexes in the wizard, a non-clustered index is generated for each of these relationship
columns.
Constraints
Primary keys are not generated on fact tables.
If you chose to enforce referential integrity, referential integrity constraints are generated between dimension
tables and fact tables where applicable.
Translations
The wizard generates a separate table to hold the translated values for any property in the measure group that
requires a translation column. The wizard also creates a separate column for each of the required languages.
KeyColumn 50
DATA ITEM DEFAULT LENGTH (BYTES)
NameColumn 50
CustomRollupColumn 3000
CustomRollupPropertiesColumn 500
UnaryOperatorColumn 1
See Also
Understanding Incremental Generation
Manage Changes to Data Source Views and Data Sources
Understanding Incremental Generation
5/16/2018 • 8 minutes to read • Edit Online
NOTE
If you are loading data from delimited text files, you can also choose whether the Schema Generation Wizard overwrites
these files and the data contained in them during regeneration. Text files are either overwritten completely or not at all. The
Schema Generation Wizard does not partially overwrite these files. By default, these files are not overwritten.
Partial Preservation
The Schema Generation Wizard cannot preserve existing data under some circumstances. The following table
provides examples of situations in which the wizard cannot preserve all the existing data in the underlying tables
during regeneration.
Incompatible data type change The Schema Generation Wizard uses standard SQL Server
data type conversions, whenever possible, to convert existing
data from one data type to another. However, when you
change an attribute's data type to a type that is incompatible
with the existing data, the wizard drops the data for the
affected column.
TYPE OF DATA CHANGE TREATMENT
Referential integrity errors If you change a dimension or cube that contains data and the
change causes a referential integrity error during
regeneration, the Schema Generation Wizard drops all data in
the foreign key table. The data that is dropped is not limited
to the column that caused the foreign key constraint violation
or to the rows that contain the referential integrity errors. For
example, if you change the dimension key to an attribute that
has non-unique or null data, all existing data in the foreign
key table is dropped. Furthermore, dropping all the data in
one table can have a cascading effect and can cause other
referential integrity violations.
Deleted attribute or dimension If you delete an attribute from a dimension, the Schema
Generation Wizard deletes the column that is mapped to the
deleted attribute. If you delete a dimension, the wizard deletes
the table that is mapped to the deleted dimension. In these
cases, the wizard drops the data that is contained in the
deleted column or table.
The Schema Generation Wizard issues a warning before it drops any data so that you can cancel the wizard
without losing any data. However, the Schema Generation Wizard is not able to differentiate between anticipated
data loss and unanticipated data loss. When you run the wizard, a dialog box lists the tables and columns that
contain data that will be dropped. You can either have the wizard continue and drop the data, or you can cancel the
wizard and revise the changes you made to the tables and columns.
See Also
Manage Changes to Data Source Views and Data Sources
Schema Generation Wizard (Analysis Services)
Manage Changes to Data Source Views and Data
Sources
5/16/2018 • 2 minutes to read • Edit Online
See Also
Understanding Incremental Generation
Dimensions in Multidimensional Models
12/6/2018 • 2 minutes to read • Edit Online
NOTE
You can also design and configure dimensions, attributes, and hierarchies programmatically by using either XMLA or
Analysis Management Objects (AMO). For more information, see Analysis Services Scripting Language (ASSL for XMLA)
and Developing with Analysis Management Objects (AMO).
In This Section
The following table describes the topics in this section.
Define Database Dimensions
Describes how to modify and configure a database dimension by using Dimension Designer.
Dimension Attribute Properties Reference
Describes how to define, modify, and configure a database dimension attribute by using Dimension Designer.
Define Attribute Relationships
Describes how to define, modify, and configure an attribute relationship by using Dimension Designer.
Create User-Defined Hierarchies
Describes how to define, modify, and configure a user-defined hierarchy of dimension attributes by using
Dimension Designer.
Use the Business Intelligence Wizard to Enhance Dimensions
Describes how to enhance a database dimension by using the Business Intelligence Wizard.
See Also
Cubes in Multidimensional Models
Create a Dimension Using the Dimension Wizard
5/16/2018 • 2 minutes to read • Edit Online
NOTE
You might occasionally have to create a dimension without using an existing table. For more information, see Create
a Dimension by Generating a Non-Time Table in the Data Source and Create a Time Dimension by Generating a Time
Table.
NOTE
The Select Related Tables page appears if the main dimension table that you specified has relationships to other
dimension tables.
5. On the Select Dimension Attributes page, select the attributes that you want to include in the dimension,
and then click Next.
Optionally, you can change the attribute names, enable or disable browsing, and specify the attribute type.
NOTE
To make the Enable Browsing and Attribute Type fields of an attribute active, the attribute must be selected for
inclusion in the dimension.
6. On the Define Account Intelligence page, in the Built-In Account Types column, select the account
type, and then click Next.
The account type must correspond to the account type of the source table that is listed in the Source Table
Account Types column.
NOTE
The Define Account Intelligence page appears if you defined an Account Type dimension attribute on the Select
Dimension Attributes page of the wizard.
7. On the Completing the Wizard page, enter a name for the new dimension and review the dimension
structure. If you want to make changes, click Back; otherwise, click Finish.
NOTE
You can use Dimension Designer after you complete the Dimension Wizard to add, remove, and configure attributes
and hierarchies in the dimension.
See Also
Create a Dimension by Using an Existing Table
Create a Dimension by Using an Existing Table
5/16/2018 • 6 minutes to read • Edit Online
NOTE
For the step-by-step instructions that correspond to the information presented in this topic, see Create a Dimension Using
the Dimension Wizard.
If you are building a snowflake dimension, you specify the related tables from which additional attributes will be
defined on the Select Related Tables page. For example, you are building a customer dimension in which you
want to define a customer geography table. In this case, you might define a geography table as a related table.
NOTE
If the dimension type and standard attribute types are not set when you create the dimension, use the Business Intelligence
Wizard to set these values after you create the dimension. For more information, see Add Dimension Intelligence to a
Dimension or (for an Accounts type dimension) Add Account Intelligence to a Dimension.
The wizard automatically sets the dimension type based on the attribute types that are specified. The attribute
types specified in the wizard set the Type property for the attributes. The Type property settings for the
dimension and its attributes provide information about the contents of a dimension to server and client
applications. In some cases, these Type property settings only provide guidance for client applications and are
optional. In other cases, as for Accounts, Time, or Currency dimensions, these Type property settings determine
specific server-based behavior and might be required to implement certain cube behavior.
For more information about dimension and attribute types, see Dimension Types, Configure Attribute Types.
You use the Define Account Intelligence page to create an Account type dimension. If you are creating an
Account type dimension, you have to map standard account types supported by Analysis Services to members of
the account type attribute in the dimension. The server uses these mappings to provide separate aggregation
functions and aliases for each type of account data.
To map these account types, the wizard provides a table with the following columns:
The Source Table Account Types column lists account types from the data source table.
The Built-In Account Types column lists the corresponding standard account types supported by the
server. If the source data uses standard names, the wizard automatically maps the source type to the server
type, and populates the Built-In Account Types column with this information. If the server does not map
the account types or you want to change the mapping, select a different type from the list in the Built-In
Account Types column.
NOTE
If the account types are not mapped when the wizard creates an Accounts dimension, use the Business Intelligence Wizard
to configure these mappings after you create the dimension. For more information, see Add Account Intelligence to a
Dimension.
See Also
Create a Dimension by Generating a Non-Time Table in the Data Source
Create a Time Dimension by Generating a Time Table
Dimension Attribute Properties Reference
Create a Time Dimension by Generating a Time Table
Create a Dimension by Generating a Non-Time Table in the Data Source
Create a Time Dimension by Generating a Time
Table
5/16/2018 • 4 minutes to read • Edit Online
Select Calendars
The standard (Gregorian) 12-month calendar, starting on January 1 and ending on December 31, is always
included when you create a time dimension. On the Select Calendars page of the wizard, you can specify
additional calendars on which to base hierarchies in the dimension. For descriptions of the calendar types, see
Create a Date type Dimension.
Depending on which time periods you select on the Define Time Periods page of the wizard, the calendar
selections determine attributes that are created in the dimension. For example, if you select the Year and Quarter
time periods on the Define Time Periods page of the wizard and select Fiscalcalendar on the Select
Calendars page, the FiscalYear, FiscalQuarter, and FiscalQuarterOfYear attributes are created for the fiscal
calendar.
The wizard also creates calendar-specific hierarchies that are composed of the attributes that are created for the
calendar. For every calendar, each level in every hierarchy rolls up into the level above it. For example, in the
standard 12-month calendar, the wizard creates a hierarchy of Years and Weeks or Years and Months. However,
weeks are not contained evenly within months in a standard calendar, so there is no hierarchy of Years, Months,
and Weeks. In contrast, weeks in a reporting or manufacturing calendar are evenly divided into months, so in
these calendars weeks roll up into months.
See Also
Data Source Views in Multidimensional Models
Create a Date type Dimension
Database Dimension Properties
Dimension Relationships
Create a Dimension by Generating a Non-Time Table in the Data Source
Create a Dimension by Generating a Non-Time Table
in the Data Source
5/16/2018 • 4 minutes to read • Edit Online
You can use Dimension Designer after you complete the Dimension Wizard to add, remove, and configure
attributes and hierarchies in the dimension.
When you are creating a non-time dimension without using a data source, the Dimension Wizard guides you
through the steps of specifying the dimension type, and identifying the key attribute and slowly changing
dimensions.
ATTRIBUTE TYPE
See Also
Create a Time Dimension by Generating a Time Table
Create a Time Dimension by Generating a Time Table
Define Database Dimensions
11/28/2018 • 2 minutes to read • Edit Online
TAB DESCRIPTION
Dimension Structure Use this tab to work with the structure of a dimension-to
examine or create the data source view schema for a
dimension, to work with attributes, and to organize attributes
in user-defined hierarchies.
Attribute Relationships Use this tab to create, modify, or delete the attribute
relationships of a dimension.
The following topics describe the tasks that you can perform in Dimension Designer.
Dimension Attribute Properties Reference
Describes how to define and configure a dimension attribute.
Create User-Defined Hierarchies
Describes how to define and configure a user-defined hierarchy.
Define Attribute Relationships
Describes how to define and configure an attribute relationship.
Use the Business Intelligence Wizard to Enhance Dimensions
Describes how to use the Business Intelligence Wizard to enhance a dimension.
Database Dimensions - Configure the (All) Level for
Attribute Hierarchies
5/16/2018 • 2 minutes to read • Edit Online
See Also
Define a Default Member
Database Dimensions - Modify or Delete a Database
Dimension in Solution Explorer
5/16/2018 • 2 minutes to read • Edit Online
See Also
Dimensions in Multidimensional Models
Database Dimensions - Browse Dimension Data in
Dimension Designer
5/16/2018 • 2 minutes to read • Edit Online
NOTE
You must have a translation defined in the dimension for the selected language.
See Also
Introduction to Dimensions (Analysis Services - Multidimensional Data)
Dimensions in Multidimensional Models
Database Dimensions - BI Wizard in Dimension
Designer
5/16/2018 • 2 minutes to read • Edit Online
Dimension Structure
The dimension structure for a time dimension depends on how the underlying data source stores the time period
information. This difference in storage produces two basic types of time dimensions:
Time dimension
Time dimensions are similar to other dimensions in that a dimension table supplies the attributes for the
dimension. Each column in the dimension main table defines an attribute for a specific time period.
Like other dimensions, the fact table has a foreign key relationship to the dimension table for the time dimension.
The key attribute for a time dimension is based either on an integer key or on the lowest level of detail, such as the
date, that appears in the dimension main table.
Server time dimension
If you do not have a dimension table to which to bind time-related attributes, you can have Analysis Services
define a server time dimension based on time periods. To define the hierarchies, levels, and members represented
by the server time dimension, you select standard time periods when you create the dimension.
Attributes in a server time dimension have a special time-attribute binding. Analysis Services uses the attribute
types that are related to dates, such as Year, Month, or Day, to define members of attributes in a time dimension.
After you include the server time dimension in a cube, you set the relationship between the measure group and
the server time dimension by specifying a relationship on the Define Dimension Usage page of the Cube
Wizard.
Calendars
In a time dimension or server time dimension time period attributes are grouped together in hierarchies. Such
hierarchies are generally referred to as calendars.
Business intelligence applications frequently require multiple calendar definitions. For example, a human resource
department may track employees by using a standard calendar-a twelve-month Gregorian calendar starting on
January 1 and ending on December 31st. However, that same human resource department may track
expenditures by using a fiscal calendar-a twelve-month calendar that defines the fiscal year used by the
organization.
You can construct these different calendars manually in Dimension Designer. However, the Dimension Wizard
provides several hierarchy templates that can be used to automatically generate several types of calendars when
you create a time dimension or server time dimension. The following table describes the various calendars that
can be generated by the Dimension Wizard.
CALENDAR DESCRIPTION
Fiscal calendar A twelve-month fiscal calendar. When you select this calendar,
specify the starting day and month for the fiscal year used by
your organization.
Reporting calendar (or marketing calendar) A twelve-month reporting calendar that includes two months
of four weeks and one month of five weeks in a repeated
three-month (quarterly) pattern. When you select this
calendar, specify the starting day and month and the three-
month pattern of 4-4-5, 4-5-4, or 5-4-4 weeks, where each
digit represents the number of weeks in a month.
Manufacturing calendar A calendar that uses 13 periods of four weeks, divided into
three quarters of three periods and one quarter of four
periods. When you select this calendar, you specify the
starting week (between 1 and 4) and month for the
manufacturing year used by your organization, and also
identify which quarter contains four periods.
When you create a server time dimension, and specify the time periods and the calendars to use in that
dimension, the Dimension Wizard adds the attributes for the time periods that are appropriate for each specified
calendar. For example, if you create a server time dimension that uses years as the time period and includes both
fiscal and reporting calendars, the wizard will then add FiscalYear and ReportingYears attributes, together with the
standard Years attribute, to the dimension. A server time dimension will also have attributes for combinations of
selected time periods, such as a DayOfWeek attribute for a dimension that contains Days and Weeks. The
Dimension Wizard creates a calendar hierarchy by combining attributes that belong to a single calendar type. For
example, a fiscal calendar hierarchy may contain the following levels: Fiscal Year, Fiscal Half Year, Fiscal Quarter,
Fiscal Month, and Fiscal Day.
NOTE
You cannot use the Business Intelligence Wizard to add time intelligence to server time dimensions. The Business Intelligence
Wizard adds a hierarchy to support time intelligence, and this hierarchy must be bound to a column of the time dimension
table. Server time dimensions do not have a corresponding time dimension table and therefore cannot support this
additional hierarchy.
See Also
Create a Time Dimension by Generating a Time Table
Business Intelligence Wizard F1 Help
Dimension Types
Database Dimensions - Finance Account of parent-
child type
11/28/2018 • 2 minutes to read • Edit Online
Dimension Structure
An account dimension contains, at least, two attributes:
A key attribute-an attribute that identifies individual accounts in the dimension table for the account
dimension.
An account attribute-a parent attribute that describes how accounts are hierarchically arranged in the
account dimension.
To identify an attribute as an account attribute, set the Type property of the attribute to Account and the
Usage property to Parent.
Account dimensions can optionally contain the following attributes:
An account type attribute-an attribute that defines the account type for each account in the dimension. The
member names of the account type attribute map to the account types defined for the Analysis Services
database or project, and indicate the aggregation function used by Analysis Services for those accounts. You
can also use unary operators or custom rollup formulas to determine aggregation behavior for account
attributes, but account types let you to easily apply consistent behavior to a chart of accounts without
requiring changes to the underlying relational database.
To identify an account type attribute, set the Type property of the attribute to AccountType.
An account name attribute-an attribute that is used for reporting purposes. You identify an account name
attribute by setting the Type property of the attribute to AccountName.
An account number attribute-an attribute that is used for reporting purposes. You identify an account
number attribute by setting the Type property of the attribute to AccountNumber.
For more information about attribute types, see Configure Attribute Types.
See Also
Attributes and Attribute Hierarchies
Business Intelligence Wizard F1 Help
Dimension Types
Database Dimensions - Create a Currency type
Dimension
5/16/2018 • 2 minutes to read • Edit Online
Dimension Structure
A currency dimension contains, at least, a key attribute identifying individual currencies in the dimension table for
the currency dimension. The value of the key attribute is different in both source and destination currency
dimensions:
To identify an attribute as the key attribute of a source currency dimension, set the Type property of the
attribute to CurrencySource.
To identify an attribute as the destination currency dimension, set the Type property of the attribute to
CurrencyDestination.
For reporting purposes, both source and destination currency dimensions can optionally contain the following
attributes:
A currency name attribute.
To identify an attribute as a currency name attribute, set the Type property of the attribute to
CurrencyName.
A currency source attribute.
To identify an attribute as a currency source attribute, set the Type property of the attribute to
CurrencySource.
A currency International Standards Organization (ISO ) code.
To identify an attribute as a currency ISO code attribute, set the Type property of the attribute to
CurrencyIsoCode.
For more information about attribute types, see Configure Attribute Types.
See Also
Attributes and Attribute Hierarchies
Business Intelligence Wizard F1 Help
Dimension Types
Dimension Attribute Properties Reference
5/16/2018 • 7 minutes to read • Edit Online
PROPERTY DESCRIPTION
KeyColumns Contains the column or columns that represent the key for
the attribute, which is the column in the underlying
relational table in the data source view to which the
attribute is bound. The value of this column for each
member is displayed to users unless a value is specified for
the NameColumn property.
NOTE
For more information about how to set values for the KeyColumn property when you are working with null values and
other data integrity issues, see Handling Data Integrity Issues in Analysis Services 2005.
NOTE
The default member on an attribute is used to evaluate expressions when a member from the hierarchy is not explicitly
included in a query. The default member for an attribute is specified by the DefaultMember property on the attribute.
Whenever a hierarchy from a dimension is included in a query, all the default members from attributes corresponding to
levels in the hierarchy are ignored. If no hierarchy of a dimension is included in a query, then default members are used
for all the attributes in the dimension. For more information on default members, see Define a Default Member.
See Also
Attributes and Attribute Hierarchies
Attribute Properties - Rename an Attribute
5/16/2018 • 2 minutes to read • Edit Online
See Also
Dimension Attribute Properties Reference
Attribute Properties - Add an Attribute to a
Dimension
5/16/2018 • 2 minutes to read • Edit Online
See Also
Dimension Attribute Properties Reference
Attribute Properties - Remove an Attribute from a
Dimension
5/16/2018 • 2 minutes to read • Edit Online
See Also
Dimensions in Multidimensional Models
Dimension Attribute Properties Reference
Attribute Properties - Configure Attribute Types
5/16/2018 • 12 minutes to read • Edit Online
TERM DEFINITION
General attribute types These values are available to all attributes, and exist only to
enable classification of attributes for client application
purposes.
Account dimension attribute types These values identify an attribute that belongs to an account
dimension. For more information about account dimension,
see Create a Finance Account of parent-child type Dimension.
Currency dimension attribute type These values identify an attribute that belongs to a currency
dimension. For more information about currency dimensions,
see Create a Currency type Dimension.
Slowly changing dimension attributes These values identify an attribute that belongs to a slowly
changing dimension.
Time dimension attributes These values identify an attribute that belongs to a time
dimension. For more information about time dimensions, see
Create a Date type Dimension.
See Also
Attributes and Attribute Hierarchies
Dimension Attribute Properties Reference
Attribute Properties - Group Attribute Members
11/15/2018 • 6 minutes to read • Edit Online
Automatic Selects the method that best represents the data: either the
EqualAreas method or the Clusters method.
EqualAreas Tries to divide the members in the attribute into groups that
contain an equal number of members.
The DiscretizationNumber property on attributes specifies the number of groups to display. If the property is
set to the default value of 0, Analysis Services determines the number of groups by either sampling or reading the
data, depending on the setting of the DiscretizationMethod property.
The sort order of members in the member groups is controlled by using the OrderBy property of the attribute.
Based on this sort order, the members in a member group are ordered consecutively.
A common use for member groups is to drill down from a level with few members to a level with many members.
To enable users to drill down between levels, change the DiscretizationMethod property on the attribute for the
level that contains numerous members from None to one of the discretization methods described in the previous
table. For example, a Client dimension contains a Client Name attribute hierarchy with 500,000 members. You can
rename this attribute Client Groups and set the DiscretizationMethod property to Automatic to display
member groups on the attribute hierarchy member level.
To drill down to individual clients in each group, you can create another Client Name attribute hierarchy bound to
the same table column. Then, create a new user hierarchy based on the two attributes. The top level would be
based on the Client Groups attribute and the lower level would be based on the Client Name attribute. The
IsAggregatable property would be True on both attributes. The user could then expand the (All) level on the
hierarchy to view the group members, and expand the group members to view the leaf members of the hierarchy.
To hide either group or client level, you could set the AttributeHierarchyVisible property to False on the
corresponding attribute.
Naming Template
Member group names are generated automatically when the member groups are created. Unless you specify a
naming template, the default naming template is used. You can change this method of naming by specifying a
naming template in the Format option for the NameColumn property of an attribute. Different naming
templates can be redefined for every language specified in the Translations collection of the column binding that
was used for the NameColumn property of the attribute.
The Format setting uses the following string expression to define the naming template:
<Naming template> ::= <First definition> [;<Intermediate definition>;<Last definition>]
The <First definition> parameter applies only to the first or only member group generated by the discretization
method. If the optional parameters <Intermediate definition> and <Last definition> are not provided, the
<First definition> parameter is used for all measure groups generated for that attribute.
The <Last definition> parameter applies only to the last member group generated by the discretization method.
The <Intermediate bucket name> parameter applies to every member group other than the first or last member
group generated by the discretization method. If two or fewer member groups are generated, this parameter is
ignored.
The <Bucket name> parameter is a string expression that can incorporate a set of variables to represent member
or member group information as part of the name of the member group:
VARIABLE DESCRIPTION
%{First bucket member} The member name of the first member to be included in the
current member group.
%{Last bucket member} The member name of the last member to be included in the
current member group.
%{Previous bucket last member} The member name of the last member assigned to the
previous member group.
%{Next bucket first member} The member name of the first member to be assigned to the
next member group.
%{Previous Bucket Max} The maximum value of the members to be assigned to the
previous member group.
%{Next Bucket Min} The minimum value of the members to be assigned to the
next member group.
The default naming template is "%{First bucket member} - %{Last bucket member}" , to provide compatibility with
earlier versions of Analysis Services.
NOTE
To include a semicolon (;) as a literal character in the naming template, prefix it with the percent (%) character.
Example
The following string expression could be used to classify the Yearly Income attribute of the Customer dimension
in the Adventure Works DW Multidimensional 2012 sample Analysis Services database, where the Yearly Income
attribute uses member grouping:
"Less than %{Next Bucket Min};Between %{First bucket member} and %{Last bucket member};Greater than %
{Previous Bucket Max}"
Usage Limitations
You cannot create member groups in the topmost or bottommost level of a hierarchy. However, if you need
to do this, you can add a level in such a way that the level in which you want to create member groups is no
longer the top or bottom level. You can hide the added level by setting its Visible property to False.
You cannot create member groups in two consecutive levels of a hierarchy.
Member groups are not supported for dimensions that use the ROLAP storage mode.
If the dimension table of a dimension that contains member groups is updated, and the dimension is
subsequently fully processed, a new set of member groups is generated. The names and children of the
new member groups may be different from the old member groups.
See Also
Attributes and Attribute Hierarchies
Attribute Properties - Define Custom Member
Formulas
5/16/2018 • 3 minutes to read • Edit Online
Time.[Quarter 3] * 1.5
Custom member formulas are stored in a column of the dimension table. You enable custom rollup formulas by
setting the CustomRollupColumn property on an attribute.
To apply a single MDX expression to all members of an attribute, create a named calculation on the dimension
table that returns an MDX expression as a literal string. Then, specify the named calculation with the
CustomRollupColumn property setting on the attribute that you want to configure. A named calculation is a
column in a data source view table that returns row values defined by a SQL expression. For more information
about constructing named calculations, see Define Named Calculations in a Data Source View (Analysis Services)
NOTE
To apply an MDX expression to members of a particular level instead of to members of all levels based on a particular
attribute, you can define the expression as an MDX script on the level. For more information, see MDX Scripting
Fundamentals (Analysis Services).
If you use both calculated members and custom rollup formulas for members of an attribute, you should be aware
of the order of evaluation. Calculated members are resolved before custom rollup formulas are resolved.
See Also
Attributes and Attribute Hierarchies
Set Custom Member Formulas for Attributes in a Dimension
Attribute Properties - Define a Default Member
11/28/2018 • 3 minutes to read • Edit Online
See Also
Configure the (All) Level for Attribute Hierarchies
Attribute Properties - View Attributes in Dimension
Designer
5/16/2018 • 2 minutes to read • Edit Online
Regular or AccountType
Key
Parent
See Also
Dimension Attribute Properties Reference
Attribute Properties - Define a New Attribute
Automatically
5/16/2018 • 2 minutes to read • Edit Online
See Also
Dimensions in Multidimensional Models
Dimension Attribute Properties Reference
View Attributes in Dimension Designer
5/16/2018 • 2 minutes to read • Edit Online
NOTE
If you define multiple key columns, the order in which those columns appear in the Key Columns list affects the
display order. For example, a month attribute has two key columns: month and year. If the year column appears in
the list before the month column, Analysis Services will sort by year and then by month. If the month column
appears before the year column, Analysis Services will sort by month and then by year.
8. To change the order of key columns, select a column, and then click the Up or Down button.
See Also
Dimension Attribute Properties Reference
Attribute Properties - Bind an Attribute to a Key
Column
5/16/2018 • 2 minutes to read • Edit Online
NOTE
You can also set the Name property of a selected attribute in the Properties window of SQL Server Data Tools
(SSDT).
Attribute Properties - Bind an Attribute to a Name
Column
5/16/2018 • 2 minutes to read • Edit Online
See Also
Attributes and Attribute Hierarchies
Add an Attribute to a Dimension
Attribute Properties - Define Member Groups
5/16/2018 • 2 minutes to read • Edit Online
Dimension Schema
The dimension schema of a parent-child hierarchy depends on a self-referencing relationship present on the
dimension main table. For example, the following diagram illustrates the DimOrganization dimension main
table in the AdventureWorksDW2012 sample database.
In this dimension table, the ParentOrganizationKey column has a foreign key relationship with the
OrganizationKey primary key column. In other words, each record in this table can be related through a parent-
child relationship with another record in the table. This kind of self-join is generally used to represent
organization entity data, such as the management structure of employees in a department.
Data Members
Typically, leaf members in a dimension contain data derived directly from underlying data sources, whereas
nonleaf members contain data derived from aggregations performed on child members.
However, parent-child hierarchies might have some nonleaf members whose data is derived from underlying
data sources, in addition to data aggregated from child members. For these nonleaf members in a parent-child
hierarchy, special system-generated child members can be created that contain the underlying fact table data.
Referred to as data members, these special child members contain a value that is directly associated with a
nonleaf member and is independent of the summary value calculated from the descendants of the nonleaf
member. For more information about data members, see Attributes in Parent-Child Hierarchies.
See Also
Attributes in Parent-Child Hierarchies
Database Dimension Properties
Parent-Child Dimension Attributes
5/16/2018 • 2 minutes to read • Edit Online
Ordinarily, the value of the Sales Manager 1 member would be derived by aggregating the values of the
Salesperson 1 and Salesperson 2 members. However, because Sales Manager 1 also can sell products, that
member may also contain data derived from the fact table, because there may be gross sales associated with
Sales Manager 1.
Moreover, the individual commissions for each sales staff member can vary. In this case, two different scales are
used to compute commissions for the individual gross sales of the sales managers, as opposed to the total of
gross sales generated by their salespersons. Therefore, it is important to be able to access the underlying fact
table data for nonleaf members. The MDX DataMember function can be used to retrieve the individual gross
sales volume of the Sales Manager 1 member, and a custom rollup expression can be used to exclude the data
member from the aggregated value of the Sales Manager 1 member, providing the gross sales volume of the
salespersons associated with that member.
See Also
Dimension Attribute Properties Reference
Parent-Child Dimensions
Parent-Child Dimension Attributes - Custom Rollup
Operators
5/16/2018 • 2 minutes to read • Edit Online
See Also
Define Custom Member Formulas
Unary Operators in Parent-Child Dimensions
Parent-Child Dimension Attributes - Unary Operators
11/28/2018 • 3 minutes to read • Edit Online
+ (plus sign) The value of the member is added to the aggregate value of
the sibling members that occur before the member. This
operator is the default operator if no unary operator column
is defined for an attribute.
- (minus sign) The value of the member is subtracted from the aggregate
value of the sibling members that occur before the member.
/ (slash mark) The value of the member is divided by the aggregate value of
the sibling members that occur before the member.
Blank values and any other values not found in the table are treated the same as the plus sign (+) unary operator.
There is no operator precedence, so the order of members as stored in the unary operator column determines the
order of evaluation. To change the order of evaluation, create a new attribute, set its Type property to Sequence,
and then assign sequence numbers that correspond to the order of evaluation in its Source Column property. You
must also order members of the attribute by that attribute. For information about how to use the Business
Intelligence Wizard to order members of an attribute, see Define the Ordering for a Dimension.
You can use the UnaryOperatorColumn property to specify a named calculation that returns a unary operator as
a literal character for all members of the attribute. This could be as simple as typing a literal character such as '*'
in the named calculation. This would replace the default operator, the plus sign (+), with the multiplication operator,
the asterisk (*), for all members of the attribute. For more information, see Define Named Calculations in a Data
Source View (Analysis Services).
In the Browser tab of Dimension Designer, you can view the unary operators next to each member in a hierarchy.
You can also change the unary operators when you work with a write-enabled dimension. If the dimension is not
write-enabled, you must use a tool to modify the data source directly.
See Also
Dimension Attribute Properties Reference
Custom Rollup Operators in Parent-Child Dimensions
Start the Business Intelligence Wizard in Dimension Designer
User-Defined Hierarchies - Create
12/6/2018 • 2 minutes to read • Edit Online
See Also
User Hierarchy Properties
Level Properties - user hierarchies
Parent-Child Dimensions
User-Defined Hierarchies - Ragged Hierarchies
11/28/2018 • 4 minutes to read • Edit Online
Never Level members are never hidden. This is the default value.
See Also
Create User-Defined Hierarchies
User Hierarchies
Parent-Child Dimensions
Connection String Properties (Analysis Services)
User-Defined Hierarchies - Add or Delete a User-
Defined Hierarchy
11/28/2018 • 2 minutes to read • Edit Online
NOTE
By default, a user-defined hierarchy is just a path that enables users to drill down for information. However, if
relationships exist between levels, you can increase query performance by configuring attribute relationships between
levels. For more information, see Attribute Relationships and Define Attribute Relationships.
NOTE
Defining attribute relationships incorrectly can cause invalid query results.
See Also
Attribute Relationships
Attribute Relationships - Configure Attribute
Properties
5/16/2018 • 2 minutes to read • Edit Online
PROPERTY DESCRIPTION
NOTE
To display the Attributes pane, click Show List Views on the toolbar.
3. In the Create Attribute Relationship dialog box, select a source attribute and a related attribute.
4. In the Relationship type list, select a relationship type, and then click OK.
To modify an Attribute Relationship
1. In Dimension Designer, open the dimension that contains the attribute relationship that you want to modify.
2. Click the Attribute Relationships tab.
3. Right-click the attribute relationship in the diagram or in the Attribute Relationships pane, and select Edit
Attribute Relationship.
NOTE
To display the Attribute Relationships pane, click Show List Views on the toolbar.
4. In the Edit Attribute Relationship dialog box, select a source attribute and a related attribute.
5. In the Relationship type list, select a relationship type, and then click OK.
To delete an Attribute Relationship
1. In Dimension Designer, open the dimension that contains the attribute relationship that you want to delete.
2. On the Attribute Relationships tab, right-click the attribute relationship in the diagram or in the Attribute
Relationships pane, and then select Delete.
3. In the Delete Objects dialog box, click OK.
See Also
Attribute Relationships
Attribute Relationships - Define the Relationship Type
5/16/2018 • 2 minutes to read • Edit Online
NOTE
To display the Attribute Relationships pane, click Show List Views on the toolbar.
In a flexible relationship, relationships between members change over time. In a rigid relationship,
relationships between members do not change over time.
See Also
Define Attribute Relationships
Attribute Relationships - Arrange Shapes in the
Diagram
5/16/2018 • 2 minutes to read • Edit Online
See Also
Attribute Relationships
Define Attribute Relationships
BI Wizard - Add Account Intelligence to a Dimension
5/16/2018 • 4 minutes to read • Edit Online
NOTE
Account intelligence is available only for dimensions that are based on existing data sources. For dimensions that were
created without using a data source, you must run the Schema Generation Wizard to create a data source view before
adding account intelligence.
You apply account intelligence to a dimension that specifies account information (for example, account name,
account number, and account type). To add account intelligence, you use the Business Intelligence Wizard, and
select the Define account intelligence option on the Choose Enhancement page. This wizard then guides you
through the steps of selecting a dimension to which you want to apply account intelligence, identifying account
attributes in the selected account dimension, and then mapping account types in the dimension table to account
types recognized by Analysis Services.
Selecting a Dimension
On the first Define Account Intelligence page of the wizard, you specify the dimension to which you want to
apply account intelligence. The account intelligence enhancement added to this selected dimension will result in
changes to the dimension. These changes will be inherited by all cubes that include the selected dimension.
NOTE
If appropriate, you can map more than one account type in the dimension to a particular server account type.
To change the default aggregations mapped to each account type for a database, you can use the Database
Designer.
1. In Solution Explorer, right-click the Analysis Services project and click Edit Database.
2. In the Account Type Mapping box, select an account type in the Name.
3. In the Alias text box, type an alias for this account type.
4. In the Aggregation Function drop down list box, change the default Aggregation Function for this
account type.
BI Wizard - Add Dimension Intelligence to a
Dimension
5/16/2018 • 2 minutes to read • Edit Online
Selecting a Dimension
On the first Set Dimension Intelligence Options page of the wizard, you specify the dimension to which you
want to apply dimension intelligence. The dimension intelligence enhancement added to this selected dimension
will result in changes to the dimension. These changes will be inherited by all cubes that include the selected
dimension.
NOTE
If you select Account as the dimension, you will be specifying account intelligence for the dimension. For more information,
see Add Account Intelligence to a Dimension.
NOTE
A custom aggregation is available only for dimensions that are based on existing data sources. For dimensions that were
created without using a data source, you must run the Schema Generation Wizard to create a data source view before
adding the custom aggregation.
To add a custom aggregation, you use the Business Intelligence Wizard, and select the Specify a unary operator
option on the Choose Enhancement page. This wizard then guides you through the steps of selecting a
dimension to which you want to apply a custom aggregation and identifying the custom aggregation.
NOTE
Before you run the Business Intelligence Wizard to add a custom aggregation, make sure that the dimension that you want
to enhance contains a parent-child attribute hierarchy. For more information, see Parent-Child Dimensions.
Selecting a Dimension
On the first Specify a Unary Operator page of the wizard, you specify the dimension to which you want to apply
a custom aggregation. The custom aggregation added to this selected dimension will result in changes to the
dimension. These changes will be inherited by all cubes that include the selected dimension.
NOTE
A custom member formula is available only for dimensions that are based on existing data sources. For dimensions that were
created without using a data source, you must run the Schema Generation Wizard to create a data source view before
adding a custom member formula.
To add a custom member formula, you use the Business Intelligence Wizard, and select the Create a custom
member formula option on the Choose Enhancement page. This wizard then guides you through the steps of
selecting a dimension to which you want to apply a custom member formula and enabling the custom member
formula.
Selecting a Dimension
On the first Create a Custom Member Formula page of the wizard, you specify the dimension to which you
want to apply a custom member formula. The custom member formula enhancement added to this selected
dimension will result in changes to the dimension. These changes will be inherited by all cubes that include the
selected dimension.
See Also
Use the Business Intelligence Wizard to Enhance Dimensions
BI Wizard - Define the Ordering for a Dimension
5/16/2018 • 2 minutes to read • Edit Online
Selecting a Dimension
On the first Specify Attribute Ordering page of the wizard, you specify the dimension to which you want to
apply attribute ordering. The attribute ordering enhancement added to this selected dimension will result in
changes to the dimension. These changes will be inherited by all cubes that include the selected dimension.
Specifying Ordering
On the second Specify Attribute Ordering page of the wizard, you specify how all the attributes in the dimension
will be ordered.
In the Ordering Attribute column, you can change the attribute used to do the ordering. If the attribute that you
want to use to order members is not in the list, scroll down the list, and then select <New attribute...> to open the
Select a Column dialog box, where you can select a column in a dimension table. Selecting a column by using the
Select a Column dialog box creates an additional attribute with which to order members of an attribute.
In the Criteria column, you can then select whether to order the members of the attribute by either Key or Name.
BI Wizard - Enable Dimension Writeback
5/16/2018 • 2 minutes to read • Edit Online
NOTE
Writeback is supported for SQL Server relational databases and data marts only.
Selecting a Dimension
On the first Enable Dimension Writeback page of the wizard, you specify the dimension to which you want to
apply dimension writeback. The dimension writeback enhancement added to this selected dimension will result in
changes to the dimension. These changes will be inherited by all cubes that include the selected dimension.
Remarks
When you create a new member, you must include every attribute in a dimension. You cannot insert a member
without specifying a value for the key attribute of the dimension. Therefore, creating members is subject to any
constraints (such as non-null key values) that are defined on the dimension table. You should also consider
columns optionally specified by dimension properties, such as columns specified in the CustomRollupColumn,
CustomRollupPropertiesColumn or the UnaryOperatorColumn dimension properties.
WARNING
If you use SQL Azure as a data source to perform writeback into an Analysis Services database, the operation fails. This is by
design, because the provider option that enables multiple active result sets (MARS) is not turned on by default.
The workaround is to add the following setting in the connection string, to support MARS and to enable writeback:
"MultipleActiveResultSets=True"
For more information see Using Multiple Active Result Sets (MARS).
See Also
Write-Enabled Dimensions
Configure String Storage for Dimensions and
Partitions
5/16/2018 • 4 minutes to read • Edit Online
VALUE DESCRIPTION
IMPORTANT
Changing the string storage settings of an object requires that you reprocess the object itself and any dependent object.
Processing is required to complete the procedure.
In an Analysis Services multidimensional database, strings are stored separately from numeric data to allow for
optimizations based on characteristics of the data. String data is typically found in dimension attributes that
represent names or descriptions. It is also possible to have string data in distinct count measures. String data can
also be used in keys.
You can identify a string store by its file extension (for example, asstore, .bstore, .ksstore, or .string files). By default,
each of these files is subject to a maximum 4 GB limit. In SQL Server 2012 (11.x), you can override the maximum
file size by specifying an alternative storage mechanism that allows a string store to grow as needed.
In contrast with the default string storage architecture which limits the size of the physical file, larger string storage
is based on a maximum number of strings. The maximum limit for larger string storage is 4 billion unique strings
or 4 billion records, whichever occurs first. Larger string storage creates records of an even size, where each record
is equal to a 64K page. If you have very long strings that do not fit in a single record, your effective limit will be less
than 4 billion strings.
Prerequisites
You must have a SQL Server 2012 (11.x) or later version of Analysis Services.
Dimensions and partitions must use MOLAP storage.
The database compatibility level must be set to 1100. If you created or deployed a database using SQL Server
Data Tools and the SQL Server 2012 (11.x) or later version of Analysis Services, the database compatibility level is
already set to 1100. If you moved a database created in an earlier version of Analysis Services to ssSQL11 or later,
you must update the compatibility level. For databases that you are moving, but not redeploying, you can use SQL
Server Management Studio to set the compatibility level. For more information, see Compatibility Level of a
Multidimensional Database (Analysis Services).
See Also
Tools and Approaches for Processing (Analysis Services)
Processing Options and Settings (Analysis Services)
Partition Storage Modes and Processing
Dimension Storage
Define Linked Dimensions
5/16/2018 • 3 minutes to read • Edit Online
NOTE
Because refresh is not available, most Analysis Services developers copy dimensions rather than link them. You can copy
dimensions across projects within the same solution. For more information, see Refresh of a linked dimension in SSAS.
Prerequisites
The source database that provides the dimension and the current database that uses it must be at the same version
and compatibility level. For more information, see Compatibility Level of a Multidimensional Database (Analysis
Services).
The source database must be deployed and online. Servers that publish or consume linked objects must be
configured to allow the operation (see below ).
The dimension you want to use cannot itself be a linked dimension.
Next Steps
You cannot change the structure of a linked dimension, so you cannot view it with the Dimension Structure tab of
Dimension Designer. After processing the linked dimension, you can view it with the Browser tab. You can also
change its name and create a translation for the name.
See Also
Compatibility Level of a Multidimensional Database (Analysis Services)
Linked Measure Groups
Dimension Relationships
Cubes in Multidimensional Models
5/16/2018 • 2 minutes to read • Edit Online
Components of Cubes
A cube is composed of:
ELEMENT DESCRIPTION
Measures and Measure Groups Create Measures and Measure Groups in Multidimensional
Models
Related Tasks
TOPIC DESCRIPTION
Create a Cube Using the Cube Wizard Describes how to use the Cube Wizard to define a cube,
dimensions, dimension attributes, and user-defined
hierarchies.
TOPIC DESCRIPTION
Create Measures and Measure Groups in Multidimensional Describes how to define measure groups.
Models
NOTE
You might occasionally have to create a cube without using existing tables. To create an empty cube, select Create an
empty cube. To generate tables, select Generate tables in the data source.
NOTE
The Select Existing Dimensions page appears if dimensions already exist in the database for any of the selected
measure groups.
6. On the Select New Dimensions page, select the new dimensions to create, and then click Next.
NOTE
The Select New Dimensions page appears if any tables would be good candidates for dimension tables, and the
tables have not already been used by existing dimensions.
7. On the Select Missing Dimension Keys page, select a key for the dimension, and then click Next.
NOTE
The Select Missing Dimension Keys page appears if any of the dimension tables that you specified do not have a
key defined.
8. On the Completing the Wizard page, enter a name for the new cube and review the cube structure. If you
want to make changes, click Back; otherwise, click Finish.
NOTE
You can use Cube Designer after you complete the Cube Wizard to configure the cube. You can also use Dimension
Designer to add, remove, and configure attributes and hierarchies in the dimensions that you created.
Create a Cube from a template without using a Data
Source View
11/28/2018 • 9 minutes to read • Edit Online
Selecting Dimensions
Use the Select Dimensions page of the wizard to add existing dimensions to the cube. This page appears only if
there are already shared dimensions without a data source in the project or database. It does not list dimensions
that have a data source.
To add existing dimensions, select one or more dimensions in the Shared dimensions list and click the right arrow
(>) button to move them to the Cube dimensions list. Click the double-arrow (>>) button to move all the
dimensions in the list.
Measure Name A value in this column defines the name of a measure in the
cube. Click a value in this column to type a name. Click Add
new measure in this column to create a new measure. This
column sets the Name property on the measure object.
Measure Group The name of the measure group that contains the measure.
Click this value to either choose or type a name. If you delete
all the measures that belong to a particular measure group,
the measure group is removed as well. This column sets the
Name property for the measure group object.
Data Type The data type for the measure. Click this value to change the
data type. The default when you create a measure is Single.
This column sets the DataType property on the measure
object.
Aggregation The standard aggregation for the measure. Click this cell to
specify one of the standard aggregations for the measure (or
None). The default when you create a measure is Sum. This
column sets the AggregationFunction property on the
measure object.
COLUMN DESCRIPTION
Name Displays the dimension name. Click this cell to type a different
name. This value sets the Name property for the dimension
object.
NOTE
The Define Time Periods page appears only if you include a time dimension in your cube on the Define New Dimensions
page of the wizard.
Select the time periods (Year, Half Year, Quarter, Trimester, Month, Ten Days, Week, and Date) that you want
to include in your schema. You must select the Date time period; the Date attribute is the key attribute for the
dimension, so the dimension cannot function without it. You can also change the language used to label the
members of the dimension.
The time periods you select create corresponding time attributes in the new time dimension. The wizard also adds
related attributes that do not appear in the list. For example, when you select Year and Half Year time intervals, the
wizard creates Day of Year, Day of Half Year, and Half Years of Year attributes, in addition to Year and Half Year
attributes.
After you finish creating the cube, you can use Dimension Designer to add or remove time attributes. Because the
Date attribute is the key attribute for the dimension, you cannot remove it. To hide the Date attribute from users,
you can change the AttributeHierarchyVisible property to False.
All the available time periods appear in the Time Periods pane of Dimension Designer. (This pane replaces the
Data Source View pane for dimensions that are based on dimension tables.) You can change the range of dates
for a dimension by changing the Source (time binding) property setting for the dimension. Because this is a
structural change, you must reprocess the dimension and any cubes that use it before browsing the data.
CALENDAR DESCRIPTION
Reporting (or marketing) calendar A twelve-month reporting calendar that includes two months
of four weeks and one month of five weeks in a recurring
three-month (quarterly) pattern. If you select this calendar,
specify the starting day and month and the three-month
pattern of 4-4-5, 4-5-4, or 5-4-4 weeks, where each digit
represents the number of weeks in a month.
Manufacturing calendar A calendar that uses 13 periods of four weeks, divided into
three quarters of four periods and one quarter of five periods.
If you select this calendar, specify the starting week (between
1 and 4) and month for the manufacturing year, and the
quarter with extra periods.
The calendar and settings you select determine the attributes that are created in the dimension. For example, if you
select the Year and Quarter time periods on the Define Time Periods page of the wizard and the Fiscal
calendar on this page, the FiscalYear, FiscalQuarter, FiscalQuarterOfYear attributes are created for the fiscal
calendar.
The wizard also creates calendar-specific hierarchies composed of the attributes that are created for the calendar.
For every calendar, each level in every hierarchy rolls up into the level above it. For example, in the standard 12-
month calendar, the wizard creates a hierarchy of Years and Weeks or Years and Months. However, weeks are not
contained evenly within months in a standard calendar, so there is no hierarchy of Years, Months, and Weeks. In
contrast, weeks in a reporting or manufacturing calendar are evenly divided into months, so in these calendars
weeks do roll up into months.
NOTE
A data source view must contain at least one table to be listed on this page. You cannot create a cube based on a data source
view that does not have any tables.
NOTE
On the Diagram tab, you can enlarge or maximize the wizard window to view the schema.
If there is a time dimension table in the data source view, select it in the Time dimension table list. If there are
none, leave <None> selected. This is the default item on the list. Selecting a table as the time dimension table also
selects it as a dimension table on the Tables and Diagram tabs.
Selecting Dimensions
Use the Select Dimensions page of the wizard to add existing dimensions to the cube. This page appears only if
there are already shared dimensions that correspond to dimension tables in the new cube.
To add existing dimensions, select one or more dimensions in the Shared dimensions list and click the right arrow
(>) button to move them to the Cube dimensions list. Click the double-arrow (>>) button to move all the
dimensions in the list.
If an existing dimension does not appear in the list and you think it should, you can click Back and change the table
type settings for one or more tables. An existing dimension must also be related to at least one of the fact tables in
the cube to appear in the Shared dimensions list.
Selecting Measures
Use the Select Measures page of the wizard to select the measures you want to include in the cube. Every table
marked as a fact table appears as a measure group in this list, and every numeric non-key column appears as a
measure on the list. By default every measure in every measure group is selected. You can clear the check box next
to measures that you do not want to include in the cube. To remove all the measures of a measure group from the
cube, clear the Measure Groups/Measures check box.
The names of measures listed under Measure Groups/Measures reflect column names. You can click the cell that
contains a name to edit the name.
To view data for any measure, right-click any of the measure rows in the list, and then click View sample data.
This opens the Data Sample Viewer and displays up to the first 1000 records from the corresponding fact table.
NOTE
You can enlarge or maximize the wizard window to view the tree better.
To remove any object in the tree from the cube, clear the check box next to it. Clearing the check box next to an
object also removes all the objects underneath it. Dependencies between objects are enforced, so if you remove an
attribute, any hierarchy levels dependent on the attribute are also removed. For example, clearing a check box next
to a hierarchy clears the check boxes next to all the levels in the hierarchy and removes the levels as well as the
hierarchies. The key attribute for a dimension cannot be removed.
You can rename any dimension, attribute, hierarchy or level either by clicking the name or by right-clicking the
name and then on the shortcut menu clicking Rename <object>, where <object> is Dimension, Attribute, or
Level.
There is not necessarily a one-to-one relationship between the number of dimension tables defined on the
Identify Fact and Dimension Tables page of the wizard and the number of dimensions listed on this page of the
wizard. Depending on relationships between tables in the data source view, the wizard can use two or more tables
to build a dimension (for example, as required by a snowflake schema).
Use the Perspective list to choose a perspective that is defined for the cube. Perspectives are defined in the
Perspectives tab of Cube Designer. To switch to a different perspective, select any perspective in the list.
Sp e c i fy i n g a T r a n sl a t i o n
Use the Language list to choose a translation that is defined for the cube. Translations are defined in the
Translations tab of Cube Designer. The Browser tab initially shows captions for the default language, which is
specified by the Language property for the cube. To switch to a different language, select any language in the list.
Form at t in g t h e Dat a Pan e
You can format captions and cells in the Data pane. Right-click the selected cells or captions that you want to
format, and then click Commands and Options. Depending on the selection, the Commands and Options
dialog box displays settings for Format, Filter and Group, Report, and Behavior.
Drag the measures you want to browse from the Metadata pane to the details area of the Data pane, which is the
large empty pane on the lower right side of the workspace. As you drag additional measures, they are added as
columns. A vertical line indicates where each additional measure will drop. Dragging the Measures folder drops all
the measures into the details area.
To remove a measure from the details area, either drag it out of the Data pane, or right-click it and then click
Delete on the shortcut menu.
A d d i n g o r R e m o v i n g D i m e n si o n s
Not Equal One or more members Values must not equal a specified
member.
Not In One or more named sets Values must not be in a specified named
set.
Range (Inclusive) One or two delimiting members of a Values must be between or equal to the
range delimiting members. If the delimiting
members are equal or only one member
is specified, no range is imposed and all
values are permitted.
Range (Exclusive) One or two delimiting members of a Values must be between the delimiting
range members. If the delimiting members are
the equal or only one member is
specified, values must be either greater
than or less than the delimiting
member.
For user-defined hierarchies, in which multiple members may be specified in the filter expression, all the specified
members must be at the same level and share the same parent. This restriction does not apply for parent-child
hierarchies.
To drill down into a particular member, click the plus sign (+) next to the member or double-click the member.
Sl i c i n g T h r o u g h C u b e D i m e n si o n s
To filter the cube data, click the drop-down list box on the top-level column heading. You can expand the hierarchy
and select or clear a member on any level to show or hide it and all its descendants. Clear the check box next to
(All) to clear all the members in the hierarchy.
After you have set this filter on dimensions, you can toggle it on or off by right-clicking anywhere in the Data pane
and clicking Auto Filter.
Fi l t er i n g Dat a
You can use the filter area to define a subcube on which to browse. You can add a filter by either clicking a
dimension in the Filter pane or by expanding a dimension in the Metadata pane and then dragging a hierarchy to
the Filter pane. Then specify an Operator and Filter Expression.
P e r fo r m i n g A c t i o n s
A triangle marks any heading or cell in the Data pane for which there is an action. This might apply for a
dimension, level, member, or cube cell. Move the pointer over the heading object to see a list of available actions.
Click the triangle in the cell to display a menu and start the associated process.
For security, the Browser tab only supports the following actions:
URL
Rowset
Drillthrough
Command Line, Statement, and Proprietary actions are not supported. URL actions are only as safe as the Web
page to which they link.
Vi e w i n g M e m b e r P r o p e r t i e s a n d C u b e C e l l I n fo r m a t i o n
To view information about a dimension object or cell value, move the pointer over the cell.
Sh o w i n g o r H i d i n g Em p t y C e l l s
You can hide empty cells in the data grid by right-clicking anywhere in the Data pane and clicking Show Empty
Cells.
View the Cube Schema
5/16/2018 • 2 minutes to read • Edit Online
TO DO THIS
Use a diagram from the data source view of the cube On the Data Source View menu, point to Copy Diagram
from, and then click the data source view diagram you want
to use.
- or -
Show only the tables that are used in the cube On the Data Source View menu, click Show Only Used
Tables.
- or -
Edit the data source view schema On the Data Source View menu, click Edit Data Source
View.
- or -
PROPERTY DESCRIPTION
Full: Every aggregation for the cube must include the All
member.
IncludeDimensionName:
The name of the dimension is included as part of the name of
the hierarchy. This is the default value.
ExcludeDimensionName:
The name of the dimension is not included as part of the
name of the hierarchy.
Native:
Analysis Services automatically determines the unique names
of members. This is the default value.
See Also
Dimensions (Analysis Services - Multidimensional Data)
Define Cube Hierarchy Properties
5/16/2018 • 2 minutes to read • Edit Online
PROPERTY DESCRIPTION
FullyOptimized:
The instance builds indexes for the hierarchy to improve query
performance. This is the default value.
NotOptimized:
The instance does not build additional indexes.
See Also
User Hierarchies
Define Cube Attribute Properties
5/16/2018 • 2 minutes to read • Edit Online
PROPERTY DESCRIPTION
Default:
The Aggregation Design Wizard applies a default rule based
on the type of attribute (Full for keys, Unrestricted for others).
None:
No aggregation for the cube should include this attribute.
Unrestricted:
No restrictions are placed on the Aggregation Design Wizard
Full:
Every aggregation for the cube must include this attribute.
NotOptimized:
The instance does not build additional indexes.
See Also
Define Cube Dimension Properties
Define Cube Hierarchy Properties
Define a Regular Relationship and Regular
Relationship Properties
5/16/2018 • 2 minutes to read • Edit Online
Introduction
Analysis Services supports many-to-many dimensions, allowing for more complex analytics than what can be
described in a classic star schema. In a classic star schema, all dimensions have a one-to-many relationship with a
fact table. Each fact joins to one dimension member; a single dimension member is associated with many facts.
Many-to-many removes this modeling restriction by enabling a fact (such as an account balance) to be associated
with multiple members of the same dimension (the balance of a joint account can be attributed to two or more
owners of a joint account).
Conceptually, a many-to-many dimensional relationship in Analysis Services is equivalent to many-to-many
relationships in a relational model, supporting the same kinds of scenarios. Common examples of many-to-many
include:
Students are enrolled in many courses; each course has many students.
Doctors have many patients; patients have many doctors.
Customers have many bank accounts; bank accounts might belong to more than one customer.
In Adventure Works, many customers have many reasons for ordering a product, and a sales reason can be
associated with many orders.
Analytically, the problem that a many-to-many relationship solves is accurate representation of a count or sum
relative to the dimensional relationship (usually by eliminating double-counts when performing calculations for a
specific dimension member). An example is necessary to clarify this point. Consider a product or service that
belongs to more than one category. If you were counting the number of services by category, you would want a
service belonging to both categories to be included in each one. At the same time, you would not want to
overstate the number of services that you provide. By specifying the many-to-many dimensional relationship, you
are more likely to get the correct results back when querying by category or by service. However, thorough testing
is always necessary to ensure that this is the case.
Structurally, creating a many-to-many dimensional relationship is similar to how you might create many-to-many
in a relational data model. Whereas a relational model uses a junction table to store row associations, a
multidimensional model uses an intermediate measure group. Intermediate measure group is the term we use to
refer to a table that maps members from different dimensions.
Visually, a many-to-many dimensional relationship is not indicated in a cube diagram. Instead, use the Dimension
Usage tab to quickly identify any many-to-many relationships in a model. A many-to-many relationship is
indicated by the following icon.
Click the button to open the Define Relationship dialog box to verify the relationship type is many-to-many, and to
view which intermediate measure group is used in the relationship.
In subsequent sections, you will learn how to set up a many-to-many dimension and test model behaviors. If you
would rather review additional information or try tutorials first, see Learn More at the end of this article.
NOTE
If the underlying data source does not provide primary and foreign key relationships, you can create the
relationships manually in the DSV. For more information, see Define Logical Relationships in a Data Source View
(Analysis Services).
The following example confirms that the tables used in this procedure are linked using primary keys.
Step 2: Create dimensions and measure groups
1. In SQL Server Data Tools, in a multidimensional project, right-click Dimensions and select New
Dimension.
2. Create a new dimension based on existing table, DimSalesReason. Accept all of the default values when
specifying the source.
For attributes, select all.
3. Create a second dimension based on existing table, Fact Internet Sales. Although this is a fact table, it
contains Sales Order information. We'll use it to build a Sales Order dimension.
4. In Specify Source Information, you will see a warning that indicates a Name column must be specified.
Choose SalesOrderNumber as the Name.
5. On the next page of the wizard, choose the attributes. In this example, you can select just
SalesOrderNumber.
6. Rename the dimension to Dim Sales Orders, so that you have a consistent naming convention for the
dimensions.
7. Right-click Cubes and select New Cube.
8. In measure group tables, choose FactInternetSales and FactInternetSalesReason.
You are choosing FactInternetSales because it contains the measures you want to use in the cube. You are
choosing FactInternetSalesReason because it is the intermediate measure group, providing member
association data that relates sales orders to sales reasons.
9. Choose measures for each fact table.
To simplify your model, clear all the measures, and then select just Sales Amount and Fact Internet Sales
Count at the bottom of the list. The FactInternetSalesReason only has one measure, so it is selected for
you automatically.
10. In the dimension list, you should see Dim Sales Reason and Dim Sales Orders.
In the Select New Dimensions page, the wizard prompts you to create a new dimension for Fact Internet
Sales Dimension. You do not need this dimension, so you can clear it from the list.
11. Name the cube and click Finish.
Step 3: Define Many-to-Many relationship
1. In cube designer, click Dimension Usage tab. Notice that there is already a many-to-many relationship
between Dim Sales Reason and Fact Internet Sales. Recall that the following icon indicates a many-to-
many relationship.
2. Click on the intersection cell between Dim Sales Reason and Fact Internet Sales, and then click the
button to open the Define Relationship dialog box.
You can see that this dialog box is used to specify a many-to-many relationship. If you were adding
dimensions that had a regular relationship instead, you would use this dialog box to change it to many-to-
many.
3. Deploy the project to an Analysis Services multidimensional instance. In the next step, you will browse the
cube in Excel to verify its behaviors.
Testing Many-to-Many
When you define a many-to-many relationship in a cube, testing is imperative to ensure queries return expected
results. You should test the cube using the client application tool that will be used by end-users. In this next
procedure, you will use Excel to connect to the cube and verify query results.
Browse the cube in Excel
1. Deploy the project and then browse the cube to confirm the aggregations are valid.
2. In Excel, click Data | From Other Sources | From Analysis Services. Enter the name of the server, choose
the database and cube.
3. Create a PivotTable that uses the following:
Sales Amount as the Value
Sales Reason Name on Columns
Sales Order Number on Rows
4. Analyze the results. Because we are using sample data, the initial impression is that all sales orders have
identical values. However, if you scroll down, you begin to see data variation.
Part way down, you can find the sales amount and sales reasons for order number SO5382. Grand total of
this particular order is 539.99, and the purchase reasons attributed to this order include Promotion, Other
and Price.
Notice that the Sales Amount is correctly calculated for the order; it is 539.99 for the entire order. Although
539.99 is indicated for each reason, that value is not summed for all three reasons, erroneously inflating our
grand total.
Why put a sales amount under each sales reason in the first place? The answer is that it allows us to identify
the amount of sales we can attribute to each reason.
5. Scroll to the bottom of the worksheet. It is now easy to see that Price is the most important reason for
customer purchases, relative to other reasons as well as the grand total.
Learn more
Use the following links to get additional information that helps you master the concepts.
The many-to-many Revolution 2.0
Tutorial: Many-to-many dimension example for SQL Server Analysis Services
See Also
Dimension Relationships
Install Sample Data and Projects for the Analysis Services Multidimensional Modeling Tutorial
Deploy Analysis Services Projects (SSDT)
Perspectives in Multidimensional Models
Measures and Measure Groups
5/16/2018 • 3 minutes to read • Edit Online
LINK DESCRIPTION
Create Measures and Measure Groups in Multidimensional Choose from one of several approaches for creating measures
Models and measure groups.
Configure Measure Properties If you used the Cube Wizard to start your cube, you might
need to change the aggregation method, apply a data format,
set the visibility of the measure in client applications, or
possibly add a measure expression to manipulate the data
before values are aggregated.
Use Aggregate Functions Understand the aggregation methods that can be assigned to
a measure.
Define Semiadditive Behavior Semiadditive behavior refers to aggregations that are valid for
some dimensions but not others. A common example is a
bank account balance. You might want to aggregate balances
by customer and region, but not time. For example, you
would not want to add balances from the same account over
consecutive days. To define semiadditive behavior, use the
Add Business Intelligence Wizard.
Linked Measure Groups Repurpose an existing measure group in other cubes in the
same database or in different Analysis Services databases.
Measures
A measure represents a column that contains quantifiable data, usually numeric, that can be aggregated. Measures
represent some aspect of organizational activity, expressed in monetary terms (such as revenue, margins, or costs)
or as counts (inventory levels, number of employees, customers, or orders), or as a more complex calculation that
incorporates business logic.
Every cube must have at least one measure, but most have many, sometimes numbering in the hundreds.
Structurally, a measure is often mapped to a source column in a fact table, with the column providing the values
used to load the measure. Alternatively, you can also define a measure using MDX.
Measures are context-sensitive, operating on numeric data in a context that is determined by whichever dimension
members happen to be included in the query. For example, a measure that calculates Reseller Sales will be
backed by a Sum operator, and it will add the sales amounts for each dimension member included in the query.
Whether the query specifies individual products, rolls up to a category, or is sliced by time or geography, the
measure should produce an operation that is valid for the dimensions included in the query.
In this example Reseller Sales aggregates to various levels along the Sales Territory hierarchy.
Measures produce valid results when the fact table that contains the numeric source data also contains pointers to
dimension tables that are used in the query. Using the Reseller Sales example, if each row storing a sales amount
also stores a pointer to a product table, a date table, or a sales territory table, then queries that include members
from those dimension will resolve correctly.
What happens if the measure is unrelated to the dimensions used in query? Typically, Analysis Services will show
the default measure, and the value will be the same for all members. In this example, Internet Sales, which
measure direct sales placed by customers using the online catalog, has no relationship to the sales organization.
To minimize the chances of encountering these behaviors in a client application, you could build multiple cubes or
perspectives within the same database, and ensure that each cube or perspective contains only related objects. The
relationships you need to check are between the measure group (mapped to the fact table) and the dimensions.
Measure Groups
In a cube, measures are grouped by their underlying fact tables into measure groups. Measure groups are used to
associate dimensions with measures. Measure groups are also used for measures that have distinct count as their
aggregation behavior. Placing each distinct count measure into its own measure group optimizes aggregation
processing.
A simple MeasureGroup object is composed of basic information like the group name, storage mode, and
processing mode. It also contains its constituent parts; the measures, dimensions, and partitions that form the
composition of the measure group.
See Also
Cubes in Multidimensional Models
Create Measures and Measure Groups in Multidimensional Models
Create Measures and Measure Groups in
Multidimensional Models
5/16/2018 • 6 minutes to read • Edit Online
Cube Wizard Run the Cube Wizard in SQL Server Data Tools (SSDT) to
create a cube.
New Measure dialog Assuming the cube already exists in SQL Server Data Tools
(SSDT), double-click the cube name in Solution Explorer to
open it in Cube Designer. In the Measures pane, right-click
the top node to create a new measure group, or new
measures, by specifying a source table, column, and
aggregation type. Using this approach requires that you
choose the aggregation method from a fixed list of prebuilt
functions. See Use Aggregate Functions for a discussion of
the more commonly used aggregations.
Calculated member Calculated members add flexibility and analysis capability to a
cube in Analysis Services because you can control when and
how they are created. Sometimes you only need a measure
temporarily, for the duration of a user session, or in
Management Studio as part of an investigation.
MDX or XMLA In SQL Server Management Studio, you can execute MDX or
XMLA to alter a database to include a new calculated
measure. This approach is useful for ad hoc testing of data,
after the solution is deployed to a server. See Document and
Script an Analysis Services Database.
Components of a measure
A measure is an object with properties. In addition to its name, a measure must have an aggregation type and a
source column or an expression used to load the measure with data. You can modify the measure definition by
setting its properties.
The fact table contains two basic types of columns: attribute columns and measure columns.
Attribute columns are used to create foreign key relationships to dimension tables, so that the quantifiable
data in the measure columns can be organized by the data contained in the dimension tables. Attribute
columns are also used to define the granularity of a fact table and its measure group.
Measure columns define the measures contained by a measure group.
When you run the Cube Wizard, the foreign keys are filtered out. In the list of remaining columns to choose from,
you will see measure columns, plus attribute columns that are not identified as a foreign key. In the
FactSalesQuote example, the wizard will offer CalendarYear and CalendarQuarter in addition to
SalesAmountQuota. Only the SalesAmountQuota measure column will result in a workable measure for your
multidimensional model. The other date-based columns exist to qualify each quota amount. You should exclude
the other columns, CalendarYear and CalendarQuarter, from the measure list in the Cube Wizard (or remove
them from the measure group later in the designer).
The point to take away from this discussion is that not all columns offered by the wizard are useful as a measure.
Rely on your understanding of the data and how it will be used when deciding which columns to use as
measures. Remember that you can right-click a table in the data source view to explore the data, which can help
you identify which columns to use as measures. See Explore Data in a Data Source View (Analysis Services) for
more information.
NOTE
Not all measures are derived directly from a value stored in a column of the fact table. For example, the Sales Person
Count measure defined in the Sales Quota measure group of the Adventure Works sample cube is actually based on the
count of unique values (or distinct count) in the EmployeeKey column of the FactSalesQuota fact table.
See Also
Cubes in Multidimensional Models
Measures and Measure Groups
Configure Measure Group Properties
5/16/2018 • 2 minutes to read • Edit Online
PROPERTY DEFINITION
DataAggregation This property is reserved for future use and currently has no
effect. Therefore, it is recommended that you do not modify
this setting.
Description You can use this property to document the measure group.
EstimatedSize Specifies the estimated size (in bytes) of the measure group.
StorageLocation The file system storage location for the measure group. If
none is specified, the location is inherited from the cube that
contains the measure group.
StorageMode The storage mode for the measure group. Available values are
MOLAP, ROLAP, or HOLAP.
Measure Properties
Measures inherit certain properties from the measure group of which they are a member, unless those properties
are overridden at the measure level. Measure properties determine how a measure is aggregated, its data type,
the name that is displayed to the user, the display folder in which the measure will appear, its format string, any
measure expression, the underlying source column, and its visibility to users.
PROPERTY DEFINITION
DisplayFolder Specifies the folder in which the measure will appear when
users connect to the cube. When a cube has many measures,
you can use display folders to categorize the measures and
improve the user browsing experience.
FormatString You can select the format that is used to display measure
values to users by using the FormatString property of the
measure.
See Also
Configure Measure Group Properties
Modifying Measures
Use Aggregate Functions
5/16/2018 • 5 minutes to read • Edit Online
Aggregate Functions
Analysis Services provides functions to aggregate measures along the dimensions that are contained in measure
groups. The additivity of an aggregation function determines how the measure is aggregated across all the
dimensions in the cube. Aggregation functions fall into three levels of additivity:
Additive
An additive measure, also called a fully additive measure, can be aggregated along all the dimensions that are
included in the measure group that contains the measure, without restriction.
Semiadditive
A semiadditive measure can be aggregated along some, but not all, dimensions that are included in the measure
group that contains the measure. For example, a measure that represents the quantity available for inventory can
be aggregated along a geography dimension to produce a total quantity available for all warehouses, but the
measure cannot be aggregated along a time dimension because the measure represents a periodic snapshot of
quantities available. Aggregating such a measure along a time dimension would produce incorrect results. See
Define Semiadditive Behavior for details.
Nonadditive
A nonadditive measure cannot be aggregated along any dimension in the measure group that contains the
measure. Instead, the measure must be individually calculated for each cell in the cube that represents the
measure. For example, a calculated measure that returns a percentage, such as profit margin, cannot be
aggregated from the percentage values of child members in any dimension.
The following table lists the aggregation functions in Analysis Services, and describes both the additivity and
expected output of the function.
See Also
Measures and Measure Groups
MDX Function Reference (MDX)
Define Semiadditive Behavior
Define Semiadditive Behavior
5/16/2018 • 2 minutes to read • Edit Online
NOTE
This option is selected by default if the wizard does not detect an Account type dimension.
For each measure, you can select from the types of semiadditive functionality described in the following table.
ByAccount The system reads the semiadditive behavior specified for the
account type.
First Child The member value is evaluated as the value of its first child
along the time dimension.
FirstNonEmpty The member value is evaluated as the value of its first child
along the time dimension that contains data.
LastChild The member value is evaluated as the value of its last child
along the time dimension.
LastNonEmpty The member value is evaluated as the value of its last child
along the time dimension that contains data.
Any existing semiadditive behavior is overwritten when you complete the wizard.
Linked Measure Groups
5/16/2018 • 3 minutes to read • Edit Online
IMPORTANT
Linked measure groups are read-only. To pick up the latest changes, you must delete and recreate all linked measure groups
based on the modified source object. For this reason, copy and pasting measure groups between projects is an alternative
approach that you should consider in case future modifications to the measure group are required.
Usage Limitations
As noted previously, an important constraint to using linked measures is an inability to customize a linked
measure directly. Modifications to the data type, format, data binding, and visibility, as well as membership of the
items in the measure group itself, are all changes that must be made in the original measure group.
Operationally, linked measure groups are identical to other measure groups when accessed by client applications,
and are queried in the same manner as other measure groups.
When you query a cube that contains a linked measure group, the link is established and resolved during the first
calculation pass of the destination cube. Because of this behavior, any calculations that are stored in the linked
measure group cannot be resolved before the query is evaluated. In other words, calculated measures and
calculated cells must be recreated in the destination cube rather than inherited from the source cube.
The following list summarizes usage limitations.
You cannot create a linked measure group from another linked measure group.
You cannot add or remove measures in a linked measure group. Membership is defined only in the original
measure group.
Writeback is not supported in linked measure groups.
Linked measure groups cannot be used in multiple many-to-many relationships, especially when those
relationships are in different cubes. Doing so can result in ambiguous aggregations. For more information,
see Incorrect Amounts for Linked Measures in Cubes containing Many-to-Many Relationships.
The measures contained in a linked measure group can be directly organized only along linked dimensions
retrieved from the same Analysis Services database. However, you can use calculated members to relate
information from linked measure groups to the other, non-linked dimensions in your cube. You can also use an
indirect relationship, such as a reference or many-to-many relationship, to relate non-linked dimensions to a
linked measure group.
Create or modify a linked measure
Use SQL Server Data Tools to create a linked measure group.
1. Finalize any modifications to the original measure group now, in the source cube, so that you don't have to
recreate the linked measure groups later in subsequent cubes. You can rename a linked object, but you
cannot change any other properties.
2. In Solution Explorer, double-click the cube to which you are adding the linked measure group. This step
opens the cube in Cube Designer.
3. In Cube Designer, in either the Measures pane or Dimensions pane, right-click anywhere in either pane,
then select New Linked Object. This starts the Linked Object Wizard.
4. On the first page, specify the data source. This step establishes the location of the original measure group.
The default is the current cube in the current database, but you can also choose a different Analysis
Services database.
5. On the next page, choose the measure group or dimension you want to link. Dimensions and Cube objects,
such as measure groups, are listed separately. Only those objects not already present in the current cube
are available.
6. Click Finish to create the linked object. Linked objects appear in the Measures and Dimensions pane,
indicated by the link icon.
See Also
Define Linked Dimensions
Partitions in Multidimensional Models
12/7/2018 • 4 minutes to read • Edit Online
NOTE
Support for multiple partitions is available in the business intelligence edition and enterprise edition. The standard edition
does not support multiple partitions. For more information, see Features Supported by the Editions of SQL Server 2016.
Local Partitions
Local partitions are partitions that are defined, processed, and stored on one server. If you have large measure
groups in a cube, you might want to partition them out so that processing occurs in parallel across the partitions.
The advantage is that parallel processing provides faster execution. Because one partition processing job does not
have to finish before another starts, they can run in parallel. For more information, see Create and Manage a Local
Partition (Analysis Services).
Remote Partitions
Remote partitions are partitions that are defined on one server, but are processed and stored on another. If you
want to distribute storage of your data and metadata across multiple servers, use remote partitions. Ordinarily,
when you transition from development to production, the size of data under analysis grows several times over.
With such large chunks of data, one possible alternative is to distribute that data over multiple computers. This is
not just because one computer cannot hold all the data, but because you will want more than one computer
processing the data in parallel. For more information, see Create and Manage a Remote Partition (Analysis
Services).
Aggregations
Aggregations are precalculated summaries of cube data that help enable Analysis Services to provide rapid query
responses. You can control the number of aggregations created for a measure group by setting limits on storage,
performance gains, or arbitrarily stopping the aggregation build process after it has been running for a while.
More aggregations are not necessarily better. Every new aggregation comes at a cost, both in terms of disk space
and processing time. We recommend creating aggregations for a thirty percent performance gain, and then raising
the number only if testing or experience warrants it.For more information, see Designing Aggregations (Analysis
Services - Multidimensional).
Related Topics
TOPIC DESCRIPTION
Create and Manage a Local Partition (Analysis Services) Contains information about how to partition data using filters
or different fact tables without duplicating data.
Set Partition Storage (Analysis Services - Multidimensional) Describes how to configure storage for partitions.
Edit or Delete Partitions (Analyisis Services - Multidimensional) Describes how to view and edit partitions.
Merge Partitions in Analysis Services (SSAS - Contains information about how to merge partitions that
Multidimensional) have different fact tables or different data slices without
duplicating data.
Create and Manage a Remote Partition (Analysis Services) Describes how to create and manage a remote partition.
Create and Manage a Local Partition (Analysis
Services)
5/16/2018 • 8 minutes to read • Edit Online
TIP
Explore the data in Data Source View (DSV) to understand the range and depth of the data you are partitioning. For
example, if partitioning by date, you can sort on a date column to determine the upper and lower bounds of each partition.
Choose an approach
The most important consideration when creating partitions is to segment the data so that there are no duplicate
rows. Data must be stored in one, and only one, partition to avoid double counting any rows. As such, it's
common to partition by DATE so that you can define clear boundaries between each partition.
You can use either technique to distribute the fact data across multiple partitions. The following techniques can be
used to segment the data.
TECHNIQUE RECOMMENDATIONS
TECHNIQUE RECOMMENDATIONS
Use SQL queries to segment fact data Partitions can be sourced from SQL queries. During
processing, the SQL query is to retrieve the data. The query's
WHERE clause provides the filter that segments the data for
each partition. Analysis Services generates the query for you,
but you must fill in the WHERE clause to properly segment
the data.
Use tables in the DSV to segment fact data You can bind a partition to a table, named query, or view in
the DSV. As the basis of a partition, all three are functionally
equivalent. The entire table, named query, or view provides all
of the data to a single partition.
Notice that the following filters are mutually exclusive within each set:
"SaleYear" = 2013
"Continent" = 'Europe'
"Continent" = 'SouthAmerica'
"Country" = 'Mexico'
6. Click Check to check for syntax errors, and then click OK.
7. Repeat the previous steps to create the remaining partitions, modifying the WHERE clause each time to
select the next data slice.
8. Deploy the solution or process the partition to load the data. Be sure to process all partitions.
9. Browse the cube to verify the correct data is returned.
After you have a measure group that uses multiple measure groups, you can create additional partitions in SQL
Server Management Studio. Under a measure group, right-click the Partitions folder and select New Partitions
to start the wizard.
NOTE
Instead of filtering data in a partition, you can use the same query to create a name query in the DSV, and then base the
partition on the named query.
IMPORTANT
When you create mutually exclusive named queries for partitions in a DSV, ensure that the combined data for the partitions
includes all data from a measure group that you want to include in the cube. Make sure that you do not leave a default
partition based on the entire table for the measure group, or else the query based partitions will overlap the query based
on the complete table.
1. Create one or more named queries to use as the partition source. For more information, see Define
Named Queries in a Data Source View (Analysis Services).
The named query must be based on the fact table associated with the measure group. For example, if you
are partitioning the FactInternetSales measure group, the named queries in the DSV must specify the
FactInternetSales table in the FROM statement.
2. In SQL Server Data Tools, in Solution Explorer, double-click the cube to open it in Cube Designer, and then
click the Partitions tab.
3. Expand the measure group for which are adding partitions.
4. Click New Partition to start the Partition Wizard. If you created the named queries using the fact table
bound to the measure group, you should see each of the named queries you created in the previous step.
5. In Specify Source Information, choose one of the named queries you created in a previous step. If you do
not see any named queries, go back to the DSV and check the FROM statement.
6. Click Next to accept the default values for each subsequent page.
7. On the last page, Completing the Wizard, give the partition a descriptive name.
8. Click Finish.
9. Repeat the previous steps to create the remaining partitions, choosing a different named query each time
to select the next data slice.
10. Deploy the solution or process the partition to load the data. Be sure to process all partitions.
11. Browse the cube to verify the correct data is returned.
Next Step
When you create mutually exclusive queries for partitions, ensure that the combined partition data includes all
data you want to include in the cube.
As a final step, you normally want to remove the default partition that was based on the table itself (if it still
exists), or else the query based partitions will overlap the query based on the complete table.
See Also
Partitions (Analysis Services - Multidimensional Data)
Remote Partitions
Merge Partitions in Analysis Services (SSAS - Multidimensional)
Create and Manage a Remote Partition (Analysis
Services)
5/16/2018 • 5 minutes to read • Edit Online
Prerequisites
Before you create a remote partition, the following conditions must be met:
You must have a second Analysis Services instance and dedicated database to store the partitions. The
secondary database is single-purpose; it provides storage of remote partitions for a master database.
Both server instances must be the same version. Both databases should be the same functional level.
Both instances must be configured for TCP connections. Analysis Services does not support creation of
remote partitions by using the HTTP protocol.
Firewall settings on both computers must be set to accept outside connections. For information about
setting the firewall, see Configure the Windows Firewall to Allow Analysis Services Access.
The service account for the instance running the master database must have administrative access to the
remote instance of Analysis Services. If the service account changes, you must update permissions on both
the server and database.
You must be an Analysis Services administrator on both computers.
You must ensure your disaster recovery plan accommodates backup and restore of the remote partitions.
Using remote partitions can complicate backup and restore operations. Be sure to test your plan
thoroughly to be sure you can restore the necessary data.
NOTE
Remote partitions can be merged only with other remote partitions. If you are using a combination of local and remote
partitions, an alternative approach is to create new partitions that include the combined data, deleting the partitions you no
longer use.
NOTE
If you get an error indicating the data source does not exist in the collection, you must open the project of the
storage database, db-storage, and create a data source that points to the master database, db-master.
5. On the master server: Right-click the cube name in Solution Explorer, select Process and fully process the
cube.
See Also
Partitions (Analysis Services - Multidimensional Data)
Change a partition source to use a different fact table
5/16/2018 • 2 minutes to read • Edit Online
See Also
Create and Manage a Local Partition (Analysis Services)
Designing Aggregations (Analysis Services -
Multidimensional)
5/16/2018 • 2 minutes to read • Edit Online
See Also
Aggregations and Aggregation Designs
Edit or Delete Partitions (Analyisis Services -
Multidimensional)
5/16/2018 • 2 minutes to read • Edit Online
NOTE
Alternatively, you can use XMLA scripts that automate tasks for building, merging, and deleting partitions. XMLA script can
be created and executed in SQL Server Management Studio, or in custom SSIS packages that runs as a scheduled task. For
more information, see Automate Analysis Services Administrative Tasks with SSIS.
Partition source
Specifies the source table or named query for the partition. To change the source table, click the cell and then click
the browse (...) button.
If the partition is based on a query, click the browse ( ...) button to edit the query. This edits the Source property
for the partition. For more information, see Change a partition source to use a different fact table.
You can specify a table in the data source view that has the same structure as the original source table (in the
external data source from which the data is retrieved). The source can be in any of the data sources or data source
views of the cube database.
Storage settings
In Cube Designer, on the Partitions tab, you can click Storage Settings to pick one of the standard settings for
MOLAP, ROLAP, or HOLAP storage, or to configure custom settings for the storage mode and proactive caching.
The default is MOLAP because it delivers the fastest query performance. For more information about each setting,
see Set Partition Storage (Analysis Services - Multidimensional).
Storage can be configured separately for each partition of each measure group in a cube. You can also configure
the default storage settings for a cube or measure group. Storage is configured on the Partitions tab in the Cube
Wizard.
See Also
Create and Manage a Local Partition (Analysis Services)
Designing Aggregations (Analysis Services - Multidimensional)
Merge Partitions in Analysis Services (SSAS - Multidimensional)
Merge Partitions in Analysis Services (SSAS -
Multidimensional)
5/16/2018 • 8 minutes to read • Edit Online
Common scenarios
The single most common configuration for partition use involves the separation of data across the dimension of
time. The granularity of time associated with each partition varies depending on the business requirements
specific to the project. For example, segmentation might be by years, with the most recent year divided by
months, plus a separate partition for the active month. The active month partition regularly takes on new data.
When the active month is completed, that partition is merged back into the months in the year-to-date partition
and the process continues. At the end of the year, a whole new year partition has been formed.
As this scenario demonstrates, merging partitions can become a routine task performed on a regular basis,
providing a progressive approach for consolidating and organizing historical data.
Requirements
Partitions can be merged only if they meet all of the following criteria:
They have the same measure group.
They have the same structure.
They must be in a processed state.
They have the same storage modes.
They contain identical aggregation designs.
They share the same string store compatibility level (applies to partitioned distinct count measure groups
only).
If the target partition is empty (that is, it has an aggregation design but no aggregations), merge will drop the
aggregations for the source partitions. You must run Process Index, Process Full, or Process Default on the
partition to build the aggregations.
Remote partitions can be merged only with other remote partitions that are defined with the same remote
instance of Analysis Services.
NOTE
If you are using a combination of local and remote partitions, an alternative approach is to create new partitions that
include the combined data, deleting the partitions you no longer use.
To create a partition that is a candidate for future merging, when you create the partition in the Partition Wizard,
you can choose to copy the aggregation design from another of the cube's partitions. This ensures that these
partitions have the same aggregation design. When they are merged, the aggregations of the source partition are
combined with the aggregations in the target partition.
IMPORTANT
A merged MOLAP partition with an incomplete fact table contains an internally merged copy of fact table data and
operates correctly until it is processed.
IMPORTANT
A merged HOLAP or ROLAP partition with an incomplete fact table contains accurate aggregations, but incomplete facts.
Queries that refer to missing facts return incorrect data. When the partition is processed, aggregations are computed only
from available facts.
The absence of unavailable facts might not be noticed unless a user attempts to drill down to a fact in the
unavailable table or executes a query that requires a fact from the unavailable table. Because aggregations are
combined during the merge process, queries whose results are based only on aggregations return accurate data,
whereas other queries may return inaccurate data. Even after the resulting partition is processed, the missing data
from the unavailable fact table may not be noticed, especially if it represents only a small portion of the combined
data.
Fact tables can be merged before or after merging the partitions. However, the aggregations will not accurately
represent the underlying facts until both operations have been completed. It is recommended that you merge
HOLAP or ROLAP partitions that access different fact tables when users are not connected to the cube that
contains these partitions.
1. In Object Explorer, expand the Measure Groups node of the cube containing the partitions that you want
to merge, expand Partitions, right-click the partition that is the target or destination of the merge
operation. For example, if you are moving quarterly fact data to a partition that stores annual fact data,
select the partition that contains the annual fact data.
2. Click Merge Partitions to open the Merge Partition <partition name> dialog box.
3. Under Source Partitions, select the check box next to each source partition that you want to merge with
the target partition, and click OK.
NOTE
Source partitions are immediately deleted after the source is merged into the target partition. Refresh the Partitions
folder to update its contents after the merge is completed.
4. Right-click the partition containing the accumulated data and select Properties.
5. Open the Source property and modify the WHERE clause so that it includes the partition data you just
merged. Recall that the Source property is not updated automatically. If you reprocess without first
updating the Source, you might not get all of the expected data.
See Also
Processing Analysis Services Objects
Partitions (Analysis Services - Multidimensional Data)
Create and Manage a Local Partition (Analysis Services)
Create and Manage a Remote Partition (Analysis Services)
Set Partition Writeback
Write-Enabled Partitions
Configure String Storage for Dimensions and Partitions
Set Partition Storage (Analysis Services -
Multidimensional)
5/16/2018 • 7 minutes to read • Edit Online
Real Time ROLAP OLAP is in real time. Detail data and aggregations are stored
in relational format. The server listens for notifications when
data changes and all queries reflect the current state of the
data (zero latency).
Real Time HOLAP OLAP is in real time. Detail data is stored in a relational format
while aggregations are stored in a multidimensional format.
The server listens for notifications when data changes and
refreshes the multidimensional OLAP (MOLAP) aggregations
as needed. No MOLAP cache is created. Whenever the data
source is updated, the server switches to real-time relational
OLAP (ROLAP) until the aggregations are refreshed. All
queries reflect the current state of the data (zero latency).
Low Latency MOLAP Detail data and aggregations are stored in multidimensional
format. The server listens for notifications of changes to the
data and switches to real-time ROLAP while MOLAP objects
are reprocessed in a cache. A silence interval of at least 10
seconds is required before updating the cache. There is an
override interval of 10 minutes if the silence interval is not
attained. Processing occurs automatically as data changes
with a target latency of 30 minutes after the first change.
Medium Latency MOLAP Detail data and aggregations are stored in multidimensional
format. The server listens for notifications of changes to the
data and switches to real-time ROLAP while MOLAP objects
are reprocessed in cache. A silence interval of at least 10
seconds is required before updating the cache. There is an
override interval of 10 minutes if the silence interval is not
attained. Processing occurs automatically as data changes
with a target latency of four hours.
This setting is typically used for a data source when only daily
updates are required. Queries are always against data in the
MOLAP cache, which is not discarded until a new cache is
built and its objects are processed.
See Also
Partitions in Multidimensional Models
Set the Partition Slice Property (Analysis Services)
5/16/2018 • 2 minutes to read • Edit Online
Defining a Slice
Valid values for a slice property are an MDX member, set, or tuple. The following examples illustrate valid slice
syntax:
[Date].[Calendar].[Calendar Year].&[2010] Specify this slice on a partition containing facts from year
2010 (assuming the model includes a Date dimension with
Calendar Year hierarchy, where 2010 is a member). Although
the partition source WHERE clause or table might already filter
by 2010, specifying the Slice provides an additional check
during processing, as well as more targeted scans during
query execution.
{ [Sales Territory].[Sales Territory Country].&[Australia], [Sales Specify this slice on a partition containing facts that include
Territory].[Sales Territory Country].&[Canada] } sales territory information. A slice can be an MDX set
consisting of two or more members.
[Measures].[Sales Amount Quota] > '5000' This slice shows an MDX expression.
A data slice of a partition should reflect, as closely as possible, the data in the partition. For example, if a partition is
limited to 2012 data, the partition's data slice should specify the 2012 member of the Time dimension. It is not
always possible to specify a data slice that reflects the exact contents of a partition. For example, if a partition
contains data for only January and February, but the levels of the Time dimension are Year, Quarter, and Month,
the Partition Wizard cannot select both the January and February members. In such cases, select the parent of the
members that reflect the partition's contents. In this example, select Quarter 1.
NOTE
Note that dynamic MDX functions (such as Generate (MDX) or Except (MDX)) are not supported in the Slice property for
partitions. You must define the slice by using explicit tuples or member references.
For example, rather than using the range operator (:) to define a range, you would need to enumerate each member by the
specific years.
If you need to define a complex slice, we recommend that you define the tuples in the slice by using an XMLA Alter script.
Then, you can use either the ascmd command-line tool or the Analysis Services Execute DDL Task in Integration Services to
run the script and create the specified set of members immediately before you process the partition.
See Also
Create and Manage a Local Partition (Analysis Services)
Set Partition Writeback
5/16/2018 • 3 minutes to read • Edit Online
NOTE
Writeback is supported for SQL Server relational databases and data marts only, and only for Analysis Services
multidimensional models.
Incorrect use of partitions can result in inaccurate cube data. For more information, see Create and Manage a
Local Partition (Analysis Services).
Converting the writeback data table to a partition also write-disables the partition. All unrestricted read/write
policies and read/write permissions for the partition's cells are disabled, and end users will not be able to change
displayed cube data. (End users with disabled unrestricted read/write policies or disabled read/write permissions
will still be able to browse the cube.) Read and read-contingent permissions are not affected.
To convert writeback data to a partition, use the Convert to Partition dialog box, which is accessed by right-
clicking the writeback table for a write-enabled partition in SQL Server Management Studio. You specify a name
for the partition and whether to design the aggregation for the partition later or at the same time that you create
it. To create the aggregation at the same time you choose the partition, you must choose to copy the aggregation
design from an existing partition. This is normally, but not necessarily, the current writeback partition. You can also
choose to process the partition at the same time that you create it.
See Also
Write-Enabled Partitions
Enabling Write-back to an OLAP Cube at Cell Level in Excel 2010
Enabling and Securing Data Entry with Analysis Services Writeback
Calculations in Multidimensional Models
12/6/2018 • 2 minutes to read • Edit Online
Editing Scripts
Edit scripts in the Calculation Expressions pane of the Calculations tab. The Calculation Expressions pane has
two views, Script view and Form view. The Form view shows the expressions and properties for a single
command. When you edit an MDX script, an expression box fills the entire Form view.
The Script view provides a code editor in which to edit the scripts. While the Calculation Expressions pane is in
Script view, the Script Organizer pane is hidden. The Script view provides color coding, parenthesis matching,
auto-complete, and MDX code regions. The MDX code regions can be collapsed or expanded to facilitate editing.
You can switch between the Form view and the Script view by clicking the Cube menu, pointing to Show
Calculations in, and then clicking Script or Form. You can also click either Form view or Script view on the
toolbar.
Format String
Specifies the format of cell values that are based on the calculated member. This property accepts the same values
as the Display Format property for measures. For more information about display formats, see Configure
Measure Properties.
Visible
Determines whether the calculated member is visible or hidden when cube metadata is retrieved. If the calculated
member is hidden, it can still be used in MDX expressions, statements, and scripts, but it is not displayed as a
selectable object in client user interfaces.
Non-empty Behavior
Stores the names of measures used to resolve NON EMPTY queries in MDX. If this property is blank, the
calculated member must be evaluated repeatedly to determine whether a member is empty. If this property
contains the name of one or more measures, the calculated member is treated as empty if all the specified
measures are empty. This property is an optimization hint to Analysis Services to return only non-NULL records.
Returning only non-NULL records improves the performance of MDX queries that utilize the NON EMPTY
operator or the NonEmpty function, or that require the calculation of cell values. For best performance with cell
calculations, specify only a single member when possible.
Color Expressions
Specifies MDX expressions that dynamically set the foreground and background colors of cells based on the value
of the calculated member. This property is ignored if unsupported by client applications.
Font Expressions
Specifies MDX expressions that dynamically set the font, font size, and font attributes for cells based on the value
of the calculated member. This property is ignored if unsupported by client applications.
You can copy or drag cube components from the Metadata tab of the Calculation Tools pane to the
Expression box in the Calculation Expressions pane. You can copy or drag functions from the Functions tab in
the Calculation Tools pane to the Expression box in the Calculation Expressions pane.
See Also
Calculations in Multidimensional Models
Create Named Sets
5/16/2018 • 2 minutes to read • Edit Online
IMPORTANT
If you create the set expression by explicitly naming the members in the set, enclose the list of members in a pair of braces
({}).
See Also
Calculations in Multidimensional Models
Define Assignments and Other Script Commands
12/6/2018 • 2 minutes to read • Edit Online
IMPORTANT
When you initially switch to the Calculations tab of Cube Designer, the Script Organizer pane contains a single script with
a CALCULATE command. The CALCULATE command controls the aggregation of the cells in the cube and should be edited
only if you intend to manually specify how the cube is to be aggregated.
You can use the Calculation Expressions pane to build an expression in Multidimensional Expressions (MDX)
syntax. While you build the expression, you can drag or copy cube components, functions, and templates from the
Calculation Tools pane to the Calculation Expressions pane. Doing so adds the script for the item to the
Calculation Expressions pane in the location that you drop or paste it. Replace arguments and their delimiters («
and ») with the appropriate values.
IMPORTANT
When writing an expression that contains multiple statements using the Calculation Expressions pane, ensure that all lines
except the last line of the MDX script end with a semi-colon (;). Calculations are concatenated into a single MDX script, and
each script has a semi-colon appended to it to ensure that the MDX script compiles correctly. If you add a semi-colon to the
last line of the script in the Calculation Expressions pane, the cube will build and deploy correctly but you will be unable to
run queries against it.
See Also
Calculations in Multidimensional Models
Define Time Intelligence Calculations using the
Business Intelligence Wizard
5/16/2018 • 3 minutes to read • Edit Online
NOTE
The Timeintelligence.xml template file defines the time calculations that are listed in Available time calculations. If the
listed calculations do not meet your needs, you can either change the existing calculations or add new calculations to the
Timeintelligence.xml file.
TIP
To view a description for a calculation, use the up and down arrows to highlight that calculation.
Apply Time Views to Members
On the Define Scope of Calculations page, you specify the members to which the new time views apply. You
can apply the new time views to one of the following objects:
Members of an account dimension On the Define Scope of Calculations page, the Available
measures list includes account dimensions. Account dimensions have their Type properties set to
Accounts. If you have an accounts dimension but that dimension does not appear in the Available
measures list, you can use the Business Intelligence Wizard to apply the account intelligence to that
dimension. For more information, see Add Account Intelligence to a Dimension.
Measures Instead of specifying an account dimension, you can specify the measures to which the time
views apply. In this case, select the views to which selected time calculations apply. For example, assets and
liabilities are year-to-date data; therefore, you do not apply a Year-to-Date calculation to assets or liabilities
measures.
OBJECT CHANGE
Data source view Adds a calculated column in the time table for each new
attribute in the time dimension.
See Also
Create Calculated Members
Key Performance Indicators (KPIs) in
Multidimensional Models
10/26/2018 • 5 minutes to read • Edit Online
TERM DEFINITION
Trend An MDX expression that evaluates the value of the KPI over
time. The trend can be any time-based criterion that is useful
in a specific business context.
Status indicator A visual element that provides a quick indication of the status
for a KPI. The display of the element is determined by the
value of the MDX expression that evaluates status.
Trend indicator A visual element that provides a quick indication of the trend
for a KPI. The display of the element is determined by the
value of the MDX expression that evaluates trend.
Display folder The folder in which the KPI will appear when a user is
browsing the cube.
Parent KPI A reference to an existing KPI that uses the value of the child
KPI as part of computation of the parent KPI. Sometimes, a
single KPI will be a computation that consists of the values for
other KPIs. This property facilitates the correct display of the
child KPIs underneath the parent KPI in client applications.
Current time member An MDX expression that returns the member that identifies
the temporal context of the KPI.
Parent KPIs
An organization may track different business metrics at different levels. For example, only two or three KPIs may
be used to gauge business success for the whole company, but these company-wide KPIs may be based on three
or four other KPIs tracked by the business units throughout the company. Also, business units in a company may
use different statistics to calculate the same KPI, the results of which are rolled up to the company-wide KPI.
Analysis Services lets you define a parent-child relationship between KPIs. This parent-child relationship lets the
results of the child KPI be used to calculate the results of the parent KPI. Client applications can also use this
relationship to appropriately display parent and child KPIs.
Weights
Weights can also be assigned to child KPIs. Weights enable Analysis Services to proportionally adjust the results
of the child KPI when calculating the value of the parent KPI.
TYPE DESCRIPTION
For Action Expression, specify the parameters that are passed when the action is run. The syntax must evaluate
to a string, and you must include an expression written in MDX. For example, your MDX expression can indicate a
part of the cube that is included in the syntax. MDX expressions are evaluated before the parameters are passed.
Also, MDX Builder is available to help you build MDX expressions.
Additional Properties
Select the property. The following table summarizes the available properties.
PROPERTY DESCRIPTION
Batch
Interactive
On Open
NOTE
You must use Analysis Services Scripting Language (ASSL) or Analysis Management Objects (AMO) to define HTML and
Command Line action types. For more information, see Action Element (ASSL), Type Element (Action) (ASSL), and
Programming AMO OLAP Advanced Objects.
PROPERTY DESCRIPTION
Parameters (Optional)
The parameters are sent to the server as part of the URL string when the action is created. They include
Parameter Name and Parameter Value, which is an MDX expression.
The report server URL is constructed as follows:
http://
host
/
virtualdirectory
/Path&
parametername1
=
parametervalue1
& ...
For example:
http://localhost/ReportServer/Sales/YearlySalesByCategory?rs:Command=Render&Region=West
See Also
Cubes in Multidimensional Models
Actions (Analysis Services - Multidimensional Data)
10/26/2018 • 4 minutes to read • Edit Online
IMPORTANT
In order for a business user to use actions, the client application employed by the business user must support actions.
Types of Actions
The following table lists the types of actions that are included in Analysis Services:
See Also
Actions in Multidimensional Models
Add a Standard Action
5/16/2018 • 3 minutes to read • Edit Online
IF YOU SELECT THE FOLLOWING TARGET TYPE MAKE THE FOLLOWING SELECTION IN TARGET OBJECT
Level members Select a single level. The action will be associated with
all members of the selected level.
In Target object, click the arrow at the right of the text box, and in the tree view that opens, click the
object to which you want to attach the action, and then click OK.
(Optional.) In Condition, create an MDX expression to limit the target of the action. You can either
type the expression manually, or you can drag items from the Metadata and Functions tabs.
From the Type drop-down list, select the type of action that you want to create. The following table
lists the types of actions that are available.
TYPE DESCRIPTION
In Action expression, create an expression that defines the action. The expression must evaluate to a
string. You can either type the expression manually, or you can drag items from the Metadata and
Functions tabs.
3. (Optional.) Expand Additional Properties, and then perform one of the following steps:
From the Invocation drop-down list, specify how the action is invoked. The following table describes
the available options for invoking an action.
OPTION DESCRIPTION
In Application, type the name of the application that is associated with the action. For example, if
you create an action that takes a user to a particular Web site, the application associated with the
action should be Microsoft Internet Explorer or another Web browser.
NOTE
Proprietary actions are not returned to the server unless the client application explicitly restricts the schema
rowset to return only actions that match the name specified in Application.
In Action Content, if you are using the URL type, enclose the Internet address in quotes, For
example, "http://www.adventure-works.com".
In Description, type a description for the action.
In Caption, type a caption or an MDX expression that evaluates to a caption. This caption is displayed
to end users when the action is initiated. If you do not specify a caption, the name of the action is used
instead.
From the Caption is MDX drop-down list, specify whether the caption is MDX. This field indicates to
the server whether to evaluate the contents of Caption as an MDX expression.
Test an Action
12/7/2018 • 2 minutes to read • Edit Online
NOTE
After you create the action, it will become available to users after you update or reprocess the cube. For more information,
see Processing a multidimensional model (Analysis Services).
See Also
Actions (Analysis Services - Multidimensional Data)
Perspectives in Multidimensional Models
12/7/2018 • 2 minutes to read • Edit Online
Renaming Perspectives
The first row of each perspective shows its name. When you create a perspective, the name is initially Perspective
(followed by an ordinal number, starting with 1, if there is already a perspective called Perspective). You can click
the name to edit it.
See Also
Cubes in Multidimensional Models
Translations in Multidimensional Models (Analysis
Services)
10/26/2018 • 7 minutes to read • Edit Online
Defining Translations
Add translations to a cube
You can add translations to the cube, measure groups, measures, cube dimension, perspectives, KPIs, actions,
named sets, and calculated members.
1. In Solution Explorer, double-click the cube name to open cube designer.
2. Click the Translations tab. All objects that support translations are listed in this page.
3. For each object, specify the target language (resolves internally to an LCID ), translated caption, and
translated description. The language list is consistent throughout Analysis Services, whether you are setting
the server language in Management Studio, or adding a translation override on a single attribute.
Remember that you cannot change the collation. A cube essentially uses one collation, even if you're
supporting multiple languages through translated captions (there is an exception for dimension attributes,
discussed below ). If the languages won't sort properly under the shared collation, you will need to make
copies of the cube just to accommodate your collation requirements.
4. Build and deploy the project.
5. Connect to the database using a client application, such as Excel, modifying the connection string to use the
locale identifier. See Globalization Tips and Best Practices (Analysis Services) for details.
Add translations to a dimension and attributes
You can add translations to database dimensions, attributes, hierarchies, and levels within a hierarchy.
Translated captions are added to the model manually using your keyboard or copy-paste, but for dimension
attribute members, you can obtain translated values from an external database. Specifically, the CaptionColumn
property of an attribute can be bound to a column in a data source view.
At the attribute level, you can override collation settings, for example you might want to adjust width-sensitivity or
use a binary sort for a specific attribute. In Analysis Services, collation is exposed where data bindings are defined.
Because you are binding a dimension attribute translation to a different source column in the DSV, a collation
setting is available so that you can specify the collation used by the source column. See Set or Change the Column
Collation for details about column collation in the relational database.
1. In Solution Explorer, double-click the dimension name to open dimension designer.
2. Click the Translations tab. All dimension objects that support translations are listed in this page.
For each object, specify target language (resolves to an LCID ), translated caption, and translated
description. The language list is consistent throughout Analysis Services, whether you are setting the server
language in Management Studio, or adding a translation override on a single attribute.
3. To bind an attribute to a column providing translated values:
a. Still in Dimension Designer | Translations, add a new translation. Choose the language. A new
column appears on the page to accept the translated values.
b. Place the cursor in an empty cell adjacent to one of the attributes. The attribute cannot be the key,
but all other attributes are viable choices. You should see a small button with a dot in it. Click the
button to open the Attribute Data Translation Dialog Box.
c. Enter a translation for the caption. This is used as a data label in the target language, for example as
a field name in a PivotTable field list.
d. Choose the source column that provides the translated values of attribute members. Only pre-
existing columns in the table or query bound to the dimension, are available. If the column does not
exist, you need to modify the data source view, dimension, and cube to pick up the column.
e. Choose the collation and sort order, if applicable.
4. Build and deploy the project.
5. Connect to the database using a client application, such as Excel, modifying the connection string to use the
locale identifier. See Globalization Tips and Best Practices (Analysis Services) for details.
Add a translation of the database name
At the database level, you can add translations for the database name and description. The translated database
name might be visible on client connections that specify the LCID of the language, but that depends on the tool.
For example, viewing the database in Management Studio will not show the translated name, even if you specify
the locale identifier on the connection. The API used by Management Studio to connect to Analysis Services does
not read the Language property.
1. In Solution Explorer, right-click project name | Edit Database to open the database designer.
2. In Translations, specify target language (resolves to an LCID ), translated caption, and translated description.
The language list is consistent throughout Analysis Services, whether you are setting the server language
in Management Studio, or adding a translation override on a single attribute.
3. In the Properties page of the database, set Language to the same LCID you specified for the translation.
Optionally, set the Collation as well if the default no longer makes sense.
4. Build and deploy the database.
Resolving Translations
If a client application requests information in a specified language identifier, the Analysis Services instance
attempts to resolve data and metadata for Analysis Services objects to the closest possible language identifier. If
the client application does not specify a default language, or specifies the neutral locale identifier (0) or process
default language identifier (1024), then Analysis Services uses the default language for the instance to return data
and metadata for Analysis Services objects.
If the client application specifies a language identifier other than the default language identifier, the instance
iterates through all available translations for all available objects. If the specified language identifier matches the
language identifier of a translation, Analysis Services returns that translation. If a match cannot be found, Analysis
Services attempts to use one of the following methods to return translations with a language identifier closest to
the specified language identifier:
For the following language identifiers, Analysis Services attempts to use an alternate language identifier if a
translation for the specified language identifier is not defined:
For all other specified language identifiers, Analysis Services extracts the primary language of the specified
language identifier and retrieves the language identifier indicated by Windows as the best match for the
primary language. If a translation for the best match language identifier cannot be found, or if the specified
language identifier is the best match for the primary language, then the default language is used.
See Also
Globalization scenarios for Analysis Services
Languages and Collations (Analysis Services)
Multidimensional Model Solution Deployment
10/26/2018 • 4 minutes to read • Edit Online
Deployment Methods
METHOD DESCRIPTION LINK
Analysis Management Objects AMO provides a programmatic Developing with Analysis Management
(AMO) Automation interface to the complete command set Objects (AMO)
for Analysis Services, including
commands that can be used for
solution deployment. As an approach
for solution deployment, AMO
automation is the most flexible, but it
also requires a programming effort. A
key advantage to using AMO is that
you can use SQL Server Agent with
your AMO application to run
deployment on a preset schedule.
METHOD DESCRIPTION LINK
XMLA Use SQL Server Management Studio to Deploy Model Solutions Using XMLA
generate an XMLA script of the
metadata of an existing Analysis
Services database, and then run that
script on another server to recreate the
initial database. XMLA scripts are easily
formed in SQL Server Management
Studio by defining the deployment
process, then codifying it and saving it
in an XMLA script. Once you have the
XMLA script in a saved file, you can
easily run the script according to a
schedule, or embed the script in an
application that connects directly to an
instance of Analysis Services.
Deployment Wizard Use the Deployment Wizard to use the Deploy Model Solutions Using the
XMLA output files generated by an Deployment Wizard
Analysis Services project to deploy the
project's metadata to a destination
server. With the Deployment Wizard,
you can deploy directly from the
Analysis Services file, as created by the
output directory by project build.
Deployment Utility The Deployment utility lets you start Deploy Model Solutions with the
the Analysis Services deployment Deployment Utility
engine from a command prompt.
METHOD DESCRIPTION LINK
Synchronize Database Wizard Use the Synchronize Database Wizard Synchronize Analysis Services Databases
to synchronize the metadata and data
between any two Analysis Services
databases.
Backup and Restore Backup offers the simplest approach to Backup and Restore of Analysis Services
transferring Analysis Services databases. Databases
From the Backup dialog box, you can
set the options configuration, and then
you can run the backup from the dialog
box itself. Or, you can create a script
that can be saved and run as frequently
as required.
Deployment considerations
Before you deploy an Analysis Services project, consider which of these questions apply to your solution and then
review the related link to learn ways of addressing the issue:
What hardware and software resources are required for this Requirements and Considerations for Analysis Services
solution? Deployment
How will you deploy related objects that are outside the scope
of the Analysis Services project, such as Integration Services
packages, reports, or relational database schemas?
How will you load and update the data in the deployed Deployment Methods in this topic.
Analysis Services database?
Do you want to give users access to Analysis Services data Configure HTTP Access to Analysis Services on Internet
through the Internet? Information Services (IIS) 8.0
CONSIDERATION LINK TO MORE INFORMATION
Do you want to provide continuous query access to Analysis Requirements and Considerations for Analysis Services
Services data? Deployment
Do you want to deploy objects in a distributed environment Create and Manage a Local Partition (Analysis Services),
by using linked objects or remote partitions? Create and Manage a Remote Partition (Analysis Services) and
Linked Measure Groups.
How will you secure the Analysis Services data? Authorizing access to objects and operations (Analysis
Services)
Related Tasks
Requirements and Considerations for Analysis Services Deployment
Deploy Model Solutions Using XMLA
Deploy Model Solutions Using the Deployment Wizard
Deploy Model Solutions with the Deployment Utility
Requirements and Considerations for Analysis
Services Deployment
11/28/2018 • 6 minutes to read • Edit Online
Availability Considerations
In an Analysis Services environment, a cube or mining model may be unavailable for querying because of a
hardware or software failure. A cube also may be unavailable because it needs to be processed.
Providing Availability in the Event of Hardware or Software Failures
Hardware or software may fail for various reasons. However, maintaining availability of your Analysis Services
installation is not only about troubleshooting the source of those failures, but also about providing alternative
resources that enable the user to continue using the system if a failure occurs. Clustering and load balancing
servers are typically used to provide the alternative resources that are necessary to maintain availability when
hardware or software failures occur.
To provide availability in the event of a hardware or software failure, consider deploying Analysis Services into a
failover cluster. In a failover cluster, if the primary node fails for any reason or if it must be rebooted, Microsoft
Windows Clustering fails over to a secondary node. After the failover, which occurs very quickly, when users run
query they are accessing the instance of Analysis Services that is running on the secondary node. For more
information about failover clusters, see Windows Server Technologies: Failover Clusters.
Another solution for availability issues is to deploy your Analysis Services project onto two or more production
servers. You can then use the Network Load Balancing (NLB ) feature of Windows servers to combine the
production servers into a single cluster. In an NLB cluster, if a server in the cluster is unavailable due to hardware
or software issues, the NLB service directs user queries to those servers that are still available.
Providing Availability While Processing Structural Changes
Certain changes to a cube can cause the cube to be unavailable until it is processed. For example, if you make
structural changes to a dimension in a cube, even if you reprocess the dimension, each cube that uses the modified
dimension must also be processed. Until you process those cubes, users cannot query them, nor can they query
any mining models that are based on a cube that has the modified dimension.
To provide availability while you process structural changes that may affect one or more cubes in an Analysis
Services project, consider incorporating a staging server and using the Synchronize Database Wizard. This feature
lets you update data and metadata on a staging server, and then to perform an online synchronization of the
production server and the staging server. For more information, see Synchronize Analysis Services Databases.
To transparently process incremental updates to source data, enable proactive caching. Proactive caching updates
cubes with new source data without requiring manual processing and without affecting the availability of cubes.
For more information, see Proactive Caching (Partitions).
Scalability Considerations
Multiple instances of Microsoft SQL Server and Analysis Services on the same computer may cause performance
issues. To solve these issues, one option may be to increase the processor, memory, and disk resources on the
server. However, you may also need to scale the instances of SQL Server and Analysis Services across multiple
computers.
Scaling Analysis Services Across Multiple Computers
There are several ways to scale an installation of Analysis Services across multiple computers. These options are
described in the following list.
If there are multiple instances of Analysis Services on a single computer, you can move one or more
instances to another computer.
If there are multiple Analysis Services databases on a single computer, you can move one or more of the
databases onto its own instance of Analysis Services on a separate computer.
If one or more relational databases provide data to an Analysis Services database, you can move these
databases to a separate computer. Before you move the databases, consider the network speed and
bandwidth that exist between the Analysis Services database and its underlying databases. If the network is
slow or congested, moving the underlying databases to a separate computer will degrade processing
performance.
If processing affects query performance, but you can't process during times of reduced query load, consider
moving your processing tasks to a staging server and then performing an online synchronization of the
production server and the staging server. For more information, see Synchronize Analysis Services
Databases. You can also distribute processing across multiple instances of Analysis Services by using
remote partitions. Processing remote partitions uses the processor and memory resources on the remote
server, instead of the resources on the local computer. For information on remote partitions management,
see Create and Manage a Remote Partition (Analysis Services).
If query performance is poor but you cannot increase the processor and memory resources on the local
server, consider deploying an Analysis Services project onto two or more production servers. Then you can
use Network Load Balancing (NLB ) to combine the servers into a single cluster. In an NLB cluster, queries
are automatically distributed across all the servers in the NLB cluster.
Deploy Model Solutions Using XMLA
5/16/2018 • 2 minutes to read • Edit Online
IMPORTANT
The XML script will not contain the password if this is specified in either the connection string for a data source or for
impersonation purposes. Since the password is required for processing purposes in this scenario, you will either need to add
this manually to the XML script before it executes or add it after the XML script executes.
See Also
Deploy Model Solutions Using the Deployment Wizard
Synchronize Analysis Services Databases
Deploy Model Solutions Using the Deployment
Wizard
5/16/2018 • 2 minutes to read • Edit Online
NOTE
The Analysis Services Deployment Wizard/Utility is installed with SQL Server Managment Studio (SSMS). Be sure you're
using the latest version. If running from the command prompt, by default, the latest version of the deployment wizard is
installed to C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio.
You can deploy by using the wizard as discussed here. You can also automate deployment or use the Synchronize
capability. If the deployed database is large, consider using partitions on target systems. You can automate
partition creation and population by using Tabular Object Model (TOM ), Tabular Model Scriting Language
(TMSL ), and Analysis Management Objects (AMO ).
IMPORTANT
Neither the output files nor the deployment script will contain the user id or password if these are specified in either the
connection string for a data source or for impersonation purposes. Since these are required for processing purposes in this
scenario, you will add this information manually. If the deployment will not include processing, you can add this connection
and impersonation information as needed after deployment. If the deployment will include processing, you can either add
this information within the wizard or in the deployment script after it is saved.
In This Section
The following topics describe how to work with the Analysis Services Deployment Wizard, the input files, and the
deployment script:
TOPIC DESCRIPTION
Running the Analysis Services Deployment Wizard Describes the various ways in which you can run the Analysis
Services Deployment Wizard.
Understanding the Input Files Used to Create the Describes which files the Analysis Services Deployment
Deployment Script Wizard uses as input values, what each of those files contains,
and provides links to topics that describe how to modify the
values in each of the input files.
Understanding the Analysis Services Deployment Script Describes what the deployment script contains and how the
script runs.
See Also
Deploy Model Solutions Using XMLA
Synchronize Analysis Services Databases
Understanding the Input Files Used to Create the Deployment Script
Deploy Model Solutions with the Deployment Utility
Running the Analysis Services Deployment Wizard
11/28/2018 • 3 minutes to read • Edit Online
NOTE
If you want to have the Analysis Services Deployment Wizard modify the input values, run the wizard at the command
prompt and set the wizard to run in answer file mode.
After you review the input values and make any wanted changes, the wizard generates the deployment script. You
can run this deployment script immediately on the destination server or save the script for later use.
To run the Analysis Services Deployment Wizard interactively
Click Start > Microsoft SQL Server > Deployment Wizard.
-or-
In the Projects folder of the Analysis Services project, double-click the <project name>.asdatabase file.
NOTE
If you cannot find the .asdatabase file, try using Search and specify *.asdatabase. Or, you may need to build the
project in SSDT.
See Also
Understanding the Analysis Services Deployment Script
Deploy Model Solutions Using the Deployment Wizard
Deployment Script Files - Input Used to Create
Deployment Script
5/16/2018 • 2 minutes to read • Edit Online
FILE DESCRIPTION
<project name>.deploymenttargets Contains the name of the Analysis Services instance and
database in which the Analysis Services objects will be created.
NOTE
SQL Server Data Tools (SSDT) never stores passwords in its project files.
See Also
Specifying Partition and Role Deployment Options
Specifying Configuration Settings for Solution Deployment
Specifying Processing Options
Deployment Script Files - Partition and Role
Deployment Options
11/28/2018 • 2 minutes to read • Edit Online
NOTE
If the measure group in which the partition exists is deleted, the partition is automatically deleted.
See Also
Specifying the Installation Target
Specifying Configuration Settings for Solution Deployment
Specifying Processing Options
Deployment Script Files - Solution Deployment
Config Settings
11/28/2018 • 3 minutes to read • Edit Online
NOTE
Configuration settings can apply to all objects or only to newly created objects. Apply configuration settings to newly
created objects only when you are deploying additional objects to a previously deployed Analysis Services database and do
not want to overwrite existing objects. To specify whether configuration settings apply to all objects or only to newly created
ones, set this option in the <project name>.deploymentoptions file. For more information, see Specifying Partition and Role
Deployment Options.
To change configuration settings after the input files have been generated
Run the Analysis Services Deployment Wizard interactively, and on the Configuration Settings page,
specify the configuration setting for the objects being deployed.
-or-
Run the Analysis Services Deployment Wizard at the command prompt and set the wizard to run in
answer file mode. For more information about answer file mode, see Running the Analysis Services
Deployment Wizard.
-or-
Modify the <project name>.configsettings file by using any text editor.
See Also
Specifying the Installation Target
Specifying Partition and Role Deployment Options
Specifying Processing Options
Deployment Script Files - Specifying Processing
Options
11/28/2018 • 2 minutes to read • Edit Online
See Also
Specifying the Installation Target
Specifying Partition and Role Deployment Options
Specifying Configuration Settings for Solution Deployment
Understanding the Analysis Services Deployment
Script
5/16/2018 • 2 minutes to read • Edit Online
IMPORTANT
The Analysis Services Deployment Wizard only deploys objects into a single Analysis Services database. It does not deploy
any server level objects or data.
See Also
Running the Analysis Services Deployment Wizard
Understanding the Input Files Used to Create the Deployment Script
Deploy Model Solutions with the Deployment Utility
5/16/2018 • 3 minutes to read • Edit Online
NOTE
The Analysis Services Deployment Wizard/Utility is installed with SQL Server Managment Studio (SSMS). Be sure you're
using the latest version. By default, the latest version of the deployment wizard is installed to C:\Program Files
(x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio.
Syntax
Microsoft.AnalysisServices.Deployment [ASdatabasefile]
{[/s[:logfile]] | [/a] | [[/o[:output_script_file]] [/d]]}
Arguments
ASdatabasefile
The full path of the folder in which the Analysis Services deployment script (.asdatabase) file is located. This file is
generated when you deploy a project in SQL Server Data Tools. It is located in the project bin folder. The
.asdatabase file contains the object definitions to be deployed is located. If not specified, the current folder is used.
/s
Runs the utility in silent mode and not display any dialog boxes. For more information about modes, see the
section, Modes, later in this topic.
logfile
The full path and file name of the log file. Trace events will be logged to the specified log file. If the log file already
exists, the file's content will be replaced.
/a
Runs the utility in answer mode. All responses made during the wizard part of the utility should be written back
to the input files, but no changes will actually be made to the deployment targets.
/o
Runs the utility in output mode. Deployment will not occur, but the XML for Analysis (XMLA) script that would
ordinarily be sent to the deployment targets is instead saved to the specified output script file. If output_script_file
is not specified, the utility tries to use the output script file specified in the deployment options
(.deploymentoptions) input file. If an output script file is not specified in the deployment options input file, an
error occurs.
For more information about modes, see the section, Modes, later in this topic.
output_script_file
The full path and file name of the output script file.
/d
If the /o argument is used, specifies that the utility should not connect to the target instance. Because no
connection is made to the deployment targets, the output script is generated based only on information retrieved
from the input files.
NOTE
The /d argument is used only in output mode. This argument is ignored if specified in answer or silent mode. For more
information about modes, see the section, Modes, later in this topic.
Remarks
The Microsoft.AnalysisServices.Deployment utility takes a set of files that provide the object definitions,
deployment targets, deployment options, and configuration settings, and tries to deploy the object definitions to
the specified deployment targets, using the specified deployment options and configuration settings. This utility
can provide a user interface when invoked in answer file or output mode. For more information about how to use
the user interface supplied for this utility to create answer files, see Deploy Model Solutions Using the
Deployment Wizard.
The utility is located in the \Program files (x86)\Microsoft SQL Server\140\Binn\ManagementStudio folder.
Modes
The utility can be run in the modes listed in the following table.
MODE DESCRIPTION
Silent mode No user interface is displayed and all information needed for
deployment is supplied by the input files. No progress is
displayed by the utility in silent mode. Instead, an optional
log file can be used to capture progress and error information
for later review.
Answer mode The Deployment Wizard user interface is displayed and user
responses are saved to the specified input files for later
deployment. Deployment does not occur in answer mode.
The only purpose of answer mode is to capture user
responses
Output mode No user interface is displayed and all information needed for
deployment is supplied by the input files.
Back to Arguments
Examples
The following example shows how to deploy an Analysis Services project in silent mode, logging progress and
error messages for later review:
Microsoft.AnalysisServices.Deployment.exe
See Also
Command Prompt Utility Reference (Database Engine)
Multidimensional Model Databases (SSAS)
5/16/2018 • 2 minutes to read • Edit Online
Related Tasks
Attach and Detach Analysis Services Databases
Backup and Restore of Analysis Services Databases
Document and Script an Analysis Services Database
Modify or Delete an Analysis Services Database
Move an Analysis Services Database
Rename a Multidimensional Database (Analysis Services)
Compatibility Level of a Multidimensional Database (Analysis Services)
Set Multidimensional Database Properties (Analysis Services)
Synchronize Analysis Services Databases
Switch an Analysis Services database between ReadOnly and ReadWrite modes
See Also
Connect in Online Mode to an Analysis Services Database
Create an Analysis Services Project (SSDT)
Querying Multidimensional Data with MDX
Attach and Detach Analysis Services Databases
10/26/2018 • 2 minutes to read • Edit Online
IMPORTANT
If a password was required to detach the database, the same password is required to attach the database.
The Detach command is used to take offline an existing database structure. When a database is detached, you
should provide a password to protect confidential metadata.
IMPORTANT
To protect the content of the data files, you should use an access control list for the folder, subfolders, and data files.
1) The server issues a request for a CommitExclusive Lock on 1) The database is marked as deleted
the database
2) The server commits the transaction
2) The server waits until all ongoing transactions are either
committed or rolled back Note: The detaching password cannot be changed for a read-
only database. An error is raised if the password parameter is
3) The server builds all the metadata that it must have to provided for an attached database that already contains a
detach the database password.
The Attach and Detach commands must be executed as single operations. They cannot be combined with other
operations in the same transaction. Also, the Attach and Detach commands are atomic transactional commands.
This means the operation will either succeed or fail. No database will be left in an uncompleted state.
IMPORTANT
Server or database administrator privileges are required to execute the Detach command.
IMPORTANT
Server administrator privileges are required to execute the Attach command.
See Also
Detach
Move an Analysis Services Database
Database ReadWriteModes
Switch an Analysis Services database between ReadOnly and ReadWrite modes
Detach Element
Attach Element
Backup and Restore of Analysis Services Databases
12/6/2018 • 7 minutes to read • Edit Online
Prerequisites
You must have administrative permissions on the Analysis Services instance or Full Control (Administrator)
permissions on the database you are backing up.
Restore location must be an Analysis Services instance that is the same version, or a newer version, as the
instance from which the backup was taken. Although you cannot restore a database from a SQL Server 2017
instance to an earlier version of Analysis Services, it is common practice to restore an older version database,
such as SQL Server 2012, on a newer SQL Server 2017 instance.
Restore location must be the same server type. Tabular databases can only be restored to Analysis Services
running in tabular mode. Multidimensional databases require an instance running in multidimensional mode.
NOTE
Power Pivot for SharePoint, used for loading and querying Power Pivot data models in a SharePoint environment, loads its
models from SharePoint content databases. These content databases are relational and run on the SQL Server relational
database engine. As such, there is no Analysis Services backup and restore strategy for Power Pivot data models. If you
have a disaster recovery plan in place for SharePoint content, that plan encompasses the Power Pivot data models stored in
the content databases.
Remote Partitions
If the Analysis Services database contains remote partitions, the remote partitions should also be backed up.
When you back up a database with remote partitions, all the remote partitions on each remote server are backed
up to a single file on each of those remote servers respectively. Therefore, if you want to create those remote
backups off their respective host computers, you will have to manually copy those files to the designated storage
areas.
Contents of a backup file
Backing up an Analysis Services database produces a backup file whose contents vary depending upon the
storage mode used by the database objects. This difference in backup content results from the fact that each
storage mode actually stores a different set of information within an Analysis Services database. For example,
multidimensional hybrid OLAP (HOLAP ) partitions and dimensions store aggregations and metadata in the
Analysis Services database, while relational OLAP (ROLAP ) partitions and dimensions only store metadata in the
Analysis Services database. Because the actual contents of an Analysis Services database vary based on the
storage mode of each partition, the contents of the backup file also vary. The following table associates the
contents of the backup file to the storage mode used by the objects.
Multidimensional MOLAP partitions and dimensions Metadata, source data, and aggregations
When you back up an Analysis Services database, you can choose from the following options:
Whether to compress all database backups. The default is to compress backups.
Whether to encrypt the contents of the backup files and require a password before the file can be
unencrypted and restored. By default, the backed up data is not encrypted.
IMPORTANT
For each backup file, the user who runs the backup command must have permission to write to the backup location
specified for each file. Also, the user must have one of the following roles: a member of a server role for the Analysis
Services instance, or a member of a database role with Full Control (Administrator) permissions on the database to
be backed up.
For more information about backing up an Analysis Services database, see Backup Options.
NOTE
If a backup file is encrypted, you must provide the password specified during backup before you can use that file to restore
an Analysis Services database.
IMPORTANT
For each backup file, the user who runs the restore command must have permission to read from the backup
location specified for each file. To restore an Analysis Services database that is not installed on the server, the user
must also be a member of the server role for that Analysis Services instance. To overwrite an Analysis Services
database, the user must have one of the following roles: a member of the server role for the Analysis Services
instance, or a member of a database role with Full Control (Administrator) permissions on the database to be
restored.
NOTE
After restoring an existing database, the user who restored the database might lose access to the restored
database. This loss of access can occur if, at the time that the backup was performed, the user was not a member of
the server role or was not a member of the database role with Full Control (Administrator) permissions.
For more information about restoring an Analysis Services database, see Restore Options.
See Also
Backing Up, Restoring, and Synchronizing Databases (XMLA)
Backup Options
10/26/2018 • 2 minutes to read • Edit Online
IMPORTANT
The Analysis Services service account must have permission to write to the backup location specified for each file. Also, the
user must have one of the following roles: administrator role on the Analysis Services instance, or a member of a database
role with Full Control (Administrator) permissions on the database to be backed up.
See Also
Backup Database Dialog Box (Analysis Services - Multidimensional Data)
Backup and Restore of Analysis Services Databases
Backup Element (XMLA)
Backing Up, Restoring, and Synchronizing Databases (XMLA)
Restore Options
12/7/2018 • 2 minutes to read • Edit Online
IMPORTANT
For each backup file, the user who runs the restore command must have permission to read from the backup location
specified for each file. To restore an Analysis Services database that is not installed on the server, the user must also be a
member of the server role for that Analysis Services instance. To overwrite an Analysis Services database, the user must have
one of the following roles: a member of the server role for the Analysis Services instance, or a member of a database role
with Full Control (Administrator) permissions on the database to be restored.
NOTE
After restoring an existing database, the user who restored the database might lose access to the restored database. This
loss of access can occur if, at the time that the backup was performed, the user was not a member of the server role or was
not a member of the database role with Full Control (Administrator) permissions.
See Also
Restore Database Dialog Box (Analysis Services - Multidimensional Data)
Backup and Restore of Analysis Services Databases
Restore Element (XMLA)
Backing Up, Restoring, and Synchronizing Databases (XMLA)
Document and Script an Analysis Services Database
10/26/2018 • 2 minutes to read • Edit Online
See Also
Modify or Delete an Analysis Services Database
Alter Element (XMLA)
Create Element (XMLA)
Modify or Delete an Analysis Services Database
5/16/2018 • 2 minutes to read • Edit Online
NOTE
You cannot change database properties using SQL Server Data Tools (SSDT) in online mode.
Deleting Databases
Deleting an existing Analysis Services database deletes the database and all cubes, dimensions, and mining
models in the database. You can only delete an existing Analysis Services database in SQL Server Management
Studio.
To delete an Analysis Services database
1. Connect to an Analysis Services instance.
2. In Object Explorer, expand the node for the connected Analysis Services instance and ensure that the
object to be deleted is visible.
3. Right-click the object to be deleted and select Delete.
4. In the Delete Object dialog box, click OK.
See Also
Document and Script an Analysis Services Database
Move an Analysis Services Database
11/28/2018 • 2 minutes to read • Edit Online
NOTE
Detaching a database without assigning a password to it leaves the database in an unsecured state. We recommend
assigning a password to the database to protect confidential information. Also, the corresponding access security should be
applied to the database folder, sub-folders, and files to prevent unauthorized access to them.
Procedures
Moving a database interactively using SSMS
1. Locate the database to be moved in the left or right pane of SSMS.
2. Right-click on the database and select Detach...
3. Assign a password to the database to be detached, then click OK to execute the detach command.
4. Use any operating system mechanism or your standard method for moving files to move the database
folder to the new location.
5. Locate the Databases folder in the left or right pane of SSMS.
6. Right-click on the Databases folder and select Attach...
7. In the folder text box, type the new location of the database folder. Alternatively, you can use the browse
button (...) to locate the database folder.
8. Select the ReadWrite mode for the database.
9. Type the password used in step 3 and click OK to execute the attach command.
Moving a database programmatically using AMO
1. In your C# application, adapt the following sample code and complete the indicated tasks.
private void MoveDb(Server server, string dbName,
if (server.Databases.ContainsName(dbName))
Database db;
db = server.Databases[dbName];
db.Detach(dbPassword);
//Add your own code to copy the database files to the destination where you intend to attach the database
<Object>
<DatabaseID>%dbName%</DatabaseID>
<Password>%password%</Password>
</Object>
</Detach>
1. Replace %dbName% with the name of the database and %password% with the password. The % characters are
part of the template and must be removed.
2. Execute the XMLA command.
3. Use any operating system mechanism or your standard method for moving files to move the database
folder to the new location.
4. Copy the following script template for XMLA in a new XMLA tab
<Attach xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Folder>%dbFolder%</Folder>
<ReadWriteMode xmlns="http://schemas.microsoft.com/analysisservices/2008/engine/100">%ReadOnlyMode%
</ReadWriteMode>
</Attach>
1. Replace %dbFolder% with the complete UNC path of the database folder, %ReadOnlyMode% with the
corresponding value ReadOnly or ReadWrite, and %password% with the password. The % characters are
part of the template and must be removed.
2. Execute the XMLA command.
See Also
Attach
Detach
Attach and Detach Analysis Services Databases
Database Storage Location
Database ReadWriteModes
Attach Element
Detach Element
ReadWriteMode Element
DbStorageLocation Element
Rename a Multidimensional Database (Analysis
Services)
5/16/2018 • 2 minutes to read • Edit Online
See Also
Server Properties in Analysis Services
Set Multidimensional Database Properties (Analysis Services)
Configure Analysis Services Project Properties (SSDT)
Deploy Analysis Services Projects (SSDT)
Compatibility Level of a Multidimensional Database
(Analysis Services)
5/16/2018 • 4 minutes to read • Edit Online
NOTE
Tabular models have additional database compatibility levels that are not applicable to multidimensional models.
Compatibility level 1103 does not exist for multidimensional models. See What is new for the Tabular model in SQL Server
2012 SP1 and compatibility level for more information about 1103 for tabular solutions.
SETTING DESCRIPTION
1100 This is the default value for new databases that you create in
SQL Server 2012 (11.x) or SQL Server 2017. You can also
specify it for databases created in earlier versions of Analysis
Services to enable the use of features that are supported only
at this compatibility level (namely, increased string storage for
dimension attributes or distinct count measures that contain
string data).
Prerequisites
Database compatibility levels are introduced in SQL Server 2012 (11.x). You must have SQL Server 2012
(11.x)Analysis Services or higher to view or set the database compatibility level.
The database cannot be a local cube. Local cubes do not support the CompatibilityLevel property.
The database must have been created in a previous release (SQL Server 2008 R2 or earlier) and then attached or
restored to a SQL Server 2012 (11.x)Analysis Services or higher server. Databases deployed to SQL Server 2012
are already at 1100 and cannot be downgraded to run at a lower level.
<ddl200:CompatibilityLevel>1100</ddl200:CompatibilityLevel>
5. Paste it after the </Annotations> closing element and before the <Language> element. The XML should
look similar to the following example:
</Annotations>
<ddl200:CompatibilityLevel>1100</ddl200:CompatibilityLevel>
<Language>1033</Language>
Next Steps
After you increase the database compatibility level, you can set the StringStoresCompatibilityLevel property in
SQL Server Data Tools. This increases string storage for measures and dimensions. For more information about
this feature, see Configure String Storage for Dimensions and Partitions.
See Also
Backing Up, Restoring, and Synchronizing Databases (XMLA)
Set Multidimensional Database Properties (Analysis
Services)
10/26/2018 • 2 minutes to read • Edit Online
Database Properties
In addition to the above, there are a number of properties of a database that you can configure in the Properties
window.
PROPERTY DESCRIPTION
Aggregation Prefix The common prefix that can be used for aggregation names
for all of the partitions in a database. For more information,
see AggregationPrefix Element (ASSL).
DataSourceImpersonationInfo Specifies the default impersonation mode for all data source
objects in the database. This is the mode that the Analysis
Services service uses when processing objects, synchronizing
servers, and executing the OpenQuery and
SystemOpenSchema data mining statements.
PROPERTY DESCRIPTION
See Also
Database Properties Dialog Box (SSAS - Multidimensional)
Configure Analysis Services Project Properties (SSDT)
Database Storage Location
10/26/2018 • 2 minutes to read • Edit Online
IMPORTANT
We recommend that set your UNC path to use a Storage Area Network (SAN), iSCSI-based network, or a locally attached
disk. Any UNC path to a network share or any high latency remote storage solution leads to an unsupported installation.
DbStorageLocation Usage
The DbStorageLocation database property is used as part of a Create database command in a Detach/Attach
database commands sequence, in a Backup/Restore database commands sequence, or in a Synchronize
database command. Changing the DbStorageLocation database property is considered a structural change in
the database object. This means that all metadata must be recreated and the data reprocessed.
IMPORTANT
You should not change the database storage location by using an Alter command. Instead, we recommend that you use a
sequence of Detach/Attach database commands (see Move an Analysis Services Database, Attach and Detach Analysis
Services Databases).
See Also
DbStorageLocation
Attach and Detach Analysis Services Databases
Move an Analysis Services Database
DbStorageLocation Element
Create Element (XMLA)
Attach Element
Synchronize Element (XMLA)
Database ReadWriteModes
10/26/2018 • 2 minutes to read • Edit Online
Alter
Note: An error is raised when you execute any one of these Delete
commands.
Process
MergePartitions
DesignAggregations
CommitTransaction
Restore
Synchronize
Insert
Update
Drop
Note: An error is raised when you execute any one of these ALTER CUBE
statements.
ALTER DIMENSION
ALTER DIMENSION
Note: An error is raised when you execute any one of these DROP MINING STRUCTURE
statements.
CREATE [SESSION] MINING MODEL
IMPORT
SELECT INTO
INSERT
UPDATE
DELETE
Background operations Any background operations that would modify the database
are disabled. This includes lazy processing and proactive
caching.
ReadWriteMode Usage
The ReadWriteMode database property is to be used as part of an Attach database command. The Attach
command allows the database property to be set to either ReadWrite or ReadOnly. The ReadWriteMode
database property value cannot be updated directly because the property is defined as read-only. Databases are
created with the ReadWriteMode property set to ReadWrite. A database cannot be created in read-only mode.
To switch the ReadWriteMode database property between ReadWrite and ReadOnly, you must issue a
sequence of Detach/Attach commands.
All database operations, with the exception of Attach, keep the ReadWriteMode database property in its current
state. For example, operations like Alter, Backup, Restore, and Synchronize preserve the ReadWriteMode
value.
NOTE
Local cubes can be created from a read-only database.
See Also
Detach
Attach and Detach Analysis Services Databases
Move an Analysis Services Database
Detach Element
Attach Element
Synchronize Analysis Services Databases
10/26/2018 • 10 minutes to read • Edit Online
NOTE
The following whitepapers, written for previous versions of Analysis Services, still apply to scalable multidimensional
solutions built using SQL Server 2012. For more information, see Scale-Out Querying with Analysis Services and Scale-Out
Querying for Analysis Services with Read-Only Databases
Prerequisites
On the destination (or target) server from which you initiate database synchronization, you must be a member
of the Analysis Services server administrator role. On the source server, your Windows user account must have
Full Control permissions on the source database. If you are synchronizing database interactively, remember that
synchronization runs under the security context of your Windows user identity. If your account is denied access
to specific objects, those objects will be excluded from the operation. For more information about server
administrator roles and database permissions, see Grant server admin rights to an Analysis Services instance
and Grant database permissions (Analysis Services).
TCP port 2383 must be open on both servers to allow remote connections between default instances. For more
information about creating an exception in Windows Firewall, see Configure the Windows Firewall to Allow
Analysis Services Access.
Both the source and destination servers must be the same version and service pack. Because model metadata is
also synchronized, to ensure compatibility the build number for both servers should be the same. The edition of
each installation must support database synchronization. In SQL Server 2017, database synchronization is
supported in enterprise, developer, and business intelligence editions. For more information about features in
each edition, see Editions and Supported Features for SQL Server 2016.
The server deployment mode must be identical on each server. If the database you are synchronizing is
multidimensional, both source and destination servers must be configured for multidimensional server mode.
For more information about deployment modes, see Determine the Server Mode of an Analysis Services
Instance.
Turn off lazy aggregation processing if you are using it on the source server. Aggregations that are processing in
the background can interfere with database synchronization. For more information about setting this server
property, see OLAP Properties.
NOTE
Database size is a factor in determining whether synchronization is a suitable approach. There are no hard requirements,
but if synchronization is too slow, consider synchronizing multiple servers in parallel, as described in this technical paper:
Analysis Services Synchronization Best Practices.
NOTE
This page appears only if at least one local partition exists in the specified database.
If a set of partitions are installed on drive C of the source server, the wizard lets you copy this set of
partitions to a different location on the destination server. If you do not change the default locations, the
wizard deploys the measure group partitions within each cube on the source server to the same locations
on the destination server. Similarly, if the source server uses remote partitions, the same remote
partitions will be used on the destination server.
The Locations option displays a grid listing the source folder, destination folder, and estimated size of the
local partitions to be stored on the destination instance. The grid contains the following columns:
Source Folder
Displays the folder name on the source Analysis Services instance that contains the local partition. If the
column contains the value "(Default)", the default location for the source instance contains the local
partition.
Destination Folder
Displays the folder name on the destination Analysis Services instance into which the local partition is to
be synchronized. If the column contains the value, "(Default)", the default location for the destination
instance contains the local partition.
Click the ellipsis (...) button to display the Browse for Remote Folder dialog box and specify a folder on
the destination instance into which the local partitions stored in the selected location should be
synchronized.
NOTE
This column cannot be changed for local partitions stored in the default location for the source instance.
Size
Displays the estimated size of the local partition.
The Partitions in selected location option displays a grid that describes the local partitions stored in
the location on the source Analysis Services instance specified in the Source Folder column of the
selected row in Locations.
Cube
Displays the name of the cube that contains the partition.
Measure Group
Displays the name of the measure group in the cube that contains the partition.
Partition Name
Displays the name of the partition.
Size(Mb)
Displays the size in megabytes (MB ) of the partition.
5. Optionally, change location for remote partitions.Use the Specify Locations for Remote Partitions
page to indicate if remote partitions managed by the specified database on the source server should be
synchronized, and to specify a destination Analysis Services instance and database into which the
selected remote partitions should be stored.
NOTE
This page appears only if at least one remote partition is managed by the specified database on the source
Analysis Services instance.
The Locations option displays a grid that lists details about locations in which remote partitions for the
source database are stored, including source and destination information and the storage size used by
each location, available from the selected database. The grid contains the following columns:
Sync
Select to include a location that contains the remote partitions during synchronization.
NOTE
If this option is not selected for a location, remote partitions that are contained in that location will not be
synchronized.
Source Server
Displays the name of the Analysis Services instance that contains remote partitions.
Source Folder
Displays the folder name on the Analysis Services instance that contains remote partitions. If the column
contains the value "(Default)", the default location for the instance displayed in Source Server contains
remote partitions.
Destination Server
Displays the name of the Analysis Services instance into which the remote partitions stored in the
location specified in Source Server and Source Folder should be synchronized.
Click the ellipsis (...) button to display the Connection Manager dialog box and specify an Analysis
Services instance into which the remote partitions stored in the selected location should be synchronized.
Destination Folder
Displays the folder name on the destination Analysis Services instance into which the remote partition is
to be synchronized. If the column contains the value, "(Default)", the default location for the destination
instance should contain the remote partition.
Click the ellipsis (...) button to display the Browse for Remote Folder dialog box and specify a folder on
the destination instance into which the remote partitions stored in the selected location should be
synchronized.
Size
Displays the estimated size of remote partitions stored in the location.
The Partitions in selected location displays a grid that describes the remote partitions stored in the
location on the source Analysis Services instance specified in the Source Folder column of the selected
row in Locations. The grid contains the following columns:
Cube
Displays the name of the cube that contains the partition.
Measure Group
Displays the name of the measure group in the cube that contains the partition.
Partition Name
Displays the name of the partition.
Size(Mb)
Displays the size in megabytes (MB ) of the partition.
6. Specify whether user permission information should be included, and whether compression should be
used. By default, the wizard compresses all data and metadata prior to copying the files to the destination
server. This option results in a faster file transmission. Files are uncompressed once they reach the
destination server.
Copy all
Select to include security definitions and membership information during synchronization.
Skip membership
Select to include security definitions, but exclude membership information, during synchronization.
Ignore all
Select to ignore the security definition and membership information currently in the source database. If a
destination database is created during synchronization, no security definitions or membership
information will be copied. If the destination database already exists and has roles and memberships, that
security information will be preserved.
7. Choose the synchronization method. You can synchronize immediately or generate a script that is saved
to a file. By default, the file is saved with an .xmla extension and placed in your Documents folder.
8. Click Finish to synchronize. After verifying the options on the Completing the Wizard page, click
Finish again.
Next Steps
If you did not synchronize roles or membership, remember to specify user access permissions now on the
destination database.
See Also
Synchronize Element (XMLA)
Deploy Model Solutions Using XMLA
Deploy Model Solutions Using the Deployment Wizard
Switch an Analysis Services database between
ReadOnly and ReadWrite modes
11/28/2018 • 2 minutes to read • Edit Online
if (databaseLocation == null)
{
string dataDir = server.ServerProperties["DataDir"].Value;
string dataDir = server.ServerProperties["DataDir"].Value;
string dataDir = server.ServerProperties["DataDir"].Value;
if (possibleFolders.Length > 1)
{
List<String> sortedFolders = new List<string>(possibleFolders.Length);
sortedFolders.AddRange(possibleFolders);
sortedFolders.Sort();
databaseLocation = sortedFolders[sortedFolders.Count - 1];
}
else
{
databaseLocation = possibleFolders[0];
}
}
db.Detach();
server.Attach(databaseLocation, dbReadWriteMode);
}
}
<Detach xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Object>
<DatabaseID>%dbName%</DatabaseID>
<Password>%password%</Password>
</Object>
</Detach>
5. Replace %dbName% with the name of the database and %password% with the password. The % characters are
part of the template and must be removed.
6. Execute the XMLA command.
7. Copy the following script template for XMLA in a new XMLA tab
<Attach xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Folder>%dbFolder%</Folder>
<ReadWriteMode xmlns="http://schemas.microsoft.com/analysisservices/2008/engine/100">%ReadOnlyMode%
</ReadWriteMode>
</Attach>
8. Replace %dbFolder% with the complete UNC path of the database folder, %ReadOnlyMode% with the
corresponding value ReadOnly or ReadWrite, and %password% with the password. The % characters are
part of the template and must be removed.
9. Execute the XMLA command.
See Also
Detach
High availability and Scalability in Analysis Services
Attach and Detach Analysis Services Databases
Database Storage Location
Database ReadWriteModes
Attach Element
Detach Element
ReadWriteMode Element
DbStorageLocation Element
Processing a multidimensional model (Analysis
Services)
12/7/2018 • 5 minutes to read • Edit Online
Prerequisites
Processing requires administrative permissions on the Analysis Services instance. If you are processing
interactively from SQL Server Data Tools or Management Studio, you must be a member of the server
administrator role on the Analysis Services instance. For processing that runs unattended, for example
using an SSIS package that you schedule through SQL Server Agent, the account used to run the
package must be a member of the server administrator role. For more information about setting
administrator permissions, see Grant server admin rights to an Analysis Services instance.
The account used to retrieve data is specified in the data source object, either as an impersonation
option if you are using Windows authentication, or as the user name on the connection string if using
database authentication. The account must have read permissions on relational data sources used by
the model.
The project or solution must be deployed before you can process any objects.
Initially, during the early stages of model development, deployment and processing occur together.
However, you can set options to process the model later, after you deploy the solution. For more
information about deployment, see Deploy Analysis Services Projects (SSDT).
Processing Objects
Processing affects the following Analysis Services objects: measure groups, partitions, dimensions, cubes,
mining models, mining structures, and databases. When an object contains one or more objects, processing
the highest-level object causes a cascade of processing all the lower-level objects. For example, a cube typically
contains one or more measure groups (each of which contains one or more partitions) and dimensions.
Processing a cube causes processing of all the measure groups within the cube and the constituent dimensions
that are currently in an unprocessed state. For more information about processing Analysis Services objects,
see Processing Analysis Services Objects.
While the processing job is working, the affected Analysis Services objects can be accessed for querying. The
processing job works inside a transaction and the transaction can be committed or rolled back. If the
processing job fails, the transaction is rolled back. If the processing job succeeds, an exclusive lock is put on the
object when changes are being committed, which means the object is temporarily unavailable for query or
processing. During the commit phase of the transaction, queries can still be sent to the object, but they will be
queued until the commit is completed.
During a processing job, whether an object is processed, and how it will be processed, depends on the
processing option that is set for that object. For more information about the specific processing options that
can be applied to each object, see Processing Options and Settings (Analysis Services).
Reprocessing Objects
Cubes that contain unprocessed elements have to be reprocessed before they can be browsed. Cubes in
Analysis Services contain measure groups and partitions that must be processed before the cube can be
queried. Processing a cube causes Analysis Services to process constituent dimensions of the cube if those
dimensions are in an unprocessed state. After an object has been processed the first time, it must be
reprocessed either partially or in full whenever one of the following situations occurs:
The structure of the object changes, such as dropping a column in a fact table.
The aggregation design for the object changes.
The data in the object needs to be updated.
When you process objects in Analysis Services, you can select a processing option, or you can enable Analysis
Services to determine the appropriate type of processing. The processing methods made available differ from
one object to another, and are based on the type of object. Additionally, the methods available are based on
what changes have occurred to the object since it was last processed. If you enable Analysis Services to
automatically select a processing method, it will use the method that returns the object to a fully processed
state in the least time. For more information, see Processing Options and Settings (Analysis Services).
See Also
Logical Architecture (Analysis Services - Multidimensional Data)
Database Objects (Analysis Services - Multidimensional Data)
Processing Options and Settings (Analysis Services)
5/16/2018 • 7 minutes to read • Edit Online
NOTE
This topic applies to multidimensional and data mining solutions. For information about tabular solutions, see Process
Database, Table, or Partition (Analysis Services).
Processing Options
The following table describes the processing methods that are available in Analysis Services, and identifies the
objects for which each method is supported.
Process Default Cubes, databases, dimensions, measure Detects the process state of database
groups, mining models, mining objects, and performs processing
structures, and partitions. necessary to deliver unprocessed or
partially processed objects to a fully
processed state. If you change a data
binding, Process Default will do a
Process Full on the affected object.
Process Full Cubes, databases, dimensions, measure Processes an Analysis Services object
groups, mining models, mining and all the objects that it contains.
structures, and partitions. When Process Full is executed against
an object that has already been
processed, Analysis Services drops all
data in the object, and then processes
the object. This kind of processing is
required when a structural change has
been made to an object, for example,
when an attribute hierarchy is added,
deleted, or renamed.
Process Clear Cubes, databases, dimensions, measure Drops the data in the object specified
groups, mining models, mining and any lower-level constituent objects.
structures, and partitions. After the data is dropped, it is not
reloaded.
MODE APPLIES TO DESCRIPTION
Process Data Dimensions, cubes, measure groups, Processes data only without building
and partitions. aggregations or indexes. If there is data
is in the partitions, it will be dropped
before re-populating the partition with
source data.
Process Add Dimensions, measure groups, and For dimensions, adds new members
partitions and updates dimension attribute
captions and descriptions.
Note: Process Add is not available for
dimension processing in Management For measure groups and partitions,
Studio, but you can write XMLA script adds newly available fact data and
performs this action. process only to the relevant partitions.
Process Index Cubes, dimensions, measure groups, Creates or rebuilds indexes and
and partitions aggregations for all processed
partitions. For unprocessed objects,
this option generates an error.
Process Structure Cubes and mining structures If the cube is unprocessed, Analysis
Services will process, if it is necessary,
all the cube's dimensions. After that,
Analysis Services will create only cube
definitions. If this option is applied to a
mining structure, it populates the
mining structure with source data. The
difference between this option and the
Process Full option is that this option
does not iterate the processing down
to the mining models themselves.
Process Clear Structure Mining structures Removes all training data from a
mining structure.
Processing Settings
The following table describes the processing settings that are available for use when you create a process
operation.
Sequential (Transaction Mode) Controls the execution behavior of the One Transaction. The processing job
processing job. Two options are runs as a transaction. If all processes
available. inside the processing job succeed, all
changes by the processing job are
When you process using One committed. If one process fails, all
Transaction, all changes are changes by the processing job are
committed after the processing job rolled back. One Transaction is the
succeeds. This means that all Analysis default value.
Services objects affected by a particular
processing job remain available for Separate Transactions. Each process
queries until the commit process. This in the processing job runs as a stand-
makes the objects temporarily alone job. If one process fails, only that
unavailable. Using Separate process is rolled back and the
Transactions causes all objects that are processing job continues. Each job
affected by a process in processing job commits all process changes at the end
to be taken unavailable for queries as of the job.
soon as that process succeeds.
Writeback Table Option Controls how writeback tables are Use Existing. Uses the existing
handled during processing. This option writeback table. This is default value.
applies to writeback partitions in a
cube. Create. Creates a new writeback table
and causes the process to fail if one
already exists.
Process Affected Objects Controls the object scope of the False. The job processes the objects
processing job. An affected object is explicitly named in the job and all
defined by object dependency. For dependent objects. For example, if the
example, partitions are dependent on processing job contains only
the dimensions that determine dimensions, Analysis Services processes
aggregation, but dimensions are not just those objects explicitly identified in
dependent on partitions. False is the the job. If the processing job contains
default setting. partitions, partition processing
automatically invokes processing of
affected dimensions.
Key error action. If a key value does Convert to unknown. The key is
not yet exist in a record, one of these interpreted as an unknown member.
actions is selected to occur: This is the default setting.
Processing error limit. Controls the Ignore errors count. This will enable
number of errors processed by processing to continue regardless of
selecting one of these options: the number of errors.
The following error conditions. You can Key not found. Occurs when a key
set the option value to control specific value exists in a partition but does not
error-handling behavior. exist in the corresponding dimension.
The default setting is Report and
When you select Use default error continue. Other settings are Ignore
configuration, Analysis Services uses error and Report and stop.
the error configuration that is set for
each object being processed. If an Duplicate key. Occurs when more
object is set to use default than one key value exists in a
configuration settings, Analysis Services dimension. The default setting is
uses the default settings that are listed Ignore error. Other settings are
for each option. Report and continue and Report and
stop.
See Also
Processing a multidimensional model (Analysis Services)
Processing Analysis Services Objects
5/16/2018 • 5 minutes to read • Edit Online
Processing a Database
In Analysis Services, a database contains objects but not data. When you process a database, you direct the server
to recursively process those objects that store data in the model, such as dimensions, partitions, mining
structures, and mining models.
When you process a database, some or all partitions, dimensions, and mining models that the database contains
are processed. The actual processing type varies depending on the state of each object and the processing option
that you select. For more information, see Processing Options and Settings (Analysis Services).
Processing a Cube
A cube can be thought of as a wrapper object for measure groups and partitions. A cube is made of dimensions in
addition to one or more measures, which are stored in partitions. Dimensions define how data is laid out in the
cube. When you process a cube, an SQL query is issued to retrieve values from the fact table to populate each
member in the cube with appropriate measure values. For any specific path to a node in the cube, there is a value
or a calculable value.
When you process a cube, Analysis Services processes any unprocessed dimensions in the cube, and some or all
partitions within the measure groups in the cube. The specifics depend on the state of the objects when
processing starts and the processing option that you select. For more information about processing options, see
Processing Options and Settings (Analysis Services).
Processing a cube creates machine-readable files that store relevant fact data. If there are aggregations created,
they are stored in aggregation data files. The cube is then available for browsing from the Object Explorer in
Management Studio or Solution Explorer in SQL Server Data Tools
Processing a Dimension
When you process a dimension, Analysis Services formulates and runs queries against dimension tables to return
information that is required for processing.
The processing itself turns the tabular data into usable hierarchies. These hierarchies are fully articulated member
names that are internally represented by unique numeric paths. The following example is a text representation of
a hierarchy.
[United States]
[United States].[West]
[United States].[West].[California]
[United States].[West].[Oregon]
[United States].[West].[Washington]
Dimension processing does not create or update calculated members, which are defined at the cube level.
Calculated members are affected when the cube definition is updated. Also, dimension processing does not create
or update aggregations. However, dimension processing can cause aggregations to be dropped. Aggregations are
created or updated only during partition processing.
When you process a dimension, be aware that the dimension might be used in several cubes. When you process
the dimension, those cubes are marked as unprocessed and become unavailable for queries. To process both the
dimension and the related cubes at the same time, use the batch processing settings. For more information, see
Batch Processing (Analysis Services).
NOTE
You can process individual measure groups programmatically, or by using Management Studio. You cannot process
individual measure groups in SQL Server Data Tools; however, you can process by partition.
Processing a Partition
Effective administration of Analysis Services involves the practice of partitioning data. Partition processing is
unique because it involves consideration of hard disk use and space constraints, combined with data structure
limitations imposed by Analysis Services. To keep query response times fast and processing throughput high, you
have to regularly create, process, and merge partitions. It is very important to recognize and manage against the
chance of integrating redundant data during partition merging. For more information, see Merge Partitions in
Analysis Services (SSAS - Multidimensional).
When you process a partition, Analysis Services processes the partition and any unprocessed dimensions that
exist in the partition, depending on the processing option that you select. Using partitions offers several
advantages for processing. You can process a partition without affecting other partitions in a cube. Partitions are
useful for storing data that is subject to cell writeback. Writeback is a feature that enables the user to perform
what-if analysis by writing new data back into the partition to see the effect of projected changes. A writeback
partition is required if you use the cell writeback feature of Analysis Services. Processing partitions in parallel is
useful because Analysis Services uses the processing power more efficiently and can significantly reduce total
processing time. You can also process partitions sequentially.
See Also
Tools and Approaches for Processing (Analysis Services)
Batch Processing (Analysis Services)
Processing a multidimensional model (Analysis Services)
Tools and Approaches for Processing (Analysis
Services)
10/26/2018 • 5 minutes to read • Edit Online
NOTE
This topic describes the tools and approaches for processing multidimensional models. For more information about
processing tabular models, see Process Database, Table, or Partition (Analysis Services) and Process Data.
See Also
Processing a multidimensional model (Analysis Services)
Batch Processing (Analysis Services)
5/16/2018 • 2 minutes to read • Edit Online
See Also
Processing a multidimensional model (Analysis Services)
Remote Processing (Analysis Services)
8/16/2018 • 3 minutes to read • Edit Online
Prerequisites
If you are running different versions of SQL Server on each computer, the client libraries must match the
version of the Analysis Services instance that is processing the model.
On the remote server, Allow remote connections to this computer must be enabled, and the account
issuing the processing request must be listed as an allowed user.
Windows firewall rules must be configured to allow inbound connections to Analysis Services. Verify you
can connect to the remote Analysis Services instance using SQL Server Management Studio. See Configure
the Windows Firewall to Allow Analysis Services Access.
Resolve any existing local processing errors before attempting remote processing. Verify that when the
processing request is local, data can be successfully retrieved from the external relational data source. See
Set Impersonation Options (SSAS - Multidimensional) for instructions on specifying credentials used to
retrieve data.
See Also
SQL Server Agent Components
Schedule SSAS Administrative Tasks with SQL Server Agent
Batch Processing (Analysis Services)
Processing a multidimensional model (Analysis Services)
Processing Objects (XMLA)
Error Configuration for Cube, Partition, and
Dimension Processing
5/16/2018 • 12 minutes to read • Edit Online
Execution order
The server always executes NullProcessing rules before ErrorConfiguration rules for each record. This is
important to understand because null processing properties that convert nulls to zeroes can subsequently
introduce duplicate key errors when two or more error records have zero in a key column.
Default behaviors
By default, processing stops at the first error implicating a key column. This behavior is controlled by an error limit
that specifies zero as the number of allowed errors and the Stop Processing directive that tells the server to stop
processing when the error limit is reached.
Records triggering an error, due to null or missing or duplicate values, are either converted to the unknown
member or discarded. Analysis Services will not import data that violates data integrity constraints.
Conversion to unknown member occurs by default, due to the ConvertToUnknown setting for
KeyErrorAction. Records allocated to unknown member are quarantined in the database as evidence of a
problem that you might want to investigate after processing is finished.
Unknown members are excluded from query workloads, but they will be visible in some client applications
if the UnknownMember is set to Visible.
If you want to track how many nulls were converted to the unknown member, you can modify the
NullKeyConvertedToUnknown property to report these errors to the log or in the Processing window.
Discard occurs when you manually set the KeyErrorAction property to DiscardRecord.
Through error configuration properties, you can determine how the server responds when an error occurs.
Options include stop processing immediately, continue processing but stop logging, or continue both processing
and logging of errors. Defaults vary based on the severity of the error.
The error count keeps track of how many errors occur. When you set an upper limit, server response changes
when that limit is reached. By default, the server stops processing after the limit is reached. The default limit is 0,
causing processing to stop on the first error that is counted.
High impact errors, such as a missing key or null value in a key field, should be addressed quickly. By default, these
errors adhere to ReportAndContinue server behaviors, where the server catches the error, adds it to the error
count, and then continues processing (except the error limit is zero, so processing stops immediately).
Other errors are generated but not counted or logged by default (this is the IgnoreError setting) because the error
does not necessarily pose a data integrity problem.
Error counts are affected by null processing settings. For dimension attributes, null processing options determine
how the server responds when null values are encountered. By default, nulls in a numeric column are converted to
zeroes, while nulls in a string column are processed as blank strings. You can override NullProcessing properties
to catch null values before they turn into KeyNotFound or KeyDuplicate errors. See Null keys in a dimension for
details.
Errors are logged in the Process dialog box but not saved. You can specify a key error log file name to collect errors
in a text file.
CalculationError IgnoreError neither logs nor counts ReportAndContinue logs and counts
the error; processing continues as long the error.
Occurs when initializing error as the error count is under the
configuration. maximum limit. ReportAndStop reports the error and
stops processing immediately,
regardless of the error limit.
PROPERTY DEFAULT OTHER VALUES
KeyNotFound ReportAndContinue logs and counts ReportAndStop reports the error and
the error. stops processing immediately,
Occurs when a foreign key in a fact regardless of the error limit.
table does not have a matching primary
key in a related dimension table (for IgnoreError neither logs nor counts
example, a Sales fact table has a record the error; processing continues as long
with a product ID that doesn't exist in as the error count is under the
the Product dimension table). This error maximum limit. Records that trigger this
can occur during partition processing, error are converted to the unknown
or dimension processing of snowflaked member by default, but you can change
dimensions. the KeyErrorAction property to
discard them instead.
KeyDuplicate IgnoreError neither logs nor counts ReportAndContinue logs and counts
the error; processing continues as long the error.
Occurs when duplicate attribute keys as the error count is under the
are found in a dimension. In most cases, maximum limit. ReportAndStop reports the error and
it is acceptable to have duplicate stops processing immediately,
attribute keys, but this error informs regardless of the error limit.
you of the duplicates so that you can
check the dimension for design flaws
that might lead to inconsistent
relationships between attributes.
NullKeyNotAllowed ReportAndContinue logs and counts ReportAndStop reports the error and
the error. stops processing immediately,
Occurs when NullProcessing = Error regardless of the error limit.
is set on a dimension attribute or when
null values exists in an attribute key IgnoreError neither logs nor counts
column used to uniquely identify a the error; processing continues as long
member. as the error count is under the
maximum limit. Records that trigger this
error are converted to the unknown
member by default, but you can set the
KeyErrorAction property to discard
them instead.
NullKeyConvertedToUnknown IgnoreError neither logs nor counts If you consider this error to be
the error; processing continues as long informational, keep the default.
Occurs when null values are as the error count is under the Otherwise, you can choose
subsequently converted to the maximum limit. ReportAndContinue to report the
unknown member. Setting error to the Processing window and
NullProcessing = count the error towards the error limit.
ConvertToUnknown on a dimension
attribute will trigger this error. ReportAndStop reports the error and
stops processing immediately,
regardless of the error limit.
General Properties
PROPERTY VALUES
KeyErrorLimit This is the maximum number of data integrity errors that the
server will allow before failing the processing. A value of -1
indicates that there is no limit. The default is 0, which means
processing stops after the first error occurs. You can also set it
to a whole number.
KeyErrorLimitAction This is the action taken by the server when the number of key
errors has reached the upper limit. With Stop Processing,
processing terminates immediately. With Stop Logging,
processing continues but errors are no longer reported or
counted.
Next step
Decide whether errors will stop processing or be ignored. Remember that only the error is ignored. The record that
caused the error is not ignored; it is either discarded or converted to unknown member. Records that violate data
integrity rules are never added to the database. By default, processing stops when the first error occurs, but you
can change this by raising the error limit. In cube development, it can be useful to relax error configuration rules,
allowing processing to continue, so that there is data to test with.
Decide whether to change default null processing behaviors. By default, nulls in a string column are processed as
empty values, while nulls in a numeric column are processed as zero. See Defining the Unknown Member and
Null Processing Properties for instructions on setting null processing on an attribute.
See Also
Log Properties
Defining the Unknown Member and Null Processing Properties
Roles and Permissions (Analysis Services)
5/16/2018 • 2 minutes to read • Edit Online
IMPORTANT
Permissions are additive for each Windows user or group, across all roles in the database. If one role denies a user or group
permission to perform certain tasks or view certain data, but another role grants this permission to that user or group, the
user or group will have permission to perform the task or view the data.
In this section
Authorizing access to objects and operations (Analysis Services)
Grant database permissions (Analysis Services)
Grant cube or model permissions (Analysis Services)
Grant process permissions (Analysis Services)
Grant read definition permissions on object metadata (Analysis Services)
Grant permissions on a data source object (Analysis Services)
Grant permissions on data mining structures and models (Analysis Services)
Grant permissions on a dimension (Analysis Services)
Grant custom access to dimension data (Analysis Services)
Grant custom access to cell data (Analysis Services)
See Also
Create and Manage Roles
Authorizing access to objects and operations
(Analysis Services)
5/16/2018 • 5 minutes to read • Edit Online
IMPORTANT
Members of the Analysis Services Server Administrator role and members of a database role having Full Control
(Administrator) permissions can access all data and metadata in the database and need no additional permissions to view
specific objects. Moreover, members of the Analysis Services server role cannot be denied access to any object in any
database, and members of an Analysis Services database role that has Full Control (Administrator) permissions within a
database cannot be denied access to any object within that database. Specialized administrative operations, such as
processing, can be authorized through separate roles having less permission. See Grant process permissions (Analysis
Services) for details.
Results include the database name, description, role name, and the date last modified. Using this
information as a starting point, you can proceed to individual databases to check membership and
permissions of a specific role.
NOTE
Users do not require any permissions to the relational tables in the underlying relational database from which Analysis
Services loads its data, and do not require any file level permissions on the computer on which the instance of Analysis
Services is running.
Best practices
To better manage permissions, we suggest an approach similar to the following:
1. Create roles by function (for example, dbadmin, cubedeveloper, processadmin) so that whoever maintains
the roles can see at glance what the role allows. As noted elsewhere, you can define roles in the model
definition, thus preserving those roles over subsequent solution deployments.
2. Create a corresponding Windows security group in Active Directory, and then maintain the security group
in Active Directory to insure it contains the appropriate individual accounts. This places the responsibility
of security group membership on security specialists who are already have proficiency with the tools and
processes used for account maintenance in your organization.
3. Generate scripts in SQL Server Management Studio so that you can quickly replicate role assignments
whenever the model is redeployed from its source files to a server. See Grant cube or model permissions
(Analysis Services) for details on how to quickly generate a script.
4. Adopt a naming convention that reflects the scope and membership of the role. Role names are only
visible in design and administration tools, so use a naming convention that makes sense to your cube
security specialists. For example, processadmin-windowsgroup1 indicates read access, plus processing
rights, to people in your organization whose individual Windows user accounts are members of the
windowsgroup1 security group.
Including account information can help you keep track of which accounts are used in various roles.
Because roles are additive, the combined roles associated with windowsgroup1 make up the effective
permission set for people belonging to that security group.
5. Cube developers will require Full Control permissions for models and databases under development, but
only need Read permissions once a database is rolled out to a production server. Remember to develop
role definitions and assignments for all scenarios, including development, test, and production
deployments.
Using an approach like this one minimizes churn to role definitions and role membership in the model, and
provides visibility into role assignments that makes cube permissions easier to implement and maintain.
See Also
Grant server admin rights to an Analysis Services instance
Roles and Permissions (Analysis Services)
Authentication methodologies supported by Analysis Services
Grant database permissions (Analysis Services)
5/16/2018 • 4 minutes to read • Edit Online
NOTE
Server administrators (members of the Server Administrator role) also have implicit Full Control over every database on the
server.
Process Database ─ This permission is used to delegate processing at the database level. As an administrator,
you can offload this task by creating a role that allows another person or service to invoke processing operations
for any object in the database. Alternatively, you can also create roles that enable processing on specific objects.
See Grant process permissions (Analysis Services) for more information.
Read Definition ─ This permission grants the ability to read object metadata, minus the ability to view
associated data. Typically this permission is used in roles created for dedicated processing, adding the ability to
use tools such as SQL Server Data Tools or SQL Server Management Studio to process a database interactively.
Without Read Definition, the Process Database permission is effective only in scripted scenarios. If you plan
to automate processing, perhaps through SSIS or another scheduler, you probably want to create a role that has
Process Database without Read Definition. Otherwise, consider combining the two properties together in the
same role to support both unattended and interactive processing via SQL Server tools that visualize the data
model in a user interface.
Process database
When defining a role that grants database permissions, you can skip Full Control and choose just Process
Database. This permission, set at the database level, allows processing on all objects within the database. See
Grant process permissions (Analysis Services)
Read definition
Like Process Database, setting Read Definition permissions at the database level has a cascading effect on
other objects within the database. If you want to set Read Definition permissions at a more granular level, you
must clear Read Definition as a database property in the General pane. See Grant read definition permissions on
object metadata (Analysis Services) for more information.
See Also
Grant server admin rights to an Analysis Services instance
Grant process permissions (Analysis Services)
Grant cube or model permissions (Analysis Services)
5/16/2018 • 5 minutes to read • Edit Online
NOTE
Only server administrators, or database administrators having Full Control permissions, can deploy a cube from source
files to a server, or create roles and assign members. See Grant server admin rights to an Analysis Services instance and
Grant database permissions (Analysis Services) for details about these permission levels.
NOTE
If you are an Analysis Services administrator, administrator permissions will be combined with roles having lesser
permissions, making it difficult to test role permissions in isolation. To simplify testing, we suggest that you open a
second instance of SSMS, using the account assigned to the role you are testing.
2. Hold-down the Shift key and right-click the Excel shortcut to access the Run as different user option.
Enter one of the Windows user or group accounts having membership in this role.
3. When Excel opens, use the Data tab to connect to Analysis Services. Because you are running Excel as a
different Windows user, the Use Windows Authentication option is the right credential type to use
when testing roles. See Connect from client applications (Analysis Services) if you need help with this
step.
If you get errors on the connection, check the port configuration for Analysis Services and verify that the
server accepts remote connections. See Configure the Windows Firewall to Allow Analysis Services
Access for port configuration.
Step 5: Script role definition and assignments
1. As a final step, you should generate a script that captures the role definition you just created.
Redeploying a project from SQL Server Data Tools will overwrite any roles or role memberships that are
not defined inside the project. The quickest way to rebuild roles and role membership after redeployment
is through script.
2. In SSMS, navigate to the Roles folder and right-click an existing role.
3. Select Script Role as | CREATE TO | file.
4. Save the file with an .xmla file extension. To test the script, delete the current role, open the file in SSMS,
and press F5 to execute the script.
Next step
You can refine cube permissions to restrict access to cell or dimension data. See Grant custom access to
dimension data (Analysis Services) and Grant custom access to cell data (Analysis Services) for details.
See Also
Authentication methodologies supported by Analysis Services
Grant permissions on data mining structures and models (Analysis Services)
Grant permissions on a data source object (Analysis Services)
Grant process permissions (Analysis Services)
5/16/2018 • 4 minutes to read • Edit Online
IMPORTANT
A user whose role only has Process permissions will be unable to use SQL Server Management Studio or SQL Server Data
Tools (SSDT) to connect to Analysis Services and process objects. These tools require the Read Definition permission to
access object metadata. Without the ability to use either tool, XMLA script must be used to execute a processing
operation.
We suggest you also grant Read Definition permissions for testing purposes. A user having both Read Definition and
Process Database permissions can process objects in SQL Server Management Studio, interactively. See Grant read
definition permissions on object metadata (Analysis Services) for details.
Test processing
1. Hold down the shift-key and right-click SQL Server Management Studio, select Run as a different user
and connect to the instance of Analysis Services using a Windows account assigned to the role you are
testing.
2. Open the Databases folder, and select a database. You will only see the databases that are visible to the
roles for which your account has membership.
3. Right-click a cube or dimension and select Process. Choose a processing option. Test all of the options,
for all combinations of objects. If errors occur due to missing objects, add the objects to the role.
NOTE
Permission to read a database's metadata is the minimum permission required to connect to an Analysis Services database
using either Management Studio or SQL Server Data Tools. A user who has permission to read metadata can also use the
DISCOVER_XML_METADATA schema rowset to query the object and view its metadata. For more information, see
DISCOVER_XML_METADATA Rowset.
See Also
Grant database permissions (Analysis Services)
Grant process permissions (Analysis Services)
Grant permissions on a dimension (Analysis Services)
10/26/2018 • 3 minutes to read • Edit Online
NOTE
By default, permissions on a database dimension are inherited by a cube dimension. For example, if you enable Read/Write
on a Customer database dimension, the Customer cube dimension inherits Read/Write in the context of the current role.
You can clear inherited permissions if you want to override a permission setting.
IMPORTANT
If you configure database role permissions by using Analysis Management Objects (AMO), any reference to a cube
dimension in a cube's DimensionPermission attribute severs the permission inheritance from the database's
DimensionPermission attribute. For more information about AMO, see Developing with Analysis Management Objects
(AMO).
See Also
Roles and Permissions (Analysis Services)
Grant cube or model permissions (Analysis Services)
Grant permissions on data mining structures and models (Analysis Services)
Grant custom access to dimension data (Analysis Services)
Grant custom access to cell data (Analysis Services)
Grant custom access to dimension data (Analysis
Services)
5/16/2018 • 8 minutes to read • Edit Online
By default, if you can read data from an Analysis Services cube, you automatically have read permissions on all
measures and dimension members associated with that cube. While this behavior might be sufficient for many
scenarios, sometimes security requirements call for a more segmented authorization strategy, with varying
levels of access for different users, on the same dimension.
You can restrict access by choosing which members to allow (AllowedSet) or deny (DeniedSet) access. You do
this by either selecting or deselecting dimension members to include or exclude from the role.
Basic dimension security is the easiest; you simply select which dimension attributes and attribute hierarchies to
include or exclude in the role. Advanced security is more complex and requires expertise in MDX scripting. Both
approaches are described below.
NOTE
The following instructions assume a client connection that issues queries in MDX. If the client uses DAX, such as Power
View in Power BI, then dimension security is not evident in the query results. See Understanding Power View for
Multidimensional Models for more information.
Prerequisites
Not all measures or dimension members can be used in custom access scenarios. A connection will fail if a role
restricts access to a default measure or member, or restricts access to measures that are part of measure
expressions.
Check for obstructions to dimension security: default measures, default members, and measures used
in measure expressions
1. In SQL Server Management Studio, right-click a cube and select Script Cube as | ALTER To | New
Query Editor Window.
2. Search for DefaultMeasure. You should find one for the cube, and one for each perspective. When
defining dimension security, avoid restricting access to default measures.
3. Next, search for MeasureExpression. A measure expression is a measure, based on a calculation, where
the calculation often includes other measures. Verify that the measure you want to restrict is not used in
an expression. Alternatively, go ahead and restrict access, just make sure to also exclude all references to
that measure throughout the cube.
4. Finally, search for DefaultMember. Make a note of any attributes that serve as a default member of an
attribute. Avoid putting restrictions on those attributes when setting up dimension security.
NOTE
When applying permissions that trim dimension members, aggregated totals are not recalculated automatically.
Suppose the All member of an attribute hierarchy returns a count of 200 before permissions are applied. After
applying permissions that deny access to some members, All still returns 200, even though the member values
visible to the user are much less. To avoid confusing the consumers of your cube, you can configure the All
member be the aggregate of just those members to which role members, rather than the aggregate of all of the
members of the attribute hierarchy. To invoke this behavior, you can enable Visual Totals on the Advanced tab
when configuring dimension security. Once enabled, the aggregate is calculated at query time rather than retrieved
from pre-calculated aggregations. This can have a noticeable effect on query performance, so use it only when
necessary.
Hiding measures
In Grant custom access to cell data (Analysis Services), it was explained that fully hiding all visual aspects of a
measure, and not just its cell data, requires permissions on dimension members. This section explains how to
deny access to the object metadata of a measure.
1. On Dimension Data | Basic, scroll down the Dimension list until you reach cube dimensions, and then
select Measures Dimension.
2. From the list of measures, clear the check box for measures that should not appear to users connecting
via this role.
NOTE
Check the Prerequisites to learn how to identify measures that can break role security.
NOTE
If you define an empty set ({}) of attribute members, no members of the attribute will be visible to the database role. The
absence of an allowed set is not interpreted as an empty set.
See Also
Grant cube or model permissions (Analysis Services)
Grant custom access to cell data (Analysis Services)
Grant permissions on data mining structures and models (Analysis Services)
Grant permissions on a data source object (Analysis Services)
Grant custom access to cell data (Analysis Services)
11/28/2018 • 6 minutes to read • Edit Online
Cell permissions apply to data inside the cell, and not to its metadata. Notice how the cell is still visible in the
results of a query, displaying a value of #N/A instead of the actual cell value. The #N/A value appears in the cell
unless the client application translates the value, or another value is specified by setting the Secured Cell Value
property in the connection string.
To hide the cell entirely, you have to limit the members-dimensions, dimension attributes, and dimension
attribute members-that are viewable. For more information, see Grant custom access to dimension data
(Analysis Services).
As an administrator, you can specify whether role members have read, read contingent, or read/write
permissions on cells within a cube. Putting permissions on a cell is the lowest level of security allowed, so before
you start applying permissions at this level, it's important to keep a few facts in mind:
Cell-level security cannot expand rights that have been restricted at a higher level. An example: if a role
denies access to dimension data, cell-level security cannot override the denied set. Another example:
consider a role with Read permission on a cube and Read/Write permission on a cell ─ the cell data
permission will not be Read/Write; it will be Read.
Custom permissions often need to be coordinated between dimension members and cells within the
same role. For example, suppose you want to deny access to several discount-related measures for
different combinations of resellers. Given Resellers as dimension data and Discount Amount as a
measure, you would need to combine within the same role permissions on both the measure (using the
instructions in this topic), as well as on dimension members. See Grant custom access to dimension data
(Analysis Services) for details on setting dimension permissions.
Cell-level security is specified through MDX expressions. Because a cell is a tuple (that is, an intersection point
across potentially multiple dimensions and measures), it is necessary to use MDX to identify specific cells.
This expression explicitly identifies which measures are visible to users. No other measures will be
available to users connecting through this role. Notice that CurrentMember (MDX) sets the context and is
followed by the measure that is allowed. The effect of this expression is, if the current member includes
either the Reseller Sales Amount or the Reseller Total Product Cost, show the value. Otherwise, deny
access. The expression has multiple parts, with each part enclosed in parentheses. The OR operator is
used to specify multiple measures.
In Excel, connect to the cube using the current role, and choose all three measures to see the effects of cell
security. Notice that measures in the denied set are unavailable, but the calculated measure is visible to the user.
NOTE
What happens if you set both the Read and Read-Contingent permissions on a cell within the same role? The role will
provide Read permissions on the cell, and not Read-Contingent.
Recall from previous sections that selecting just the Enable read-contingent permissions checkbox, without
providing any MDX expression, denies access to all cells in the cube. This is because the default allowed set is an
empty set whenever Analysis Services resolves a subset of cube cells.
See Also
MDX Builder (Analysis Services - Multidimensional Data)
The Basic MDX Script (MDX)
Grant process permissions (Analysis Services)
Grant permissions on a dimension (Analysis Services)
Grant custom access to dimension data (Analysis Services)
Grant cube or model permissions (Analysis Services)
Grant permissions on a data source object (Analysis
Services)
5/16/2018 • 2 minutes to read • Edit Online
IMPORTANT
For security reasons, the submission of DMX queries by using an open connection string in the OPENROWSET clause is
disabled.
See Also
Data Sources in Multidimensional Models
Connection String Properties (Analysis Services)
Authentication methodologies supported by Analysis Services
Grant custom access to dimension data (Analysis Services)
Grant cube or model permissions (Analysis Services)
Grant custom access to cell data (Analysis Services)
Grant permissions on data mining structures and
models (Analysis Services)
5/16/2018 • 2 minutes to read • Edit Online
NOTE
By default, the submission of DMX queries by using OPENROWSET is disabled.
See Also
Grant server admin rights to an Analysis Services instance
Grant cube or model permissions (Analysis Services)
Grant custom access to dimension data (Analysis Services)
Grant custom access to cell data (Analysis Services)
Power View for Multidimensional Models
12/7/2018 • 2 minutes to read • Edit Online
In this section
Understanding Power View for Multidimensional Models
Create a Report Data Source
Create a Power View Report with a Multidimensional Data Source
Understanding Power View for Multidimensional
Models
11/28/2018 • 10 minutes to read • Edit Online
Prerequisites
Server Requirements
Microsoft SQL Server 2016 Analysis Services running in Multidimensional mode.
Microsoft SQL Server 2016 Reporting Services Add-in for Microsoft SharePoint Server 2010 or later
Enterprise Edition.
Client Requirements
Power View client functionality requires Microsoft Silverlight 5. For more information, see Browser Support for
Reporting Services and Power View.
Features
Native support for Power View
With this release, multidimensional models support analysis and visualization by using Power View in SharePoint
mode. No special configuration of your multidimensional models is necessary. There are however some
differences in how multidimensional model objects are displayed in Power View compared to other client tools
such as Microsoft Excel and Microsoft Performance Point. This release does not support analysis and visualization
of multidimensional models by using Power View in Excel.
Native support for DAX queries
With this release, multidimensional models support DAX queries and functions in addition to more traditional
MDX queries. Some DAX functions, such as PATH, are not applicable in multidimensional modeling. For a better
understanding of DAX and how it compares to MDX, see Data Analysis Expressions and MDX.
Cube Model
Measure Measure
Perspective Perspective
KPI KPI
Measure groups in a multidimensional cube are seen in the Power View Field List as tables with the sigma (∑)
sign.
Measure groups in the Power View Field List
Measures within a measure group appear as measures. If there are calculated measures that do not have an
associated measure group, they will be grouped under a special table called Measures.
To help simplify more complex multidimensional models, model authors can define a set of measures or KPIs in a
cube to be located within a display folder. Power View can show display folders and the measures and KPIs in
them.
Measures and KPIs in a measure group
Measures as variants
Measures in multidimensional models are variants. This means the measures are not strongly typed and can have
different data types. For example, in the image below, the Amount measure in the Financial Reporting table by
default is Currency data type, but also has a string value "NA" for the sub-total of "Statistical Accounts", which is
String data type. Power View recognizes certain measures as variants and shows the correct values and formatting
in the different visualizations.
Measure as variant
Implicit measures
Tabular models provide users the ability to create implicit measures such as count, sum, or average on fields. For
multidimensional models, because dimension attribute data is stored differently, querying implicit measures can
take a long time. Because of this, implicit measures are not available in Power View.
Default members
Multidimensional models support default members for dimension attributes. The default member is used by
Analysis Services when aggregating data for a query. The default member of a dimension attribute is exposed as
default value or filter for the corresponding column in the tabular metadata.
Power View behaves much the same as Excel PivotTables when attributes are applied. When a user adds a column
to a Power View visualization (table, matrix, or chart) that contains a default value, the default value will not be
applied and all available values are shown. If the user adds the column to Filters, the default value will be applied.
Dimension security
Multidimensional models support dimension and cell level security through roles. A user connecting to a cube by
using Power View is authenticated and evaluated for appropriate permissions. When dimension security is applied,
the respective dimension members will not be seen by the user in Power View; however if a user has a cell security
permission defined where certain cells are restricted, then that user cannot connect to the cube with Power View.
In some cases, users can see aggregate data when portions of that data are calculated from secured data.
Non-aggregatable attributes/hierarchies
In a multidimensional model, attributes of a dimension can have the IsAggregatable property set to false. This
means the model author has specified client applications should not aggregate the data across hierarchies
(attribute or multi-level) when they query the data. In Power View, this dimension attribute is exposed as a column
for which sub-totals are not available. In the image below, you can see an example of a non-aggregatable
hierarchy: Accounts. The top-most level of the Accounts parent-child hierarchy is non-aggregatable while other
levels are aggregatable. In a matrix visualization of the Accounts hierarchy (first two levels), you see sub-totals for
Account Level 02 but not for the top-most level, Account Level 01.
Non-aggregatable hierarchy in Power View
Images
Power View provides the ability to render images. In multidimensional models, one of the ways you can provide
images to Power View is to expose columns containing URLs (Uniform Resource Locator) of the images. With this
release, Analysis Services supports tagging dimension attributes as type ImageURL. This data type is then
provided to Power View in the tabular metadata. Power View can then download and display the images specified
in the URLs within visualizations.
ImageURL dimension attribute type in SSDT
Parent-child hierarchies
Multidimensional models support parent-child hierarchies, which are exposed as a hierarchy in the tabular
metadata. Each level of the parent-child hierarchy is exposed as a hidden column. The key attribute of the parent-
child dimension is not exposed in the tabular metadata.
Parent-child hierarchies in Power View
Cubes can have metadata and data translations specified for various Languages within the model. In order to see
the translations (data and metadata) you need to add the optional "Locale Identifier" property to the connection
string in the RSDS file as shown below.
Data Source=localost;Initial Catalog=AdventureWorksDW-MD;Cube='Adventure Works'; Locale Identifier=3084
When Power View connects to a multidimensional model with an .rsds file that has a Locale Identifier, and if a
corresponding translation is contained in the cube, users will see the translations in Power View.
For more information, see Create a Report Data Source.
Unsupported features
Power View in Excel 2013 - does not support connecting to and creating reports for multidimensional models.
However, Power View in Excel 2016 does support connecting to and creating reports for multidimensional
models. To learn more, see Power View and OLAP in Excel 2016
Actions - are not supported in Power View reports or in DAX queries against a multidimensional model.
Named sets - in multidimensional models, are not supported in Power View or in DAX queries against a
multidimensional model.
NOTE
Unsupported Actions and Named sets do not prevent users from connecting to and exploring multidimensional models
using Power View.
CSDLBI Annotations
Multidimensional cube metadata is exposed as an Entity Data Model (EDM ) based conceptual model by
Conceptual Schema Definition Language with Business Intelligence annotations (CSDLBI).
Multidimensional metadata is represented as a tabular model namespace in a CSDLBI document, or CSDL out,
when a DISCOVER_CSDL_METADATA request is sent to the Analysis Services instance.
Sample DISCOVER_CSDL_METADATA request
<Envelopexmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<Discoverxmlns="urn:schemas-microsoft-com:xml-analysis">
<RequestType>DISCOVER_CSDL_METADATA</RequestType>
<Restrictions>
<RestrictionList>
<CATALOG_NAME>"catalogname"<CATALOG_NAME>
</RestrictionList>
</Restrictions>
<Properties>
<PropertyList>
</PropertyList>
</Properties>
</Discover>
</Body>
</Envelope>
PERSPECTIVE_NAME Yes, if the cube contains more than one The cube name or perspective name in
perspective. Optional if there is only the multidimensional database.
one cube or there is a default
perspective.
The return CSDL out document represents the model as a namespace, containing entities, associations, and
properties.
For more detailed information about CSDLBI annotations for tabular models, see Technical Reference for BI
Annotations to CSDL on MSDN, and [MS -CSDLBI]: Conceptual Schema Definitions File Format with Business
Intelligence Annotations.
NOTE
If you do not see the Report Data Source item on the menu, the report data source content type has not been
enabled for this library. For more information, see Add Reporting Services Content Types to a SharePoint Library.
3. On the Data Source Properties page, in Name, type a name for the connection .rsds file.
4. In Data Source Type, select Microsoft BI Semantic Model for Power View.
5. In Connection String, specify the Analysis Services server name, database name, cube name, and any
optional settings.
Connection String:
Data source=<servername>;initial catalog=<multidimensionaldatabasename>-ee;cube='<cubename>'
NOTE
If there is more than one cube, you must specify a cube name.
(Optional) Cubes can have perspectives that provide users a select view where only certain dimensions
and/or measure groups are visible in the client. To specify a perspective, enter the perspective name as a
value to the Cube property:
Data source=<servername>;initial catalog=<multidimensionaldatabasename>-ee;cube='<perspectivename>'
(Optional) Cubes can have metadata and data translations specified for various languages within the model.
In order to see the translations (data and metadata) you need to add the "Locale Identifier" property to the
connection string:
Data source=<servername>;initial catalog=<multidimensionaldatabasename>-ee;cube='<cubename>'; Locale
Identifier=<identifier number>
6. In Credentials, specify how the report server obtains credentials to access the external data source.
Select Windows authentication (integrated) if you want to access the data using the credentials
of the user who opened the report. Do not select this option if the SharePoint site or farm uses forms
authentication or connects to the report server through a trusted account. Do not select this option if
you want to schedule subscription or data processing for this report. This option works best when
Kerberos authentication is enabled for your domain, or when the data source is on the same
computer as the report server. If Kerberos authentication is not enabled, Windows credentials can
only be passed to one other computer. This means that if the external data source is on another
computer, requiring an additional connection, you will get an error instead of the data you expect.
Select Prompt for credentials if you want the user to enter his or her credentials each time he or
she runs the report. Do not select this option if you want to schedule subscription or data processing
for this report.
Select Stored credentials if you want to access the data using a single set of credentials. The
credentials are encrypted before they are stored. You can select options that determine how the
stored credentials are authenticated. Select Use as Windows credentials if the stored credentials
belong to a Windows user account. Select Set execution context to this account if you want to
set the execution context on the database server.
Select Credentials are not required if you specify credentials in the connection string, or if you
want to run the report using a least-privilege account.
7. Click Test Connection to validate.
8. Select Enable this data source if you want the data source to be active. If the data source is configured but
not active, users will receive an error message when they attempt to create a report.
Create a Power View Report with a Multidimensional
Data Source
5/16/2018 • 2 minutes to read • Edit Online
IMPORTANT
COM assemblies might pose a security risk. Due to this risk and other considerations, COM assemblies were deprecated in
SQL Server 2008 Analysis Services (SSAS). COM assemblies might not be supported in future releases.
Assemblies let you extend the business functionality of MDX and DMX. You build the functionality that you want
into a library, such as a dynamic link library (DLL ) and add the library as an assembly to an instance of Analysis
Services or to an Analysis Services database. The public methods in the library are then exposed as user-defined
functions to MDX and DMX expressions, procedures, calculations, actions, and client applications.
An assembly with new procedures and functions can be added to the server. You can use assemblies to enhance
or add custom functionality that is not provided by the server. By using assemblies, you can add new functions to
Multidimensional Expressions (MDX), Data Mining Extensions (DMX), or stored procedures. Assemblies are
loaded from the location where the custom application is run, and a copy of the assembly binary file is saved
along with the database data in the server. When an assembly is removed, the copied assembly is also removed
from the server.
Assemblies can be of two different types: COM and CLR. CLR assemblies are assemblies developed in .NET
Framework programming languages such as C#, Visual Basic .NET, managed C++. COM assemblies are COM
libraries that must be registered in the server
Assemblies can be added to Server or Database objects. Server assemblies can be called by any user connected
to the server or any object in the server. Database assemblies can be called only by Database objects or users
connected to the database.
A simple Assembly object is composed of basic information (Name and Id), file collection, and security
specifications.
The file collection refers to the loaded assembly files and their corresponding debugging (.pdb) files, if the
debugging files were loaded with the assembly files. Assembly files are loaded from the location where the
application defined the files to, and a copy is saved in the server along with the data. The copy of the assembly file
is used to load the assembly every time the service is started.
Security specifications include the permission set and the impersonation used to run the assembly.
User-defined functions can also be called using the CALL keyword. You must use the CALL keyword for user-
defined functions which return recordsets or void values, and you cannot use the CALL keyword if the user-
defined function depends on an object in the context of the MDX or DMX statement or script, such as the current
cube or data mining model. A common use for a function called outside an MDX or DMX query is to use the
AMO object model to perform administrative functions. If, for example, you wanted to use the function
MyVoidProcedure(a, b, c) in an MDX statement, the following syntax would be employed:
Call MyAssembly.MyClass.MyVoidProcedure(a, b, c)
Assemblies simplify database development by enabling common code to be developed once and stored in a
single location. Client software developers can create libraries of functions for Analysis Services and distribute
them with their applications.
Assemblies and user-defined functions can duplicate the function names of the Analysis Services function library
or of other assemblies. As long as you call the user-defined function by using its fully qualified name, Analysis
Services will use the correct procedure. For security purposes, and to eliminate the chance of calling a duplicate
name in a different class library, Analysis Services requires that you use only fully qualified names for stored
procedures.
To call a user-defined function from a specific CLR assembly, the user-defined function is preceded by the
assembly name, full class name, and procedure name, as demonstrated here:
AssemblyName.FullClassName.ProcedureName(Argument1, Argument2, ...)
For backward compatibility with earlier versions of Analysis Services, the following syntax is also acceptable:
AssemblyName!FullClassName!ProcedureName(Argument1, Argument2, ...)
If a COM library supports multiple interfaces, the interface ID can also be used to resolve the procedure name, as
demonstrated here:
AssemblyName!InterfaceID!ProcedureName(Argument1, Argument2, ...)
Security
Security for assemblies is based on the .NET Framework security model, which is a code-access security model.
.NET Framework supports a code-access security mechanism that assumes that the runtime can host both fully
trusted and partially trusted code. The resources that are protected by .NET Framework code access security are
typically wrapped by managed code which demands the corresponding permission before enabling access to the
resource. The demand for the permission is satisfied only if all the callers (at the assembly level) in the call stack
have the corresponding resource permission.
For assemblies, permission for execution is passed with the PermissionSet property on the Assembly object.
The permissions that managed code receives are determined by the security policy in effect. There are already
three levels of policy in effect in a non- Analysis Services hosted environment: enterprise, computer and user. The
effective list of permissions that code receives is determined by the intersection of the permissions obtained by
these three levels.
Analysis Services supplies a host-level security policy level to the CLR while hosting it; this policy is an additional
policy level below the three policy levels that are always in effect. This policy is set for every application domain
that is created by Analysis Services.
The Analysis Services host-level policy is a combination of Analysis Services fixed policy for system assemblies
and user-specified policy for user assemblies. The user-specified piece of the Analysis Services host policy is
based on the assembly owner specifying one of three permission buckets for each assembly:
ExternalAccess Provides the same access as the Safe setting, with the
additional ability to access external system resources. This
permission bucket does not offer security guarantees
(although it is possible to secure this scenario), but it does
give reliability guarantees.
When CLR is hosted by Analysis Services, the stack-walk based permission check stops at the boundary with
native Analysis Services code. Any managed code in Analysis Services assemblies always falls into one of the
three permission categories listed earlier.
COM (or unmanaged) assembly routines do not support the CLR security model.
Impersonation
Whenever managed code accesses any resource outside Analysis Services, Analysis Services follows the rules
associated with the ImpersonationMode property setting of the assembly to make sure that the access occurs
in an appropriate Windows security context. Because assemblies using the Safe permission setting cannot access
resources outside Analysis Services, these rules are applicable only for assemblies using the ExternalAccess and
Unsafe permission settings.
If the current execution context corresponds to Windows Authenticated login and is the same as the
context of the original caller (that is, there is no EXECUTE AS in the middle), Analysis Services will
impersonate the Windows Authenticated login before accessing the resource.
If there is an intermediate EXECUTE AS that changed the context from that of the original caller), the
attempt to access external resource will fail.
The ImpersonationMode property can be set to ImpersonateCurrentUser or ImpersonateAnonymous. The
default setting, ImpersonateCurrentUser, runs an assembly under the current user's network login account. If
the ImpersonateAnonymous setting is used, the execution context is corresponds to the Windows login user
account IUSER_servername on the server. This is the Internet guest account, which has limited privileges on the
server. An assembly running in this context can only access limited resources on the local server.
Application Domains
Analysis Services does not expose application domains directly. Because of a set of assemblies running in the
same application domain, application domains can discover each other at execution time by using the
System.Reflection namespace in the .NET Framework or in some other way, and can call into them in late-
bound manner. Such calls will be subject to the permission checks used by Analysis Services authorization-based
security.
You should not rely on finding assemblies in the same application domain, because the application domain
boundary and the assemblies that go into each domain are defined by the implementation.
See Also
Setting Security for Stored Procedures
Defining Stored Procedures
Data Mining (SSAS)
1/9/2019 • 2 minutes to read • Edit Online
IMPORTANT
Data mining is deprecated in SQL Server Analysis Services 2017. Documentation is not updated for deprecated features. To
learn more, see Analysis Services backward compatibility (SQL 2017).
SQL Server has been a leader in predictive analytics since the 2000 release, by providing data mining in Analysis
Services. The combination of Integration Services, Reporting Services, and SQL Server Data Mining provides an
integrated platform for predictive analytics that encompasses data cleansing and preparation, machine learning,
and reporting. SQL Server Data Mining includes multiple standard algorithms, including EM and K-means
clustering models, neural networks, logistic regression and linear regression, decision trees, and naive bayes
classifiers. All models have integrated visualizations to help you develop, refine, and evaluate your models.
Integrating data mining into business intelligence solution helps you make intelligent decisions about complex
problems.
In This Section
The topics in this section introduce the principal features of SQL Server Data Mining and related tasks.
Data Mining Concepts
Data Mining Algorithms (Analysis Services - Data Mining)
Mining Structures (Analysis Services - Data Mining)
Mining Models (Analysis Services - Data Mining)
Testing and Validation (Data Mining)
Data Mining Queries
Data Mining Solutions
Data Mining Tools
Data Mining Architecture
Security Overview (Data Mining)
See Also
SQL Server R Services
Data Mining Concepts
1/9/2019 • 13 minutes to read • Edit Online
IMPORTANT
Data mining is deprecated in SQL Server Analysis Services 2017. Documentation is not updated for deprecated features. To
learn more, see Analysis Services backward compatibility (SQL 2017).
Data mining is the process of discovering actionable information from large sets of data. Data mining uses
mathematical analysis to derive patterns and trends that exist in data. Typically, these patterns cannot be
discovered by traditional data exploration because the relationships are too complex or because there is too much
data.
These patterns and trends can be collected and defined as a data mining model. Mining models can be applied to
specific scenarios, such as:
Forecasting: Estimating sales, predicting server loads or server downtime
Risk and probability: Choosing the best customers for targeted mailings, determining the probable break-
even point for risk scenarios, assigning probabilities to diagnoses or other outcomes
Recommendations: Determining which products are likely to be sold together, generating
recommendations
Finding sequences: Analyzing customer selections in a shopping cart, predicting next likely events
Grouping: Separating customers or events into cluster of related items, analyzing and predicting affinities
Building a mining model is part of a larger process that includes everything from asking questions about the data
and creating a model to answer those questions, to deploying the model into a working environment. This process
can be defined by using the following six basic steps:
1. Defining the Problem
2. Preparing Data
3. Exploring Data
4. Building Models
5. Exploring and Validating Models
6. Deploying and Updating Models
The following diagram describes the relationships between each step in the process, and the technologies in
Microsoft SQL Server that you can use to complete each step.
The process illustrated in the diagram is cyclical, meaning that creating a data mining model is a dynamic and
iterative process. After you explore the data, you may find that the data is insufficient to create the appropriate
mining models, and that you therefore have to look for more data. Alternatively, you may build several models
and then realize that the models do not adequately answer the problem you defined, and that you therefore must
redefine the problem. You may have to update the models after they have been deployed because more data has
become available. Each step in the process might need to be repeated many times in order to create a good model.
Microsoft SQL Server Data Mining provides an integrated environment for creating and working with data
mining models. This environment includes SQL Server Development Studio, which contains data mining
algorithms and query tools that make it easy to build a comprehensive solution for a variety of projects, and SQL
Server Management Studio, which contains tools for browsing models and managing data mining objects. For
more information, see Creating Multidimensional Models Using SQL Server Data Tools (SSDT).
For an example of how the SQL Server tools can be applied to a business scenario, see the Basic Data Mining
Tutorial.
This step includes analyzing business requirements, defining the scope of the problem, defining the metrics by
which the model will be evaluated, and defining specific objectives for the data mining project. These tasks
translate into questions such as the following:
What are you looking for? What types of relationships are you trying to find?
Does the problem you are trying to solve reflect the policies or processes of the business?
Do you want to make predictions from the data mining model, or just look for interesting patterns and
associations?
Which outcome or attribute do you want to try to predict?
What kind of data do you have and what kind of information is in each column? If there are multiple tables,
how are the tables related? Do you need to perform any cleansing, aggregation, or processing to make the
data usable?
How is the data distributed? Is the data seasonal? Does the data accurately represent the processes of the
business?
To answer these questions, you might have to conduct a data availability study, to investigate the needs of the
business users with regard to the available data. If the data does not support the needs of the users, you might
have to redefine the project.
You also need to consider the ways in which the results of the model can be incorporated in key performance
indicators (KPI) that are used to measure business progress.
Preparing Data
The second step in the data mining process, as highlighted in the following diagram, is to consolidate and clean
the data that was identified in the Defining the Problem step.
Data can be scattered across a company and stored in different formats, or may contain inconsistencies such as
incorrect or missing entries. For example, the data might show that a customer bought a product before the
product was offered on the market, or that the customer shops regularly at a store located 2,000 miles from her
home.
Data cleaning is not just about removing bad data or interpolating missing values, but about finding hidden
correlations in the data, identifying sources of data that are the most accurate, and determining which columns are
the most appropriate for use in analysis. For example, should you use the shipping date or the order date? Is the
best sales influencer the quantity, total price, or a discounted price? Incomplete data, wrong data, and inputs that
appear separate but in fact are strongly correlated all can influence the results of the model in ways you do not
expect.
Therefore, before you start to build mining models, you should identify these problems and determine how you
will fix them. For data mining typically you are working with a very large dataset and cannot examine every
transaction for data quality; therefore, you might need to use some form of data profiling and automated data
cleansing and filtering tools, such as those supplied in Integration Services, Microsoft SQL Server 2012 Master
Data Services, or SQL Server Data Quality Services to explore the data and find the inconsistencies. For more
information, see these resources:
Integration Services in Business Intelligence Development Studio
Master Data Services Overview (MDS )
Data Quality Services
It is important to note that the data you use for data mining does not need to be stored in an Online Analytical
Processing (OLAP ) cube, or even in a relational database, although you can use both of these as data sources. You
can conduct data mining using any source of data that has been defined as an Analysis Services data source. These
can include text files, Excel workbooks, or data from other external providers. For more information, see Supported
Data Sources (SSAS - Multidimensional).
Exploring Data
The third step in the data mining process, as highlighted in the following diagram, is to explore the prepared data.
You must understand the data in order to make appropriate decisions when you create the mining models.
Exploration techniques include calculating the minimum and maximum values, calculating mean and standard
deviations, and looking at the distribution of the data. For example, you might determine by reviewing the
maximum, minimum, and mean values that the data is not representative of your customers or business
processes, and that you therefore must obtain more balanced data or review the assumptions that are the basis for
your expectations. Standard deviations and other distribution values can provide useful information about the
stability and accuracy of the results. A large standard deviation can indicate that adding more data might help you
improve the model. Data that strongly deviates from a standard distribution might be skewed, or might represent
an accurate picture of a real-life problem, but make it difficult to fit a model to the data.
By exploring the data in light of your own understanding of the business problem, you can decide if the dataset
contains flawed data, and then you can devise a strategy for fixing the problems or gain a deeper understanding of
the behaviors that are typical of your business.
You can use tools such as Master Data Services to canvass available sources of data and determine their
availability for data mining. You can use tools such as SQL Server Data Quality Services, or the Data Profiler in
Integration Services, to analyze the distribution of your data and repair issues such as wrong or missing data.
After you have defined your sources, you combine them in a Data Source view by using the Data Source View
Designer in SQL Server Data Tools. For more information, see Data Source Views in Multidimensional Models.
This designer also contains some several tools that you can use to explore the data and verify that it will work for
creating a model. For more information, see Explore Data in a Data Source View (Analysis Services).
Note that when you create a model, Analysis Services automatically creates statistical summaries of the data
contained in the model, which you can query to use in reports or further analysis. For more information, see Data
Mining Queries.
Building Models
The fourth step in the data mining process, as highlighted in the following diagram, is to build the mining model
or models. You will use the knowledge that you gained in the Exploring Data step to help define and create the
models.
You define the columns of data that you want to use by creating a mining structure. The mining structure is linked
to the source of data, but does not actually contain any data until you process it. When you process the mining
structure, Analysis Services generates aggregates and other statistical information that can be used for analysis.
This information can be used by any mining model that is based on the structure. For more information about
how mining structures are related to mining models, see Logical Architecture (Analysis Services - Data Mining).
Before the structure and model is processed, a data mining model too is just a container that specifies the columns
used for input, the attribute that you are predicting, and parameters that tell the algorithm how to process the data.
Processing a model is often called training. Training refers to the process of applying a specific mathematical
algorithm to the data in the structure in order to extract patterns. The patterns that you find in the training process
depend on the selection of training data, the algorithm you chose, and how you have configured the algorithm.
SQL Server 2017 contains many different algorithms, each suited to a different type of task, and each creating a
different type of model. For a list of the algorithms provided in SQL Server 2017, see Data Mining Algorithms
(Analysis Services - Data Mining).
You can also use parameters to adjust each algorithm, and you can apply filters to the training data to use just a
subset of the data, creating different results. After you pass data through the model, the mining model object
contains summaries and patterns that can be queried or used for prediction.
You can define a new model by using the Data Mining Wizard in SQL Server Data Tools, or by using the Data
Mining Extensions (DMX) language. For more information about how to use the Data Mining Wizard, see Data
Mining Wizard (Analysis Services - Data Mining). For more information about how to use DMX, see Data Mining
Extensions (DMX) Reference.
It is important to remember that whenever the data changes, you must update both the mining structure and the
mining model. When you update a mining structure by reprocessing it, Analysis Services retrieves data from the
source, including any new data if the source is dynamically updated, and repopulates the mining structure. If you
have models that are based on the structure, you can choose to update the models that are based on the structure,
which means they are retrained on the new data, or you can leave the models as is. For more information, see
Processing Requirements and Considerations (Data Mining).
After the mining models exist in a production environment, you can perform many tasks, depending on your
needs. The following are some of the tasks you can perform:
Use the models to create predictions, which you can then use to make business decisions. SQL Server
provides the DMX language that you can use to create prediction queries, and Prediction Query Builder to
help you build the queries. For more information, see Data Mining Extensions (DMX) Reference.
Create content queries to retrieve statistics, rules, or formulas from the model. For more information, see
Data Mining Queries.
Embed data mining functionality directly into an application. You can include Analysis Management Objects
(AMO ), which contains a set of objects that your application can use to create, alter, process, and delete
mining structures and mining models. Alternatively, you can send XML for Analysis (XMLA) messages
directly to an instance of Analysis Services. For more information, see Development (Analysis Services -
Data Mining).
Use Integration Services to create a package in which a mining model is used to intelligently separate
incoming data into multiple tables. For example, if a database is continually updated with potential
customers, you could use a mining model together with Integration Services to split the incoming data into
customers who are likely to purchase a product and customers who are likely to not purchase a product.
For more information, see Typical Uses of Integration Services.
Create a report that lets users directly query against an existing mining model. For more information, see
Reporting Services in SQL Server Data Tools (SSDT).
Update the models after review and analysis. Any update requires that you reprocess the models. For more
information, see Processing Data Mining Objects.
Update the models dynamically, as more data comes into the organization, and making constant changes to
improve the effectiveness of the solution should be part of the deployment strategy. For more information,
see Management of Data Mining Solutions and Objects
See Also
Data Mining Solutions
Data Mining Tools
Data Mining Algorithms (Analysis Services - Data
Mining)
5/16/2018 • 7 minutes to read • Edit Online
Flag the customers in a prospective buyers list as good or Microsoft Naive Bayes Algorithm
poor prospects.
Microsoft Clustering Algorithm
Calculate the probability that a server will fail within the
next 6 months. Microsoft Neural Network Algorithm
Predict site visitors given past historical and seasonal Microsoft Linear Regression Algorithm
trends.
Use market basket analysis to determine product Microsoft Decision Trees Algorithm
placement.
Create patient risk profiles groups based on attributes such Microsoft Sequence Clustering Algorithm
as demographics and behaviors.
Related Content
The following table provides links to learning resources for each of the data mining algorithms that are
provided in SQL Server Data Mining:
Basic algorithm description Explains what the algorithm does and how it works, and
outlines possible business scenarios where the algorithm
might be useful.
Data mining queries Provides multiple queries that you can use with each
model type. Examples include content queries that let you
learn more about the patterns in the model, and prediction
queries to help you build predictions based on those
patterns.
Association Model Query Examples
Related Tasks
TOPIC DESCRIPTION
Determine the algorithm used by a data mining model Query the Parameters Used to Create a Mining Model
View the content of a model using a generic table format Browse a Model Using the Microsoft Generic Content Tree
Viewer
Learn about how to set up your data and use algorithms Mining Structures (Analysis Services - Data Mining)
to create models
Mining Models (Analysis Services - Data Mining)
See Also
Data Mining Tools
Microsoft Association Algorithm
5/16/2018 • 5 minutes to read • Edit Online
As the diagram illustrates, the Microsoft Association algorithm can potentially find many rules within a dataset.
The algorithm uses two parameters, support and probability, to describe the itemsets and rules that it generates.
For example, if X and Y represent two items that could be in a shopping cart, the support parameter is the
number of cases in the dataset that contain the combination of items, X and Y. By using the support parameter in
combination with the user-defined parameters, MINIMUM_SUPPORT and MAXIMUM_SUPPORT, the algorithm
controls the number of itemsets that are generated. The probability parameter, also named confidence, represents
the fraction of cases in the dataset that contain X and that also contain Y. By using the probability parameter in
combination with the MINIMUM_PROBABILITY parameter, the algorithm controls the number of rules that are
generated.
Example
The Adventure Works Cycle company is redesigning the functionality of its Web site. The goal of the redesign is
to increase sell-through of products. Because the company records each sale in a transactional database, they can
use the Microsoft Association algorithm to identify sets of products that tend to be purchased together. They can
then predict additional items that a customer might be interested in, based on items that are already in the
customer's shopping basket.
Creating Predictions
After the model has been processed, you can use the rules and itemsets to make predictions. In an association
model, a prediction tells you what item is likely to occur given the presence of the specified item, and the
prediction can include such information as the probability, the support, or the importance. For examples of how to
create queries against an association model, see Association Model Query Examples.
For general information about how to create a query against a data mining model, see Data Mining Queries.
Performance
The process of creating itemsets and counting correlations can be time-consuming. Although the Microsoft
Association Rules algorithm uses optimization techniques to save space and make processing faster, you should
know that performance issues can occur under conditions such as the following:
Data set is large with many individual items.
Minimum itemset size is set too low.
To minimize processing time and reduce the complexity of the itemsets, you might try grouping related items by
categories before you analyze the data.
Remarks
Does not support the use of Predictive Model Markup Language (PMML ) to create mining models.
Supports drillthrough.
Supports the use of OLAP mining models.
Supports the creation of data mining dimensions.
See Also
Data Mining Algorithms (Analysis Services - Data Mining)
Browse a Model Using the Microsoft Association Rules Viewer
Mining Model Content for Association Models (Analysis Services - Data Mining)
Microsoft Association Algorithm Technical Reference
Association Model Query Examples
Microsoft Association Algorithm Technical Reference
11/28/2018 • 8 minutes to read • Edit Online
NOTE
You cannot change the parameters in an existing model by using a DMX statement; you must specify the parameters in
the DMX CREATE MODEL or ALTER STRUCTURE... ADD MODEL when you create the model.
MAXIMUM_ITEMSET_COUNT
Specifies the maximum number of itemsets to produce. If no number is specified, the default value is used.
The default is 200000.
NOTE
Itemsets are ranked by support. Among itemsets that have the same support, ordering is arbitrary.
MAXIMUM_ITEMSET_SIZE
Specifies the maximum number of items that are allowed in an itemset. Setting this value to 0 specifies that
there is no limit to the size of the itemset.
The default is 3.
NOTE
Decreasing this value can potentially reduce the time that is required for creating the model, because processing of the
model stops when the limit is reached.
MAXIMUM_SUPPORT
Specifies the maximum number of cases that an itemset has for support. This parameter can be used to
eliminate items that appear frequently and therefore potentially have little meaning.
If this value is less than 1, the value represents a percentage of the total cases. Values greater than 1 represent
the absolute number of cases that can contain the itemset.
The default is 1.
MINIMUM_ITEMSET_SIZE
Specifies the minimum number of items that are allowed in an itemset. If you increase this number, the model
might contain fewer itemsets. This can be useful if you want to ignore single-item itemsets, for example.
The default is 1.
NOTE
You cannot reduce model processing time by increasing the minimum value, because Analysis Services must calculate
probabilities for single items anyway as part of processing. However, by setting this value higher you can filter out smaller
itemsets.
MINIMUM_PROBABILITY
Specifies the minimum probability that a rule is true.
For example, if you set this value to 0.5, it means that no rule with less than fifty percent probability can be
generated.
The default is 0.4.
MINIMUM_SUPPORT
Specifies the minimum number of cases that must contain the itemset before the algorithm generates a rule.
If you set this value to less than 1, the minimum number of cases is calculated as a percentage of the total cases.
If you set this value to a whole number greater than 1, specifies the minimum number of cases is calculated as a
count of cases that must contain the itemset. The algorithm might automatically increase the value of this
parameter if memory is limited.
The default is 0.03. This means that to be included in the model, an itemset must be found in at least 3% of cases.
OPTIMIZED_PREDICTION_COUNT
Defines the number of items to be cached for optimizing prediction.
The default value is 0. When the default is used, the algorithm will produce as many predictions as requested in
the query.
If you specify a nonzero value for OPTIMIZED_PREDICTION_COUNT, prediction queries can return at most the
specified number of items, even if you request additional predictions. However, setting a value can improve
prediction performance.
For example, if the value is set to 3, the algorithm caches only 3 items for prediction. You cannot see additional
predictions that might be equally probable to the 3 items that are returned.
Modeling Flags
The following modeling flags are supported for use with the Microsoft Association Rules algorithm.
NOT NULL
Indicates that the column cannot contain a null. An error will result if Analysis Services encounters a null during
model training.
Applies to the mining structure column.
MODEL_EXISTENCE_ONLY
Means that the column will be treated as having two possible states: Missing and Existing. A null is a missing
value.
Applies to the mining model column.
Requirements
An association model must contain a key column, input columns, and a single predictable column.
Input and Predictable Columns
The Microsoft Association Rules algorithm supports the specific input columns and predictable columns that are
listed in the following table. For more information about the meaning of content types in a mining model, see
Content Types (Data Mining).
NOTE
Cyclical and Ordered content types are supported, but the algorithm treats them as discrete values and does not perform
special processing.
See Also
Microsoft Association Algorithm
Association Model Query Examples
Mining Model Content for Association Models (Analysis Services - Data Mining)
Mining Model Content for Association Models
(Analysis Services - Data Mining)
5/16/2018 • 6 minutes to read • Edit Online
Each itemset is contained in its own node (NODE_TYPE = 7). The node includes the definition of the itemset, the
number of cases that contain this itemset, and other information.
Each rule is also contained in its own node (NODE_TYPE = 8). A rule describes a general pattern for how items
are associated. A rule is like an IF -THEN statement. The left-hand side of the rule shows an existing condition or
set of conditions. The right-hand side of the rule shows the item in your data set that is usually associated with the
conditions on the left side.
Note If you want to extract either the rules or the itemsets, you can use a query to return only the node types that
you want. For more information, see Association Model Query Examples.
or
Gender = Male .
Example:
NODE_CAPTION
A label or a caption associated with the node.
Itemset node A comma-separated list of items.
Rule node Contains the left and right-hand sides of the rule.
CHILDREN_CARDINALITY
Indicates the number of children of the current node.
Parent node Indicates the total number of itemsets plus rules.
NOTE
To get a breakdown of the count for itemsets and rules, see the NODE_DESCRIPTION for the root node of the model.
Note This value might differ from the value that you set for
the MINIMUM _SUPPORT parameter.
Note This value might differ from the value that you set for
the MAXIMUM_SUPPORT parameter.
MAX_ITEMSET_SIZE Indicates the size of the largest itemset that was found.
Note This value is constrained by the value that you set for
the MAX_ITEMSET_SIZE parameter when you created the
model. This value can never exceed that value; however, it can
be less. The default value is 3.
Example: 0.400390625
Note For itemsets, this value is always greater than the value
that you set for the MINIMUM_PROBABILITY parameter when
you created the model.
Example: 1
MIN_LIFT The minimum amount of lift that is provided by the model for
any itemset.
Example: 0.14309369632511
Itemset node Itemset nodes contain a list of the items, displayed as a comma-separated text string.
Example:
Touring Tire = Existing, Water Bottle = Existing
This means touring tires and water bottles were purchased together.
Rule node Rule nodes contains a left-hand and right-hand side of the rule, separated by an arrow.
Example: Touring Tire = Existing, Water Bottle = Existing -> Cycling cap = Existing
This means that if someone bought a touring tire and a water bottle, they were also likely to buy a cycling cap.
NODE_RULE
An XML fragment that describes the rule or itemset that is embedded in the node.
Parent node Blank.
Itemset node Blank.
Rule node The XML fragment includes additional useful information about the rule, such as support, confidence,
and the number of items, and the ID of the node that represents the left-hand side of the rule.
MARGINAL_RULE
Blank.
NODE_PROBABILITY
A probability or confidence score associated with the itemset or rule.
Parent node Always 0.
Itemset node Probability of the itemset.
Rule node Confidence value for the rule.
MARGINAL_PROBABILITY
Same as NODE_PROBABILITY.
NODE_DISTRIBUTION
The table contains very different information, depending on whether the node is an itemset or a rule.
Parent node Blank.
Itemset node Lists each item in the itemset together with a probability and support value. For example, if the
itemset contains two products, the name of each product is listed, together with the count of cases that include
each product.
Rule node Contains two rows. The first row shows the attribute from the right-hand side of the rule, which is the
predicted item, together with a confidence score.
The second row is unique to association models; it contains a pointer to the itemset on the right-hand side of the
rule. The pointer is represented in the ATTRIBUTE_VALUE column as the ID of the itemset that contains only the
right-hand item.
For example, if the rule is If {A,B} Then {C} , the table contains the name of the item {C} , and the ID of the node
that contains the itemset for item C.
This pointer is useful because you can determine from the itemset node how many cases in all include the right-
hand side product. The cases that are subject to the rule If {A,B} Then {C} are a subset of the cases listed in the
itemset for {C} .
NODE_SUPPORT
The number of cases that support this node.
Parent node Number of cases in the model.
Itemset node Number of cases that contains all items in the itemset.
Rule node The number of cases that contain all items included in the rule.
MSOLAP_MODEL_COLUMN
Contains different information depending on whether the node is an itemset or rule.
Parent node Blank.
Itemset node Blank.
Rule node The ID of the itemset that contains the items in the left-hand side of the rule. For example, if the rule is
If {A,B} Then {C} , this column contains the ID of the itemset that contains only {A,B} .
MSOLAP_NODE_SCORE
Parent node Blank.
Itemset node Importance score for the itemset.
Rule node Importance score for the rule.
NOTE
Importance is calculated differently for itemsets and rules. For more information, see Microsoft Association Algorithm
Technical Reference.
MSOLAP_NODE_SHORT_CAPTION
Blank.
See Also
Mining Model Content (Analysis Services - Data Mining)
Microsoft Association Algorithm
Association Model Query Examples
Association Model Query Examples
11/28/2018 • 7 minutes to read • Edit Online
NOTE
You must enclose the name of the column, CHILDREN_CARDINALITY, in brackets to distinguish it from the MDX reserved
keyword of the same name.
Example results:
MODEL_NAME Association
NODE_SUPPORT 14879
CHILDREN_CARDINALITY 942
For a definition of what these columns mean in an association model, see Mining Model Content for Association
Models (Analysis Services - Data Mining).
Return to Top
Sample Query 2: Getting Additional Metadata from the Schema Rowset
By querying the data mining schema rowset, you can find the same information that is returned in a DMX
content query. However, the schema rowset provides some additional columns, such as the date the model was
last processed, the mining structure, and the name of the column used as the predictable attribute.
Example results:
MODEL_NAME Association
MINING_STRUCTURE Association
Return to Top
Sample Query 3: Retrieving Original Parameters for Model
The following query returns a single column that contains details about the parameter settings that were used
when the model was created.
SELECT MINING_PARAMETERS
from $system.DMSCHEMA_MINING_MODELS
WHERE MODEL_NAME = 'Association'
Example results:
MAXIMUM_ITEMSET_COUNT=200000,MAXIMUM_ITEMSET_SIZE=3,MAXIMUM_SUPPORT=1,MINIMUM_
SUPPORT=9.40923449156529E -04,MINIMUM_IMPORTANCE=-
999999999,MINIMUM_ITEMSET_SIZE=0,MINIMUM_PROBABILITY=0.4
Return to Top
Example results:
NODE_NAME 37
NODE_PROBABILITY 0.291283016331743
NODE_SUPPORT 4334
Return to Top
Sample Query 5: Returning Top 10 Itemsets
This example demonstrates how to use some of the grouping and ordering functions that DMX provides by
default. The query returns the top 10 itemsets when ordered by the support for each node. Note that you do not
need to explicitly group the results, as you would in Transact-SQL; however, you can use only one aggregate
function in each query.
Example results:
NODE_SUPPORT 4334
NODE_NAME 37
Return to Top
SELECT PredictAssociation([Association].[vAssocSeqLineItems],INCLUDE_STATISTICS, 3)
FROM [Association]
NATURAL PREDICTION JOIN
(SELECT
(SELECT 'Classic Vest' as [Model])
AS [v Assoc Seq Line Items])
AS t
Example results:
Return to Top
Sample Query 7: Determining Confidence for Related Itemsets
Whereas rules are useful for generating recommendations, itemsets are more interesting for deeper analysis of
the patterns in the data set. For example, if you were not satisfied with the recommendation that are returned by
the previous sample query, you could examine other itemsets that contain Product A, to can get a better idea of
whether Product A is an accessory that people tend to buy with all kinds of products, or whether A is strongly
correlated with purchases of particular products. The easiest way to explore these relationships is by filtering the
itemsets in the Microsoft Association Viewer; however, you can retrieve the same information with a query.
The following sample query returns all itemsets that include the Water Bottle item, including the single item
Water bottle.
Example results:
Mountain Bottle Cage = Existing, 1136 v Assoc Seq Line Items(Water Bottle)
Water Bottle = Existing
Road Bottle Cage = Existing, Water 1068 v Assoc Seq Line Items(Water Bottle)
Bottle = Existing
Water Bottle = Existing, Sport-100 = 734 v Assoc Seq Line Items(Water Bottle)
Existing
This query returns both the rows from the nested table that match the criteria, and all the rows from the outside
or case table. Therefore, you must add a condition that eliminates the case table rows that have a null value for
the target attribute name.
Return to Top
Function List
All Microsoft algorithms support a common set of functions. However, the Microsoft Association algorithm
supports the additional functions listed in the following table.
Prediction Function Usage
IsInNode (DMX) Indicates whether the specified node contains the current
case.
See Also
Microsoft Association Algorithm
Microsoft Association Algorithm Technical Reference
Mining Model Content for Association Models (Analysis Services - Data Mining)
Microsoft Clustering Algorithm
5/16/2018 • 4 minutes to read • Edit Online
The clustering algorithm differs from other data mining algorithms, such as the Microsoft Decision Trees
algorithm, in that you do not have to designate a predictable column to be able to build a clustering model. The
clustering algorithm trains the model strictly from the relationships that exist in the data and from the clusters
that the algorithm identifies.
Example
Consider a group of people who share similar demographic information and who buy similar products from the
Adventure Works company. This group of people represents a cluster of data. Several such clusters may exist in a
database. By observing the columns that make up a cluster, you can more clearly see how records in a dataset are
related to one another.
After first defining the clusters, the algorithm calculates how well the clusters represent groupings of the points,
and then tries to redefine the groupings to create clusters that better represent the data. The algorithm iterates
through this process until it cannot improve the results more by redefining the clusters.
You can customize the way the algorithm works by selecting a specifying a clustering technique, limiting the
maximum number of clusters, or changing the amount of support required to create a cluster. For more
information, see Microsoft Clustering Algorithm Technical Reference. this algorithm includes two popular
clustering methods: K-means clustering and the Expectation Maximization method.
Creating Predictions
After the model has been trained, the results are stored as a set of patterns, which you can explore or use to make
predictions.
You can create queries to return predictions about whether new data fits into the clusters that were discovered, or
to obtain descriptive statistics about the clusters.
For information about how to create queries against a data mining model, see Data Mining Queries. For
examples of how to use queries with a clustering model, see Clustering Model Query Examples.
Remarks
Supports the use of Predictive Model Markup Language (PMML ) to create mining models.
Supports drillthrough.
Supports the use of OLAP mining models and the creation of data mining dimensions.
See Also
Data Mining Algorithms (Analysis Services - Data Mining)
Microsoft Clustering Algorithm Technical Reference
Mining Model Content for Clustering Models (Analysis Services - Data Mining)
Clustering Model Query Examples
Microsoft Clustering Algorithm Technical Reference
5/16/2018 • 9 minutes to read • Edit Online
NOTE
The Microsoft Clustering algorithm does not expose the distance function used in computing k-means, and measures of
distance are not available in the completed model. However, you can use a prediction function to return a value that
corresponds to distance, where distance is computed as the probability of a data point belonging to the cluster. For more
information, see ClusterProbability (DMX).
The k-means algorithm provides two methods of sampling the data set: non-scalable K-means, which loads the
entire data set and makes one clustering pass, or scalable k-means, where the algorithm uses the first 50,000
cases and reads more cases only if it needs more data to achieve a good fit of model to data.
Updates to the Microsoft Clustering Algorithm in SQL Server 2008
In SQL Server 2008, the default configuration of the Microsoft clustering algorithm was changed to use the
internal parameter, NORMALIZATION = 1. Normalization is performed using z-score statistics, and assumes
normal distribution. The intent of this change in the default behavior is to minimize the effect of attributes that
might have large magnitudes and many outliers. However, z-score normalization may alter the clustering results
on distributions that are not normal (such as uniform distributions). To prevent normalization and obtain the
same behavior as the K-means clustering algorithm in SQL Server 2005, you can use the Parameter Settings
dialog box to add the custom parameter, NORMALIZATION, and set its value to 0.
NOTE
The NORMALIZATION parameter is an internal property of the Microsoft Clustering algorithm and is not supported. In
general, the use of normalization is recommended in clustering models to improve model results.
Customizing the Microsoft Clustering Algorithm
The Microsoft Clustering algorithm supports several parameters that affect the behavior, performance, and
accuracy of the resulting mining model.
Setting Algorithm Parameters
The following table describes the parameters that can be used with the Microsoft Clustering algorithm. These
parameters affect both the performance and accuracy of the resulting mining model.
CLUSTERING_METHOD
Specifies the clustering method for the algorithm to use. The following clustering methods are available:
ID METHOD
1 Scalable EM
2 Non-scalable EM
3 Scalable K-Means
4 Non-scalable K-Means.
NOTE
If you use EM, which is the default clustering method, some clusters may have a support value that is lower than the
specified value. This is because each case is evaluated for its membership in all possible clusters, and for some clusters
there may be only minimal support.
The default is 1.
MODELLING_CARDINALITY
Specifies the number of sample models that are constructed during the clustering process.
Reducing the number of candidate models can improve performance at the risk of missing some good candidate
models.
The default is 10.
STOPPING_TOLERANCE
Specifies the value that is used to determine when convergence is reached and the algorithm is finished building
the model. Convergence is reached when the overall change in cluster probabilities is less than the ratio of the
STOPPING_TOLERANCE parameter divided by the size of the model.
The default is 10.
SAMPLE_SIZE
Specifies the number of cases that the algorithm uses on each pass if the CLUSTERING_METHOD parameter is
set to one of the scalable clustering methods. Setting the SAMPLE_SIZE parameter to 0 will cause the whole
dataset to be clustered in a single pass. Loading the entire dataset in a single pass can cause memory and
performance issues.
The default is 50000.
MAXIMUM_INPUT_ATTRIBUTES
Specifies the maximum number of input attributes that the algorithm can handle before it invokes feature
selection. Setting this value to 0 specifies that there is no maximum number of attributes.
Increasing the number of attributes can significantly degrade performance.
The default is 255.
MAXIMUM_STATES
Specifies the maximum number of attribute states that the algorithm supports. If an attribute has more states
than the maximum, the algorithm uses the most popular states and ignores the remaining states.
Increasing the number of states can significantly degrade performance.
The default is 100.
Modeling Flags
The algorithm supports the following modeling flags. You define modeling flags when you create the mining
structure or mining model. The modeling flags specify how values in each column are handled during analysis.
NOT NULL The column cannot contain a null. An error will result if
Analysis Services encounters a null during model training.
Requirements
A clustering model must contain a key column and input columns. You can also define input columns as being
predictable. Columns set to Predict Only are not used to build clusters. The distribution of these values in the
clusters are calculated after the clusters are built.
Input and Predictable Columns
The Microsoft Clustering algorithm supports the specific input columns and predictable columns that are listed
in the following table. For more information about what the content types mean when used in a mining model,
see Content Types (Data Mining).
NOTE
Cyclical and Ordered content types are supported, but the algorithm treats them as discrete values and does not perform
special processing.
See Also
Microsoft Clustering Algorithm
Clustering Model Query Examples
Mining Model Content for Clustering Models (Analysis Services - Data Mining)
Mining Model Content for Clustering Models
(Analysis Services - Data Mining)
5/16/2018 • 5 minutes to read • Edit Online
Each child node represents a single cluster and contains detailed statistics about the attributes of the cases in that
cluster. This includes a count of the number of cases in the cluster, and the distribution of values that distinguish
the cluster from other clusters.
NOTE
You do not need to iterate through the nodes to get a count or description of the clusters; the model parent node also
counts and lists the clusters.
The parent node contains useful statistics that describe the actual distribution of all the training cases. These
statistics are found in the nested table column, NODE_DISTRIBUTION. For example, the following table shows
several rows from the NODE_DISTRIBUTION table that describe the distribution of customer demographics for
the clustering model, TM_Clustering , that you create in the Basic Data Mining Tutorial:
From these results, you can see that there were 12939 cases used to build the model, that the ratio of males to
females was about 50-50, and that the mean age was 44. The descriptive statistics vary depending on whether
the attribute being reported is a continuous numeric data type, such as age, or a discrete value type, such as
gender. The statistical measures mean and variance are computed for continuous data types, whereas probability
and support are computed for discrete data types.
NOTE
The variance represents the total variance for the cluster. When the value for variance is small, it indicates that most values
in the column were fairly close to the mean. To obtain the standard deviation, calculate the square root of the variance.
Note that for each of the attributes there is a Missing value type that tells you how many cases had no data for
that attribute. Missing data can be significant and affects calculations in different ways, depending on the data
type. For more information, see Missing Values (Analysis Services - Data Mining).
NODE_CAPTION
A friendly name for display purposes. When you create a model, the value of NODE_UNIQUE_NAME is
automatically used as the caption. However, you can change the value for NODE_CAPTION to update the display
name for the cluster, either programmatically or by using the viewer.
NOTE
When you reprocess the model, all name changes will be overwritten by the new values. You cannot persist names in the
model, or track changes in cluster membership between different versions of a model.
CHILDREN_CARDINALITY
An estimate of the number of children that the node has.
Parent node Indicates the number of clusters in the model.
Cluster nodes Always 0.
PARENT_UNIQUE_NAME
The unique name of the node's parent.
Parent node Always NULL
Cluster nodes Usually 000.
NODE_DESCRIPTION
A description of the node.
Parent node Always (All).
Cluster nodes A comma-separated list of the primary attributes that distinguish the cluster from other clusters.
NODE_RULE
Not used for clustering models.
MARGINAL_RULE
Not used for clustering models.
NODE_PROBABILITY
The probability associated with this node. Parent node Always 1.
Cluster nodes The probability represents the compound probability of the attributes, with some adjustments
depending on the algorithm used to create the clustering model.
MARGINAL_PROBABILITY
The probability of reaching the node from the parent node. In a clustering model, the marginal probability is
always the same as the node probability.
NODE_DISTRIBUTION
A table that contains the probability histogram of the node.
Parent node See the Introduction to this topic.
Cluster nodes Represents the distribution of attributes and values for cases that are included in this cluster.
NODE_SUPPORT
The number of cases that support this node. Parent node Indicates the number of training cases for the entire
model.
Cluster nodes Indicates the size of the cluster as a number of cases.
Note If the model uses K-Means clustering, each case can belong to only one cluster. However, if the model uses
EM clustering, each case can belong to different cluster, and the case is assigned a weighted distance for each
cluster to which it belongs. Therefore, for EM models the sum of support for an individual cluster is greater than
support for the overall model.
MSOLAP_MODEL_COLUMN
Not used for clustering models.
MSOLAP_NODE_SCORE
Displays a score associated with the node.
Parent node The Bayesian Information Criterion (BIC ) score for the clustering model.
Cluster nodes Always 0.
MSOLAP_NODE_SHORT_CAPTION
A label used for display purposes. You cannot change this caption.
Parent node The type of model: Cluster model
Cluster nodes The name of the cluster. Example: Cluster 1.
Remarks
Analysis Services provides multiple methods for creating a clustering model. If you do not know which method
was used to create the model that you are working with, you can retrieve the model metadata programmatically,
by using an ADOMD client or AMO, or by querying the data mining schema rowset. For more information, see
Query the Parameters Used to Create a Mining Model.
NOTE
The structure and content of the model stay the same, regardless of which clustering method or parameters you use.
See Also
Mining Model Content (Analysis Services - Data Mining)
Data Mining Model Viewers
Microsoft Clustering Algorithm
Data Mining Queries
Clustering Model Query Examples
5/16/2018 • 14 minutes to read • Edit Online
NOTE
You must enclose the name of the column, CHILDREN_CARDINALITY, in brackets to distinguish it from the
Multidimensional Expressions (MDX) reserved keyword of the same name.
Example results:
MODEL_CATALOG TM_Clustering
NODE_SUPPORT 12939
CHILDREN_CARDINALITY 10
NODE_DESCRIPTION All
For a definition of what these columns mean in a clustering model, see Mining Model Content for Clustering
Models (Analysis Services - Data Mining).
Return to Top
Sample Query 2: Retrieving Model Metadata from the Schema Rowset
By querying the data mining schema rowset, you can find the same information that is returned in a DMX
content query. However, the schema rowset provides some additional columns. These include the parameters
that were used when the model was created, the date and time that the model was last processed, and the owner
of the model.
The following example returns the date the model was created, modified, and last processed, together with the
clustering parameters that were used to build the model, and the size of the training set. This information can be
useful for documenting the model, or for determining which of the clustering options were used to create an
existing model.
Example results:
MODEL_NAME TM_Clustering
MINING_PARAMETERS CLUSTER_COUNT=10,
CLUSTER_SEED=0,
CLUSTERING_METHOD=1,
MAXIMUM_INPUT_ATTRIBUTES=255,
MAXIMUM_STATES=100,
MINIMUM_SUPPORT=1,
MODELLING_CARDINALITY=10,
SAMPLE_SIZE=50000,
STOPPING_TOLERANCE=10
Return to Top
Example results:
NODE_NAME 002
NODE_CAPTION Cluster 2
NODE_SUPPORT 1649
NODE_DESCRIPTION English Education=Graduate Degree , 32 <=Age <=48 ,
Number Cars Owned=0 , 35964.0771121808 <=Yearly
Income <=97407.7163393957 , English
Occupation=Professional , Commute Distance=2-5 Miles ,
Region=North America , Bike Buyer=1 , Number Children At
Home=0 , Number Cars Owned=1 , Commute Distance=0-1
Miles , English Education=Bachelors , Total Children=1 ,
Number Children At Home=2 , English Occupation=Skilled
Manual , Marital Status=S , Total Children=0 , House Owner
Flag=0 , Gender=F , Total Children=2 , Region=Pacific
The attributes that define the cluster can be found in two columns in the data mining schema rowset.
The NODE_DESCRIPTION column contains a comma-separated list of attributes. Note that the list of
attributes might be abbreviated for display purposes.
The nested table in the NODE_DISTRIBUTION column contains the full list of attributes for the cluster. If
your client does not support hierarchical rowsets, you can return the nested table by adding the
FLATTENED keyword before the SELECT column list. For more information about the use of the
FLATTENED keyword, see SELECT FROM <model>.CONTENT (DMX).
Return to Top
Sample Query 4: Returning Attributes for a Cluster
For every cluster, the Cluster Viewer displays a profile that lists the attributes and their values. The viewer also
displays a histogram that shows the distribution of values for the whole population of cases in the model. If you
are browsing the model in the viewer, you can easily copy the histogram from the Mining Legend and then paste
it to Excel or a Word document. You can also use the Cluster Characteristics pane of the viewer to graphically
compare the attributes of different clusters.
However, if you must obtain values for more than one cluster at a time, it is easier to query the model. For
example, when you browse the model, you might notice that the top two clusters differ with regard to one
attribute, Number Cars Owned . Therefore, you want to extract the values for each cluster.
The first line of the code specifies that you want only the top two clusters.
NOTE
By default, the clusters are ordered by support. Therefore, the NODE_SUPPORT column can be omitted.
The second line of the code adds a sub-select statement that returns only certain columns from the nested table
column. Furthermore, it restricts the rows from the nested table to those related to the target attribute,
Number Cars Owned . To simplify the display, the nested table is aliased.
NOTE
The nested table column, PROBABILITY , must be enclosed in brackets because it is also the name of a reserved MDX
keyword.
Example results:
001 2 0.829207754
001 1 0.109354156
001 3 0.034481552
001 4 0.013503302
001 0 0.013453236
001 Missing 0
002 0 0.576980023
002 1 0.406623939
002 2 0.016380082
002 3 1.60E-05
002 4 0
002 Missing 0
Return to Top
Sample Query 5: Return a Cluster Profile Using System Stored Procedures
As a shortcut, rather than writing your own queries by using DMX, you can also call the system stored
procedures that Analysis Services uses to work with clusters. The following example illustrates how to use the
internal stored procedures to return the profile for a cluster with the ID of 002.
CALL System.Microsoft.AnalysisServices.System.DataMining.Clustering.GetClusterProfiles('TM_Clustering",
'002',0.0005
Similarly, you can use a system stored procedure to return the characteristics of a specific cluster, as shown in the
following example:
CALL
System.Microsoft.AnalysisServices.System.DataMining.Clustering.GetClusterCharacteristics('TM_Clustering",
'009',0.0005
Example results:
ATTRIBUTES VALUES FREQUENCY SUPPORT
NOTE
The data mining system stored procedures are for internal use and Microsoft reserves the right to change them as needed.
For production use, we recommend that you create queries by using DMX, AMO, or XMLA.
Return to Top
Sample Query 6: Find Discriminating Factors for a Cluster
The Cluster Discrimination tab of the Cluster Viewer enables you to easily compare a cluster with another
cluster, or compare a cluster with all remaining cases (the complement of the cluster).
However, creating queries to return this information can be complex, and you might need some additional
processing on the client to store the temporary results and compare the results of two or more queries. As a
shortcut, you can use the system stored procedures.
The following query returns a single table that indicates the primary discriminating factors between the two
clusters that have the node IDs of 009 and 007. Attributes with positive values favor cluster 009, whereas
attributes with negative values favor cluster 007.
CALL
System.Microsoft.AnalysisServices.System.DataMining.Clustering.GetClusterDiscrimination('TM_Clustering','009'
,'007',0.0005,true)
Example results:
This is the same information that is presented in the chart of the Cluster Discrimination viewer if you select
Cluster 9 from the first drop-down list and Cluster 7 from the second drop-down list. To compare cluster 9 with
its complement, you use the empty string in the second parameter, as shown in the following example:
CALL
System.Microsoft.AnalysisServices.System.DataMining.Clustering.GetClusterDiscrimination('TM_Clustering','009'
,'',0.0005,true)
NOTE
The data mining system stored procedures are for internal use and Microsoft reserves the right to change them as needed.
For production use, we recommend that you create queries by using DMX, AMO, or XMLA.
Return to Top
Sample Query 7: Returning Cases that Belong to a Cluster
If drillthrough has been enabled on the mining model, you can create queries that return detailed information
about the cases used in the model. Moreover, if drillthrough has been enabled on the mining structure, you can
include columns from the underlying structure by using the StructureColumn (DMX) function.
The following example returns two columns that were used in the model, Age and Region, and one more column,
First Name, that was not used in the model. The query returns only cases that were classified into Cluster 1.
To return the cases that belong to a cluster, you must know the ID of the cluster. You can obtain the ID of the
cluster by browsing the model in one of the viewers. Or, you can rename a cluster for easier reference, after
which you could use the name in place of an ID number. However, know that the names that you assign to a
cluster will be lost if the model is reprocessed.
Return to Top
1 0.592924735740338
Example of results when the usage is set to PredictOnly and the model is reprocessed:
1 0.55843544003102
In this example, the difference in the model is not significant. However, sometimes it can be important to detect
differences between the actual distribution of values and what the model predicts. The PredictCaseLikelihood
(DMX) function is useful in this scenario, because it tells you how likely a case is, given the model.
The number that is returned by the PredictCaseLikelihood function is a probability, and therefore is always
between 0 and 1, with a value of .5 representing random outcome. Therefore, a score less than .5 means that the
predicted case is unlikely, given the model, and a score over.5 indicates that the predicted case is more likely than
not to fit the model.
For example, the following query returns two values that characterize the likelihood of a new sample case. The
non-normalized value represents the probability given the current model. When you use the NORMALIZED
keyword, the likelihood score that is returned by the function is adjusted by dividing "probability with the model"
by "probability without the model".
SELECT
PredictCaseLikelihood(NORMALIZED) AS [NormalizedValue], PredictCaseLikelihood(NONNORMALIZED) AS
[NonNormalizedValue]
FROM
[TM_Clustering_PredictOnly]
NATURAL PREDICTION JOIN
(SELECT 40 AS [Age],
'F' AS [Gender]) AS t
Example results:
NORMALIZEDVALUE NONNORMALIZEDVALUE
5.56438372679893E-11 8.65459953145182E-68
Note that the numbers in these results are expressed in scientific notation.
Return to Top
Sample Query 9: Determining Cluster Membership
This example uses the Cluster (DMX) function to return the cluster to which the new case is most likely to belong,
and uses the ClusterProbability (DMX) function to return the probability for membership in that cluster.
SELECT Cluster(), ClusterProbability()
FROM
[TM_Clustering]
NATURAL PREDICTION JOIN
(SELECT 40 AS [Age],
'F' AS [Gender],
'S' AS [Marital Status]) AS t
Example results:
$CLUSTER EXPRESSION
Cluster 2 0.397918596951617
Note By default, the ClusterProbability function returns the probability of the most likely cluster. However, you
can specify a different cluster by using the syntax ClusterProbability('cluster name') . If you do this, be aware
that the results from each prediction function are independent of the other results. Therefore, the probability
score in the second column could refer to a different cluster than the cluster named in the first column.
Return to Top
Sample Query 10: Returning All Possible Clusters with Probability and Distance
In the previous example, the probability score was not very high. To determine if there is a better cluster, you can
use the PredictHistogram (DMX) function together with the Cluster (DMX) function to return a nested table that
includes all possible clusters, together with the probability that the new case that belongs to each cluster. The
FLATTENED keyword is used to change the hierarchical rowset into a flat table for easier viewing.
Cluster 8 1 0
By default, the results are ranked by probability. The results tell you that, even though the probability for Cluster
2 is fairly low, Cluster 2 is still the best fit for the new data point.
Note The additional column, $DISTANCE , represents the distance from the data point to the cluster. By default, the
Microsoft Clustering Algorithm uses scalable EM clustering, which assigns multiple clusters to each data point
and ranks the possible clusters. However, if you create your clustering model using the K-means algorithm, only
one cluster can be assigned to each data point, and this query would return only one row. Understanding these
differences is necessary to interpret the results of the PredictCaseLikelihood (DMX) function. For more
information about the differences between EM and K-means clustering, see Microsoft Clustering Algorithm
Technical Reference.
Return to Top
Function List
All Microsoft algorithms support a common set of functions. However, models that are built by using the
Microsoft Clustering algorithm support the additional functions that are listed in the following table.
Cluster (DMX) Returns the cluster that is most likely to contain the input
case.
ClusterDistance (DMX) Returns the distance of the input case from the specified
cluster, or if no cluster is specified, the distance of the input
case from the most likely cluster.
ClusterProbability (DMX) Returns the probability that the input case belongs to the
specified cluster.
IsInNode (DMX) Indicates whether the specified node contains the current
case.
PredictCaseLikelihood (DMX) Returns the likelihood that an input case will fit in the existing
model.
PredictStdev (DMX) Returns the predicted standard deviation for the specified
column.
For the syntax of specific functions, see Data Mining Extensions (DMX) Function Reference.
See Also
Data Mining Queries
Microsoft Clustering Algorithm Technical Reference
Microsoft Clustering Algorithm
Microsoft Decision Trees Algorithm
5/16/2018 • 7 minutes to read • Edit Online
Example
The marketing department of the Adventure Works Cycles company wants to identify the characteristics of
previous customers that might indicate whether those customers are likely to buy a product in the future. The
AdventureWorks2012 database stores demographic information that describes previous customers. By using the
Microsoft Decision Trees algorithm to analyze this information, the marketing department can build a model that
predicts whether a particular customer will purchase products, based on the states of known columns about that
customer, such as demographics or past buying patterns.
The correlation that is shown in the diagram would cause the Microsoft Decision Trees algorithm to create a new
node in the model.
As the algorithm adds new nodes to a model, a tree structure is formed. The top node of the tree describes the
breakdown of the predictable column for the overall population of customers. As the model continues to grow,
the algorithm considers all columns.
Predicting Continuous Columns
When the Microsoft Decision Trees algorithm builds a tree based on a continuous predictable column, each node
contains a regression formula. A split occurs at a point of non-linearity in the regression formula. For example,
consider the following diagram.
In a standard regression model, you would attempt to derive a single formula that represents the trend and
relationships for the data as a whole. However, a single formula might do a poor job of capturing the
discontinuity in complex data. Instead, the Microsoft Decision Trees algorithm looks for segments of the tree that
are largely linear and creates separate formulas for these segments. By breaking up the data into different
segments, the model can do a much better job of approximating the data.
The following diagram represents the tree diagram for the model in the scatterplot above. To predict the
outcome, the model provides two different formulas: one for the left branch, with the formula y = .5x x 5, and one
for the right branch, with the formula y = .25x + 8.75. The point where the two lines come together in the
scatterplot is the point of non-linearity, and is the point where a node in a decision tree model would split.
This is a simple model with only two linear equations; therefore, the split in the tree is immediately after the All
node. However, a split can occur at any level of the tree. That means that in a tree containing multiple levels and
nodes, where each node is characterized by a different collection of attributes, a formula might be shared across
multiple nodes, or apply only to a single node. For example, you might get one formula for a node defined as
"customers over a certain age and income", and another in a node that represents "customers who commute long
distances". To see the formula for an individual node or segment, just click the node.
Creating Predictions
After the model has been processed, the results are stored as a set of patterns and statistics, which you can use to
explore relationships or make predictions.
For examples of queries to use with a decision trees model, see Decision Trees Model Query Examples.
For general information about how to create queries against mining models, see Data Mining Queries.
Remarks
Supports the use of Predictive Model Markup Language (PMML ) to create mining models.
Supports drillthrough.
Supports the use of OLAP mining models and the creation of data mining dimensions.
See Also
Data Mining Algorithms (Analysis Services - Data Mining)
Microsoft Decision Trees Algorithm Technical Reference
Decision Trees Model Query Examples
Mining Model Content for Decision Tree Models (Analysis Services - Data Mining)
Microsoft Decision Trees Algorithm Technical
Reference
5/16/2018 • 11 minutes to read • Edit Online
NOTE
You can use the data exploration tools available in SQL Server 2017 Integration Services (SSIS) to visualize the
distribution of values in your data and group your values appropriately before beginning data mining. For more
information, see Data Profiling Task and Viewer. You can also use the Data Mining Add-ins for Excel 2007, to
explore, group and relabel data in Microsoft Excel.
NOTE
The Microsoft Decision Trees algorithm is available in all editions of SQL Server; however, some advanced parameters for
customizing the behavior of the Microsoft Decision Trees algorithm are available for use only in specific editions of SQL
Server. For a list of features that are supported by the editions of SQL Server, see Features Supported by the Editions of
SQL Server 2012 (http://go.microsoft.com/fwlink/?linkid=232473).
NOTE
By setting this parameter, you force the algorithm to try to use the attribute as a regressor. However, whether the
attribute is actually used as a regressor in the final model depends on the results of analysis. You can find out which
columns were used as regressors by querying the model content.
ID NAME
1 Entropy
(default)
The default is 3.
Modeling Flags
The Microsoft Decision Trees algorithm supports the following modeling flags. When you create the mining
structure or mining model, you define modeling flags to specify how values in each column are handled during
analysis. For more information, see Modeling Flags (Data Mining).
MODEL_EXISTENCE_ONLY Means that the column will be treated as having two possible
states: Missing and Existing. A null is a missing value.
NOT NULL Indicates that the column cannot contain a null. An error will
result if Analysis Services encounters a null during model
training.
Requirements
A decision tree model must contain a key column, input columns, and at least one predictable column.
Input and Predictable Columns
The Microsoft Decision Trees algorithm supports the specific input columns and predictable columns that are
listed in the following table. For more information about what the content types mean when used in a mining
model, see Content Types (Data Mining).
NOTE
Cyclical and Ordered content types are supported, but the algorithm treats them as discrete values and does not perform
special processing.
See Also
Microsoft Decision Trees Algorithm
Decision Trees Model Query Examples
Mining Model Content for Decision Tree Models (Analysis Services - Data Mining)
Mining Model Content for Decision Tree Models
(Analysis Services - Data Mining)
5/16/2018 • 18 minutes to read • Edit Online
NOTE
If your model includes multiple trees, you can view only one tree at a time in the Microsoft Tree Viewer. However, in the
Generic Content Tree Viewer , all trees in the same model are displayed at the same time.
The tree for each predictable attribute contains information that describes how the input columns that you
choose affect the outcome of that particular predictable attribute. Each tree is headed by a node (NODE_TYPE =
9) that contains the predictable attribute, followed by a series of nodes (NODE_TYPE = 10) that represent the
input attributes. An attribute corresponds to either a case-level column or values of nested table columns, which
are generally the values in the Key column of the nested table.
Interior and leaf nodes represent split conditions. A tree can split on the same attribute multiple times. For
example, the TM_DecisionTree model might split on [Yearly Income] and [Number of Children], and then split
again on [Yearly Income] further down the tree.
The Microsoft Decision Trees algorithm can also contain linear regressions in all or part of the tree. If the
attribute that you are modeling is a continuous numeric data type, the model can create a regression tree node
(NODE_TYPE = 25) wherever the relationship between the attributes can be modeled linearly. In this case, the
node contains a regression formula.
However, if the predictable attribute has discrete values, or if numeric values have been bucketed or discretized,
the model always creates a classification tree (NODE_TYPE =2). A classification tree can have multiple branches
or interior tree nodes (NODE_TYPE =3) for each value of the attribute. However, the split is not necessarily on
each value of the attribute.
The Microsoft Decision Trees algorithm does not allow continuous data types as inputs; therefore, if any columns
have a continuous numeric data type, the values are discretized. The algorithm performs its own discretization at
the point of a split for all continuous attributes.
NOTE
Analysis Services automatically chooses a method for bucketing continuous attributes; however, you can control how
continuous values in the inputs are discretized by setting the content type of the mining structure column to Discretized
and then setting the DiscretizationBucketCount or DiscretizationMethod property.
Top
25 (Regression tree) Parent node for regression tree within the model. Labeled as
"All".
NODE_CAPTION
A friendly name for display purposes.
When you create a model, the value of NODE_UNIQUE_NAME is automatically used as the caption. However,
you can change the value for NODE_CAPTION to update the display name for the cluster, either
programmatically or by using the viewer. The caption is automatically generated by the model. The content of the
caption depends on the type of model, and the node type.
In a decision trees model, the NODE_CAPTION and the NODE_DESCRIPTION have different information,
depending on the level in the tree. For more information and examples, see Node Caption and Node Description.
CHILDREN_CARDINALITY
An estimate of the number of children that the node has.
Parent node Indicates the number of predictable attributes that were modeled. A tree is created for each
predictable attribute.
Tree node The All node for each tree tells you how many values were used for the target attribute.
If the target attribute is discrete, the value equals the number of distinct values plus 1 for the Missing
state.
If the predictable attribute is continuous, the value tells you how many buckets were used to model the
continuous attribute.
Leaf nodes Always 0.
PARENT_UNIQUE_NAME
The unique name of the node's parent. NULL is returned for any nodes at the root level.
NODE_DESCRIPTION
A description of the node.
In a decision trees model, the NODE_CAPTION and the NODE_DESCRIPTION have different information,
depending on the level in the tree.
For more information and examples, see Node Caption and Node Description.
NODE_RULE
An XML description of the rule that describes the path to the current node from its immediate parent node.
For more information and examples, see Node Rule and Marginal Rule.
MARGINAL_RULE
An XML description of the rule that describes the path from the model parent node to the current node.
For more information, see Node Rule and Marginal Rule.
NODE_PROBABILITY
The probability associated with this node.
For more information, see Probability.
MARGINAL_PROBABILITY
The probability of reaching the node from the parent node.
For more information, see Probability.
NODE_DISTRIBUTION
A table that contains the probability histogram of the node. The information in this table differs depending on
whether the predictable attribute is a continuous or discrete variable.
Model root node This table is empty.
(All) node Contains a summary for the model as a whole.
Interior node Contains aggregated statistics for its leaf nodes.
Leaf node Contains support and probability for the predicted outcomes given all the conditions in the path
leading to the current leaf node.
Regression node Contains regression formula that represents the relationship between the inputs and the
predictable attribute.
For more information, see Node Distribution for Discrete Attributes and Node Distribution for Continuous
Attributes.
NODE_SUPPORT
The number of cases that support this node.
MSOLAP_MODEL_COLUMN
Indicates the column that contains the predictable attribute.
MSOLAP_NODE_SCORE
Displays a score associated with the node. For more information, see Node Score.
MSOLAP_NODE_SHORT_CAPTION
A label used for display purposes.
Remarks
A decision trees model does not have a separate node that stores statistics for the entire model, unlike the
marginal statistics node found in a Naive Bayes or neural network model. Instead, the model creates a separate
tree for each predictable attribute, with an (All) node at the top of the tree. Each tree is independent of the others.
If your model contains only one predictable attribute, there is only one tree, and therefore only one (All) node.
Each tree that represents an output attribute is additionally subdivided into interior branches (NODE_TYPE = 3)
that represent splits. Each of these trees contains statistics about the distribution of the target attribute. In
addition, each leaf node (NODE_TYPE = 4) contains statistics that describe input attributes and their values,
together with the number of cases in support of each attribute-value pair. Therefore, in any branch of a decision
tree, you can view the probabilities or the distribution of data easily without having to query the source data.
Each level of the tree necessarily represents the sum of its immediate child nodes.
For examples of how to retrieve these statistics, see Decision Trees Model Query Examples.
Top
Example of Decision Tree Structure
To understand how a decision tree works, consider an example, such as the AdventureWorks bike buyer scenario.
Assuming that the predictable attribute is customer purchases, the decision trees algorithm tries to find one
column of data, among all the inputs that you provided, that most effectively detects the customers that are likely
to purchase a bike and those who are unlikely to buy a bike. For example, the model might find that Age is the
best indicator of purchasing behavior. Specifically, that the customers over the age of 30 are very likely to
purchase a bike, and all other customers are unlikely to make a purchase. In this scenario, the model creates a
split on the Age attribute. That means that the tree divides into two branches, one containing customers over the
age of 30, and the other containing customers under 30. The new branches are represented in the model
structure as two new interior trees (NODE_TYPE = 3).
For each branch, the model continues to look for additional attributes to use in differentiating customers. If there
is insufficient evidence in the data to continue creating subgroups of customers, the model stops building the
tree. The model will also stop building the tree whenever the number of cases in the node is too small to
continue, regardless of how good the split is, or if the value is null or missing. By stopping the growth of the tree
early, you prevent the model from training too closely to one particular set of data.
Each interior tree node contains leaf nodes that provide a breakdown of the outcomes given the current
classification results. For example, you might have an interior node that represents Age >= 30 and Gender =
Male. The node for this group shows you how many customers in this category purchased or did not purchase
something. For example, the classification might contain the following tree splits:
When you use a decision tree model for prediction, the model takes the attributes that you provide to it as
arguments and follows the path of the attributes down through the tree. In general, all predictions go to a leaf,
and the interior nodes are used only for classification.
A leaf node always has a NODE_TYPE of 4 (Distribution) and contains a histogram that tells the probability of
each outcome (purchase or not purchase) given the attributes you provide. For example, if you ask for a
prediction for a new customer who is a male over 60, the model will look up the corresponding node (Age > 30
and Gender = Male) and then return the probability for the outcome that you specify. These probabilities are
stored in the NODE_DISTRIBUTION table for the node.
If the predictable attribute is a continuous number, the algorithm tries to create a regression formula that models
the relationship between the predictable attribute and the inputs.
Top
Node Caption and Node Description
In a decision tree model, the node caption and node description contain similar information. However, the node
description is more complete and contains more information as you move closer to the leaf nodes. Both the node
caption and node description are localized strings.
NODE_CAPTION Displays the attribute that distinguishes that particular node
relative to the parent node. The node caption defines a sub-
segment of the population based the split condition. For
example, if the split was on [Age] and it was a three-way split,
the node captions for the three child nodes might be "[Age]
< 40", "40 <= [Age] < 50", "[Age] >= 50".
NODE_DESCRIPTION Contains a full list of the attributes that distinguish that node
from other nodes, starting from the model parent node. For
example, Product name = Apple and Color = Red.
Top
Node Rule and Marginal Rule
The NODE_RULE and MARGINAL_RULE columns contain the same information as the NODE_CAPTION and
NODE_DESCRIPTION columns, but represent the information as XML fragments. The node rule is an XML
version of the full path, whereas the marginal rule indicates the most recent split.
The attribute represented by the XML fragment can be either simple or complex. A simple attribute contains the
name of the model column, and the value of the attribute. If the model column contains a nested table, the nested
table attribute is represented as a concatenation of the table name, the key value, and the attribute.
NOTE
SQL Server Analysis Services supports version 2.0 of the PMML standard, with extensions to support the use of nested
table. If your data contains nested tables and you generate a PMML version of the model, all elements in the model that
include the predicates are marked as an extension.
Top
Node Distribution for Discrete Attributes
In a decision trees model, the NODE_DISTRIBUTION table contains useful statistics. However, the type of
statistics depends on whether the tree predicts a discrete or continuous attribute. This section describes the
meaning of the node distribution statistics for discrete attributes.
Attribute Name and Attribute Value
In a classification tree, the attribute name always contains the name of the predictable column. This value tells
you what the tree predicts. Because a single tree always represents a single predictable attribute, this value is
repeated throughout the tree.
For a discrete data type, the attribute value field lists the possible values of the predictable column, plus the
Missing value.
Support
The support value for each node tells you how many cases are included in this node. At the (All) level, you should
see the complete count of cases that were used to train the model. For each split in the tree, the support value is
the count of cases that were grouped into that node of the tree. The sum of cases in the leaf nodes necessarily
equals the count of cases in the parent node of the tree.
For nodes that represent continuous attributes, the presence of nulls in the data might lead to some
counterintuitive results. For example, if there are m cases, a mean value would be calculated as sum(all cases)/n,
where n is a number less than m, and m-n indicates the count of cases with missing values. Support is also
represented as n.
Probability
The probability associated with each node tells you the probability that any case in the whole data set would end
up in this particular node. Probability scores are computed both for the tree as a whole, and for the immediate
split.
For example, the following table shows a very simple model, with 100 cases.
PROBABILITY PROBABILITY
RELATIVE TO RELATIVE TO TOP
INTERIOR TREE CASES LEAF NODE CASES PARENT NODE NODE
A small adjustment is made in all models to account for possible missing values. For continuous attributes, each
value or range of values is represented as a state (for example, Age <30, Age = 30, and Age >30) and the
probabilities are calculated as follows: state exists (value = 1), some other state exists (value = 0), state is
Missing. For more information about how probabilities are adjusted to represent missing values, see Missing
Values (Analysis Services - Data Mining).
The probabilities for each node are calculated almost directly from the distribution, as follows:
Probability = (support for state + support for prior state) / (node support plus the prior node support)
Analysis Services uses probabilities for each node to compare the stored probability with the prior probability to
determine whether the path from the parent to the child node indicates a strong inference.
When making predictions, the probability of the distribution must be balanced with the probability of the node, to
smoothen the probabilities. For example, if a split in the tree separates cases by a ratio of 9000/1000, the tree is
very unbalanced. As a result, a prediction coming from the small branch should not carry the same weight as a
prediction coming from a branch with many cases.
Variance
Variance is a measure of how scattered values in a sample are, given an expected distribution. For discrete values,
the variance is 0 by definition.
For information about how variance is calculated for continuous values, see Mining Model Content for Linear
Regression Models (Analysis Services - Data Mining).
Value Type
The value type column provides information about the meaning of the numeric value provided in the other
columns in the NODE_DISTRIBUTION table. You can use the value type in queries to retrieve specific rows from
the nested tables. For examples, see Decision Trees Model Query Examples.
Of the types in the MiningValueType enumeration, the following are used in classification trees.
If the model includes a continuous predictable attribute, the tree might also contain value types that are unique to
regression formulas. For a list of the value types that are used in regression trees, see Mining Model Content for
Linear Regression Models (Analysis Services - Data Mining).
Node Score
The node score represents slightly different information at each level of the tree. In general, the score is a
numeric value that tells you how good a split was achieved by splitting on the condition. The value is represented
as a double, where a higher value is better.
By definition, the model node and all leaf nodes have a node score of 0.
For the (All) node that represents the top of each tree, the MSOLAP_NODE_SCORE column contains the best
split score in the whole tree.
For all other nodes in the tree (except leaf nodes), the score for each node represents the best split score for the
current node, minus the split score for the parent node. Typically, the split score for a parent node should always
be better than the split score on any one of its child nodes. That is because a decision trees model ideally splits on
the most important attributes first.
There are many ways of calculating a score for a split, depending on the algorithm parameter you choose. A
discussion of how the scores are calculated for each of the scoring methods is beyond the scope of this topic. For
more information, see "Learning Bayesian Networks: The Combination of Knowledge and Statistical Data", on
the Microsoft Research Web site.
NOTE
If you create a decision trees model that has both continuous and discrete predictable attributes, you will see completely
different scores in the (All) nodes that represent each tree type. Each model should be considered independently, and the
methods used for scoring regression are completely different from those used for scoring classification. The node score
values cannot be compared.
Top
For more information about regression nodes, see Mining Model Content for Linear Regression Models
(Analysis Services - Data Mining).
See Also
Mining Model Content (Analysis Services - Data Mining)
Data Mining Model Viewers
Data Mining Queries
Microsoft Decision Trees Algorithm
Decision Trees Model Query Examples
5/16/2018 • 9 minutes to read • Edit Online
select MINING_PARAMETERS
from $system.DMSCHEMA_MINING_MODELS
WHERE MODEL_NAME = 'TM_Decision Tree'
Sample results:
MINING_PARAMETERS
COMPLEXITY_PENALTY=0.5,
MAXIMUM_INPUT_ATTRIBUTES=255,MAXIMUM_OUTPUT_ATTRIBUTES=255,MINIMUM_SUPPORT=10,S
CORE_METHOD=4,SPLIT_METHOD=3,FORCE_REGRESSOR=
Sample Query 2: Returning Details about the Model Content by Using DMX
The following query returns some basic information about the decision trees that were created when you built
the model in the Basic Data Mining Tutorial. Each tree structure is stored in its own node. Because this model
contains a single predictable attribute, there is only one tree node. However, if you create an association model
by using the Decision Trees algorithm, there might be hundreds of trees, one for each product.
This query returns all the nodes of type 2, which are the top level nodes of a tree that represents a particular
predictable attribute.
NOTE
The column, CHILDREN_CARDINALITY, must be enclosed in brackets to distinguish it from the MDX reserved keyword of
the same name.
Example results:
CHILDREN_CARDINALIT
MODEL_NAME NODE_NAME NODE_CAPTION NODE_SUPPORT Y
What do these results tell you? In a decision trees model, the cardinality of a particular node tells you how many
immediate children that node has. The cardinality for this node is 5, meaning that the model divided the target
population of potential bike buyers into 5 subgroups.
The following related query returns the children for these five subgroups, together with the distribution of
attributes and values in the child nodes. Because statistics such as support, probability, and variance are stored in
the nested table, NODE_DISTRIBUTION, this example uses the FLATTENED keyword to output the nested table
columns.
NOTE
The nested table column, SUPPORT, must be enclosed in brackets to distinguish it from the reserved keyword of the same
name.
Example results:
From these results, you can tell that of the customers who bought a bike ([Bike Buyer] = 1), 1067 customers had
0 cars and 473 customers had 3 cars.
Sample Query 3: Retrieving Subtrees from the Model
Suppose you wanted to discover more about the customers who did buy a bike. You can view additional detail
for any of the sub-trees by using the IsDescendant (DMX) function in the query, as shown in the following
example. The query returns the count of bike purchasers by retrieving leaf nodes (NODE_TYPE = 4) from the
tree that contains customers who are over 42 years of age. The query restricts rows from the nested table to
those where Bike Buyer = 1.
Example results:
SELECT
[TM_DecisionTree].[Bike Buyer],
PredictHistogram([Bike Buyer]) as Results
From
[TM_DecisionTree]
PREDICTION JOIN
OPENQUERY([Adventure Works DW Multidimensional 2012],
'SELECT
[FirstName],
[LastName],
[MaritalStatus],
[Gender],
[YearlyIncome],
[TotalChildren],
[NumberChildrenAtHome],
[HouseOwnerFlag],
[NumberCarsOwned]
FROM
[dbo].[ProspectiveBuyer]
') AS t
ON
[TM_DecisionTree].[First Name] = t.[FirstName] AND
[TM_DecisionTree].[Last Name] = t.[LastName] AND
[TM_DecisionTree].[Marital Status] = t.[MaritalStatus] AND
[TM_DecisionTree].[Gender] = t.[Gender] AND
[TM_DecisionTree].[Yearly Income] = t.[YearlyIncome] AND
[TM_DecisionTree].[Total Children] = t.[TotalChildren] AND
[TM_DecisionTree].[Number Children At Home] = t.[NumberChildrenAtHome] AND
[TM_DecisionTree].[House Owner Flag] = t.[HouseOwnerFlag] AND
[TM_DecisionTree].[Number Cars Owned] = t.[NumberCarsOwned]
WHERE [Bike Buyer] = 1
AND PredictProbability([Bike Buyer]) >'.05'
By default, Analysis Services returns nested tables with the column label, Expression. You can change this label
by aliasing the column that is returned. If you do this, the alias (in this case, Results) is used as both the column
heading and as the value in the nested table. You must expand the nested table to see the results.
Example results with Bike Buyer = 1:
$ADJUSTEDPROBA
BIKE BUYER $SUPPORT $PROBABILITY BILITY $VARIANCE $STDEV
0 0.000166583374 0.000166583374 0 0
979177 979177
If your provider does not support hierarchical rowsets, such as those shown here, you can use the FLATTENED
keyword in the query to return the results as a table that contains nulls in place of the repeated column values.
For more information, see Nested Tables (Analysis Services - Data Mining) or Understanding the DMX Select
Statement.
Sample Query 5: Predicting Associations from a Decision Trees Model
The following sample query is based on the Association mining structure. To follow along with this example, you
can add a new model to this mining structure, and select Microsoft Decision Trees as the algorithm. For more
information on how to create the Association mining structure, see Lesson 3: Building a Market Basket Scenario
(Intermediate Data Mining Tutorial).
The following sample query is a singleton query, which you can create easily in SQL Server Data Tools (SSDT) by
choosing fields and then selecting values for those fields from a drop-down list.
Expected results:
MODEL
Mountain-200
The results tell you the three best products to recommend to customers who have purchased the Patch Kit
product. You can also provide multiple products as input when you make recommendations, either by typing in
values, or by using the Singleton Query Input dialog box and adding or removing values. The following
sample query shows how the multiple values are provided, upon which to make a prediction. Values are
connected by a UNION clause in the SELECT statement that defines the input values.
Expected results:
MODEL
Mountain-400-W
Classic Vest
Example results:
T.ATTRIBUTE_NA T.ATTRIBUTE_VAL
ME UE T.SUPPORT T.PROBABILITY T.VARIANCE T.VALUETYPE
57220.8876687 0 0 1041216662.543 11
257 87
For more information about the value types and the statistics used in regression models, see Mining Model
Content for Linear Regression Models (Analysis Services - Data Mining).
PredictStdev (DMX) Returns the predicted standard deviation for the specified
column.
For a list of the functions that are common to all Microsoft algorithms, see General Prediction Functions (DMX).
For the syntax of specific functions, see Data Mining Extensions (DMX) Function Reference.
See Also
Data Mining Queries
Microsoft Decision Trees Algorithm
Microsoft Decision Trees Algorithm Technical Reference
Mining Model Content for Decision Tree Models (Analysis Services - Data Mining)
Microsoft Linear Regression Algorithm
5/16/2018 • 4 minutes to read • Edit Online
Each data point in the diagram has an error associated with its distance from the regression line. The coefficients a
and b in the regression equation adjust the angle and location of the regression line. You can obtain the regression
equation by adjusting a and b until the sum of the errors that are associated with all the points reaches its
minimum.
There are other kinds of regression that use multiple variables, and also nonlinear methods of regression.
However, linear regression is a useful and well-known method for modeling a response to a change in some
underlying factor.
Example
You can use linear regression to determine a relationship between two continuous columns. For example, you can
use linear regression to compute a trend line from manufacturing or sales data. You could also use the linear
regression as a precursor to development of more complex data mining models, to assess the relationships
among data columns.
Although there are many ways to compute linear regression that do not require data mining tools, the advantage
of using the Microsoft Linear Regression algorithm for this task is that all the possible relationships among the
variables are automatically computed and tested. You do not have to select a computation method, such as solving
for least squares. However, linear regression might oversimplify the relationships in scenarios where multiple
factors affect the outcome.
Creating Predictions
After the model has been processed, the results are stored as a set of statistics together with the linear regression
formula, which you can use to compute future trends. For examples of queries to use with a linear regression
model, see Linear Regression Model Query Examples.
For general information about how to create queries against mining models, see Data Mining Queries.
In addition to creating a linear regression model by selecting the Microsoft Linear Regression algorithm, if the
predictable attribute is a continuous numeric data type, you can create a decision tree model that contains
regressions. In this case, the algorithm will split the data when it finds appropriate separation points, but for some
regions of data, will create a regression formula instead. For more information about regression trees within a
decision trees model, see Mining Model Content for Decision Tree Models (Analysis Services - Data Mining).
Remarks
Does not support the use of Predictive Model Markup Language (PMML ) to create mining models.
Does not support the creation of data mining dimensions.
Supports drillthrough.
Supports the use of OLAP mining models.
See Also
Data Mining Algorithms (Analysis Services - Data Mining)
Microsoft Linear Regression Algorithm Technical Reference
Linear Regression Model Query Examples
Mining Model Content for Linear Regression Models (Analysis Services - Data Mining)
Microsoft Linear Regression Algorithm Technical
Reference
5/16/2018 • 5 minutes to read • Edit Online
The algorithm parameters that control feature selection for a decision trees model are
MAXIMUM_INPUT_ATTRIBUTES and MAXIMUM_OUTPUT.
PARAMETER DESCRIPTION
MAXIMUM_INPUT_ATTRIBUTES Defines the number of input attributes that the algorithm can
handle before it invokes feature selection. Set this value to 0
to turn off feature selection.
Modeling Flags
The Microsoft Linear Regression algorithm supports the following modeling flags. When you create the mining
structure or mining model, you define modeling flags to specify how values in each column are handled during
analysis. For more information, see Modeling Flags (Data Mining).
NOT NULL Indicates that the column cannot contain a null. An error will
result if Analysis Services encounters a null during model
training.
Requirements
A linear regression model must contain a key column, input columns, and at least one predictable column.
Input and Predictable Columns
The Microsoft Linear Regression algorithm supports the specific input columns and predictable columns that are
listed in the following table. For more information about what the content types mean when used in a mining
model, see Content Types (Data Mining).
NOTE
Cyclical and Ordered content types are supported, but the algorithm treats them as discrete values and does not
perform special processing.
See Also
Microsoft Linear Regression Algorithm
Linear Regression Model Query Examples
Mining Model Content for Linear Regression Models (Analysis Services - Data Mining)
Mining Model Content for Linear Regression
Models (Analysis Services - Data Mining)
10/11/2018 • 6 minutes to read • Edit Online
Linear regression models use the same algorithm as Microsoft Decision Trees, but different parameters are used
to constrain the tree, and only continuous attributes are accepted as inputs. However, because linear regression
models are based on the Microsoft Decision Trees algorithm, linear regression models are displayed by using
the Microsoft Decision Tree Viewer. For information, see Browse a Model Using the Microsoft Tree Viewer.
The next section explains how to interpret information in the regression formula node. This information applies
not only to linear regression models, but also to decision trees models that contain regressions in a portion of
the tree.
NODE_CAPTION
A label or a caption associated with the node. This property is primarily for display purposes.
Root node: Blank
Regression node: All.
CHILDREN_CARDINALITY
An estimate of the number of children that the node has.
Root node: Indicates the number of regression nodes. One regression node is created for each predictable
attribute in the model.
Regression node: Always 0.
PARENT_UNIQUE_NAME
The unique name of the node's parent. NULL is returned for any nodes at the root level.
NODE_DESCRIPTION
A description of the node.
Root node: Blank
Regression node: All.
NODE_RULE
Not used for linear regression models.
MARGINAL_RULE
Not used for linear regression models.
NODE_PROBABILITY
The probability associated with this node.
Root node: 0
Regression node: 1
MARGINAL_PROBABILITY
The probability of reaching the node from the parent node.
Root node: 0
Regression node: 1
NODE_DISTRIBUTION
A nested table that provides statistics about the values in the node.
Root node: 0
Regression node: A table that contains the elements used to build the regression formula. A regression node
contains the following value types:
VALUETYPE
1 (Missing)
3 (Continuous)
7 (Coefficient)
8 (Score Gain)
9 (Statistics)
11 (Intercept)
NODE_SUPPORT
The number of cases that support this node.
Root node: 0
Regression node: Count of training cases.
MSOLAP_MODEL_COLUMN
Name of predictable attribute.
MSOLAP_NODE_SCORE
Same as NODE_PROBABILITY
MSOLAP_NODE_SHORT_CAPTION
Label used for display purposes.
Remarks
When you create a model by using the Microsoft Linear Regression algorithm, the data mining engine creates a
special instance of a decision trees model and supplies parameters that constrain the tree to contain all the
training data in a single node. All continuous inputs are flagged and evaluated as potential regressors, but only
those regressors that fit the data are retained as regressors in the final model. The analysis produces either a
single regression formula for each regressor or no regression formula at all.
You can view the complete regression formula in the Mining Legend, by clicking the (All) node in the
Microsoft Tree Viewer.
Also, when you create a decision trees model that includes a continuous predictable attribute, sometimes the
tree has regression nodes that share the properties of regression tree nodes.
Age 234.680904692 0 0 0 8
439
35793.5477381 0 0 1012968919.28 11
267 372
The NODE_DISTRIBUTION table contains multiple rows, each grouped by a variable. The first two rows are
always value types 1 and 3, and describe the target attribute. The succeeding rows provide details about the
formula for a particular regressor. A regressor is an input variable that has a linear relationship with the output
variable. You can have multiple regressors, and each regressor will have a separate row for the coefficient
(VALUETYPE = 7), score gain (VALUETYPE = 8), and statistics (VALUETYPE = 9). Finally, the table has a row
that contains the intercept of the equation (VALUETYPE = 11).
Elements of the Regression Formula
The nested NODE_DISTRIBUTION table contains each element of the regression formula in a separate row.
The first two rows of data in the example results contain information about the predictable attribute, Yearly
Income, which models the dependent variable. The SUPPORT column shows the count of cases in support of
the two states of this attribute: either a Yearly Income value was available, or the Yearly Income value was
missing.
The VARIANCE column tells you the computed variance of the predictable attribute. Variance is a measure of
how scattered the values are in a sample, given an expected distribution. Variance here is calculated by taking the
average of the squared deviation from the mean. The square root of the variance is also known as standard
deviation. Analysis Services does not provide the standard deviation but you can easily calculate it.
For each regressor, three rows are output. They contain the coefficient, score gain, and regressor statistics.
Finally, the table contains a row that provides the intercept for the equation.
Coefficient
For each regressor, a coefficient (VALUETYPE = 7) is calculated. The coefficient itself appears in the
ATTRIBUTE_VALUE column, whereas the VARIANCE column tells you the variance for the coefficient. The
coefficients are calculated so as to maximize linearity.
Score Gain
The score gain (VALUETYPE = 8) for each regressor represents the interestingness score of the attribute. You
can use this value to estimate the usefulness of multiple regressors.
Statistics
The regressor statistic (VALUETYPE = 9) is the mean for the attribute for cases that have a value. The
ATTRIBUTE_VALUE column contains the mean itself, whereas the VARIANCE column contains the sum of
deviations from the mean.
Intercept
Normally, the intercept (VALUETYPE = 11) or residual in a regression equation tells you the value of the
predictable attribute, at the point where the input attribute, is 0. In many cases, this might not happen, and could
lead to counterintuitive results.
For example, in a model that predicts income based on age, it is useless to learn the income at age 0. In real-life,
it is typically more useful to know about the behavior of the line with respect to average values. Therefore, SQL
Server Analysis Services modifies the intercept to express each regressor in a relationship with the mean.
This adjustment is difficult to see in the mining model content, but is apparent if you view the completed
equation in the Mining Legend of the Microsoft Tree Viewer. The regression formula is shifted away from
the 0 point to the point that represents the mean. This presents a view that is more intuitive given the current
data.
Therefore, assuming that the mean age is around 45, the intercept (VALUETYPE = 11) for the regression
formula tells you the mean income.
See Also
Mining Model Content (Analysis Services - Data Mining)
Microsoft Linear Regression Algorithm
Microsoft Linear Regression Algorithm Technical Reference
Linear Regression Model Query Examples
Linear Regression Model Query Examples
5/16/2018 • 6 minutes to read • Edit Online
NOTE
Because linear regression is based on a special case of the Microsoft Decision Trees algorithm, there are many similarities,
and some decision tree models that use continuous predictable attributes can contain regression formulas. For more
information, see Microsoft Decision Trees Algorithm Technical Reference.
Content queries
Using the Data Mining Schema Rowset to determine parameters used for a model
Using DMX to return the regression formula for the model
Returning only the coefficient for the model
Prediction queries
Predicting income using a singleton query
Using prediction functions with a regression model
SELECT MINING_PARAMETERS
FROM $system.DMSCHEMA_MINING_MODELS
WHERE MODEL_NAME = 'TM_PredictIncome'
Sample results:
MINING_PARAMETERS
COMPLEXITY_PENALTY=0.9,
MAXIMUM_INPUT_ATTRIBUTES=255,
MAXIMUM_OUTPUT_ATTRIBUTES=255,
MINIMUM_SUPPORT=10,
SCORE_METHOD=4,
SPLIT_METHOD=3,
FORCE_REGRESSOR=
NOTE
The parameter setting, " FORCE_REGRESSOR = ", indicates that the current value for the FORCE_REGRESSOR parameter is
null.
Return to Top
Sample Query 2: Retrieving the Regression Formula for the Model
The following query returns the mining model content for a linear regression model that was built by using the
same Targeted Mailing data source that was used in the Basic Data Mining Tutorial. This model predicts
customer income based on age.
The query returns the contents of the node that contains the regression formula. Each variable and coefficient is
stored in a separate row of the nested NODE_DISTRIBUTION table. If you want to view the complete
regression formula, use the Microsoft Tree Viewer, click the (All) node, and open the Mining Legend.
NOTE
If you reference individual columns of the nested table by using a query such as
SELECT <column name> from NODE_DISTRIBUTION , some columns, such as SUPPORT or PROBABILITY, must be
enclosed in brackets to distinguish them from reserved keywords of the same name.
Expected results:
T.ATTRIBUTE_NA T.ATTRIBUTE_VAL
ME UE T.SUPPORT T.PROBABILITY T.VARIANCE T.VALUETYPE
Age 234.680904692 0 0 0 8
439
35793.5477381 0 0 1012968919.28 11
267 372
You can see that in the Mining Legend, some numbers are rounded; however, the NODE_DISTRIBUTION table
and the Mining Legend essentially contain the same values.
The values in the VALUETYPE column tell you what kind of information is contained in each row, which is useful
if you are processing the results programmatically. The following table shows the value types that are output for
a linear regression formula.
VALUETYPE
1 (Missing)
3 (Continuous)
7 (Coefficient)
8 (Score Gain)
9 (Statistics)
7 (Coefficient)
8 (Score Gain)
9 (Statistics)
11 (Intercept)
For more information about the meaning of each value type for regression models, see Mining Model Content
for Linear Regression Models (Analysis Services - Data Mining).
Return to Top
Sample Query 3: Returning Only the Coefficient for the Model
By using the VALUETYPE enumeration, you can return only the coefficient for the regression equation, as shown
in the following query:
SELECT FLATTENED MODEL_NAME,
(SELECT ATTRIBUTE_VALUE, VALUETYPE
FROM NODE_DISTRIBUTION
WHERE VALUETYPE = 11)
AS t
FROM LR_PredictIncome.CONTENT
This query returns two rows, one from the mining model content, and the row from the nested table that
contains the coefficient. The ATTRIBUTE_NAME column is not included here because it is always blank for the
coefficient.
LR_PredictIncome
LR_PredictIncome 35793.5477381267 11
Return to Top
NOTE
You can also create queries on regression models by using the SQL Server 2005 (9.x) Data Mining Add-ins for Excel or the
SQL Server 2008 Data Mining Add-ins for Excel. Even though the Data Mining Add-ins for Excel do not create regression
models, you can browse and query any mining model that is stored on an instance of Analysis Services.
Return to Top
Sample Query 4: Predicting Income using a Singleton Query
The easiest way to create a single query on a regression model is by using the Singleton Query Input dialog
box. For example, you can build the following DMX query by selecting the appropriate regression model,
choosing Singleton Query, and then typing 20 as the value for Age.
Sample results:
YEARLY INCOME
45227.302092176
Return to Top
Sample Query 5: Using Prediction Functions with a Regression Model
You can use many of the standard prediction functions with linear regression models. The following example
illustrates how to add some descriptive statistics to the prediction query results. From these results, you can see
that there is considerable deviation from the mean for this model.
SELECT
([LR_PredictIncome].[Yearly Income]) as [PredIncome],
(PredictStdev([LR_PredictIncome].[Yearly Income])) as [StDev1]
From
[LR_PredictIncome]
NATURAL PREDICTION JOIN
(SELECT 20 AS [Age]) AS t
Sample results:
45227.302092176 31827.1726561396
Return to Top
IsInNode (DMX) Indicates whether the specified node contains the current
case.
For a list of the functions that are common to all Microsoft algorithms, see Data Mining Algorithms (Analysis
Services - Data Mining). For more information about how to use these functions, see Data Mining Extensions
(DMX) Function Reference.
See Also
Microsoft Linear Regression Algorithm
Data Mining Queries
Microsoft Linear Regression Algorithm Technical Reference
Mining Model Content for Linear Regression Models (Analysis Services - Data Mining)
Microsoft Logistic Regression Algorithm
5/16/2018 • 4 minutes to read • Edit Online
Example
Consider a group of people who share similar demographic information and who buy products from the
Adventure Works company. By modeling the data to relate to a specific outcome, such as purchase of a target
product, you can see how the demographic information contributes to someone's likelihood of buying the target
product.
Creating Predictions
After the model has been trained, you can create queries against the model content to get the regression
coefficients and other details, or you can use the model to make predictions.
For general information about how to create queries against a data mining model, see Data Mining
Queries.
For examples of queries on a logistic regression model, see Clustering Model Query Examples.
Remarks
Does not support drillthrough. This is because the structure of nodes in the mining model does not
necessarily correspond directly to the underlying data.
Does not support the creation of data mining dimensions.
Supports the use of OLAP mining models.
Does not support the use of Predictive Model Markup Language (PMML ) to create mining models.
See Also
Mining Model Content for Logistic Regression Models (Analysis Services - Data Mining)
Microsoft Logistic Regression Algorithm Technical Reference
Logistic Regression Model Query Examples
Microsoft Logistic Regression Algorithm Technical
Reference
11/28/2018 • 6 minutes to read • Edit Online
The x-axis contains values of an input column. The y-axis contains the probabilities that the predictable column
will be one state or the other. The problem with this is that the linear regression does not constrain the column to
be between 0 and 1, even though those are the maximum and minimum values of the column. A way to solve
this problem is to perform logistic regression. Instead of creating a straight line, logistic regression analysis
creates an "S" shaped curve that contains maximum and minimum constraints. For example, the following
diagram illustrates the results you will achieve if you perform a logistic regression against the same data as used
for the previous example.
Notice how the curve never goes above 1 or below 0. You can use logistic regression to describe which input
columns are important in determining the state of the predictable column.
Feature Selection
Feature selection is used automatically by all Analysis Services data mining algorithms to improve analysis and
reduce processing load. The method used for feature selection in a logistic regression model depends on the data
type of the attribute. Because logistic regression is based on the Microsoft Neural Network algorithm, it uses a
subset of the feature selection methods that apply to neural networks. For more information, see Feature
Selection (Data Mining).
Scoring Inputs
Scoring in the context of a neural network model or logistic regression model means the process of converting
the values that are present in the data into a set of values that use the same scale and therefore can be compared
to each other. For example, suppose the inputs for Income range from 0 to 100,000 whereas the inputs for
[Number of Children] range from 0 to 5. This conversion process allows you to compare the importance of each
input regardless of the difference in values.
For each state that appears in the training set, the model generates an input. For discrete or discretized inputs, an
additional input is created to represent the Missing state, if the missing state appears at least once in the training
set. For continuous inputs, at most two input nodes are created: one for Missing values, if present in the training
data, and one input for all existing, or non-null, values. Each input is scaled to a numeric format using the z-score
normalization method, (x - μ)\StdDev .
During z-score normalization, the mean (μ) and standard deviation are obtained over the complete training set.
Continuous values
Value is present: (X - μ)/σ (X is the actual value being encoded)
Value is absent: - μ/σ (negative mu divided by sigma)
Discrete values
μ = p (the prior probability of a state)
StdDev = sqrt(p\(1-p))
NOTE
The coefficients that are created as part of a logistic regression model do not represent odds ratios and should not be
interpreted as such.
The coefficients for each node in the model graph represent a weighted sum of the inputs to that node. In a
logistic regression model, the hidden layer is empty; therefore, there is only one set of coefficients, which is
stored in the output nodes. You can retrieve the values of the coefficients by using the following query:
SELECT FLATTENED [NODE_UNIQUE NAME],
(SELECT ATTRIBUTE_NAME< ATTRIBUTE_VALUE
FROM NODE_DISTRIBUTION) AS t
FROM <model name>.CONTENT
WHERE NODE_TYPE = 23
For each output value, this query returns the coefficients and an ID that points back to the related input node. It
also returns a row that contains the value of the output and the intercept. Each input X has its own coefficient
(Ci), but the nested table also contains a "free" coefficient (Co), calculated according to the following formula:
F(X) = X1*C1 + X2*C2 + ... +Xn*Cn + X0
Requirements
A logistic regression model must contain a key column, input columns, and at least one predictable column.
Input and Predictable Columns
The Microsoft Logistic Regression algorithm supports the specific input column content types, predictable
column content types, and modeling flags that are listed in the following table. For more information about what
the content types mean when used in a mining model, see Content Types (Data Mining).
See Also
Microsoft Logistic Regression Algorithm
Linear Regression Model Query Examples
Mining Model Content for Logistic Regression Models (Analysis Services - Data Mining)
Microsoft Neural Network Algorithm
Mining Model Content for Logistic Regression
Models
5/16/2018 • 6 minutes to read • Edit Online
By default, a logistic regression model is displayed in the Microsoft Neural Network Viewer. With this custom
viewer, you can filter on input attributes and their values, and graphically see how they affect the outputs. The
tooltips in the viewer show you the probability and lift associated with each pair of inputs and output values. For
more information, see Browse a Model Using the Microsoft Neural Network Viewer.
To explore the structure of the inputs and subnetworks, and to see detailed statistics, you can use the Microsoft
Generic Content Tree viewer. You can click on any node to expand it and see the child nodes, or view the weights
and other statistics contained in the node.
NODE CONTENT
NODE_NAME
The name of the node. Currently, this column contains the same value as NODE_UNIQUE_NAME, though this
may change in future releases.
NODE_UNIQUE_NAME
The unique name of the node.
For more information about how the names and IDs provide structural information about the model, see the
section, Using Node Names and IDs.
NODE_TYPE
A logistic regression model outputs the following node types:
1 Model.
NODE_CAPTION
A label or a caption associated with the node. In logistic regression models, always blank.
CHILDREN_CARDINALITY
An estimate of the number of children that the node has.
NODE CONTENT
Model root Indicates the count of child nodes, which includes at least 1
network, 1 required marginal node, and 1 required input
layer. For example, if the value is 5, there are 3 subnetworks.
PARENT_UNIQUE_NAME
The unique name of the node's parent. NULL is returned for any nodes at the root level.
For more information about how the names and IDs provide structural information about the model, see the
section, Using Node Names and IDs.
NODE_DESCRIPTION
A user-friendly description of the node.
NODE CONTENT
NODE_RULE
An XML description of the rule that is embedded in the node.
NODE CONTENT
MARGINAL_RULE
For logistic regression models, always blank.
NODE_PROBABILITY
The probability associated with this node. For logistic regression models, always 0.
MARGINAL_PROBABILITY
The probability of reaching the node from the parent node. For logistic regression models, always 0.
NODE_DISTRIBUTION
A nested table that contains statistical information for the node. For detailed information about the contents of
this table for each node type, see the section, Understanding the NODE_DISTRIBUTION Table, in Mining Model
Content for Neural Network Models (Analysis Services - Data Mining).
NODE_SUPPORT
For logistic regression models, always 0.
NOTE
Support probabilities are always 0 because the output of this model type is not probabilistic. The only thing that is
meaningful for the algorithm is the weights; therefore, the algorithm does not compute probability, support, or variance.
To get information about the support in the training cases for specific values, see the marginal statistics node.
MSOLAP_MODEL_COLUMN
|Node|Content|
|----------|-------------|
|Model root|Blank|
|Marginal statistics|Blank|
|Input layer|Blank|
|Input node|Input attribute name.|
|Hidden layer|Blank|
|Output layer|Blank|
|Output node|Input attribute name.|
MSOLAP_NODE_SCORE
In logistic regression models, always 0.
MSOLAP_NODE_SHORT_CAPTION
In logistic regression models, always blank.
You can use these IDs to determine how output attributes are related to specific input layer attributes, by viewing
the NODE_DISTRIBUTION table of the output node. Each row in that table contains an ID that points back to a
specific input attribute node. The NODE_DISTRIBUTION table also contains the coefficient for that input-output
pair.
See Also
Microsoft Logistic Regression Algorithm
Mining Model Content for Neural Network Models (Analysis Services - Data Mining)
Logistic Regression Model Query Examples
Microsoft Logistic Regression Algorithm Technical Reference
Logistic Regression Model Query Examples
5/16/2018 • 7 minutes to read • Edit Online
Sample Query 1: Retrieving Model Parameters by Using the Data Mining Schema Rowset
By querying the data mining schema rowset, you can find metadata about the model, such as when it was created,
when the model was last processed, the name of the mining structure that the model is based on, and the name of
the column used as the predictable attribute. The following example returns the parameters that were used when
the model was first created, together with the name and type of the model, and the date that it was created.
Sample results:
Sample Query 2: Finding Additional Detail about the Model by Using DMX
The following query returns some basic information about the logistic regression model. A logistic regression
model is similar to a neural network model in many ways, including the presence of a marginal statistic node
(NODE_TYPE = 24) that describes the values used as inputs. This example query uses the Targeted Mailing
model, and gets the values of all the inputs by retrieving them from the nested table, NODE_DISTRIBUTION.
Partial results:
T.ATTRIBUTE_NAM T.ATTRIBUTE_VAL
E UE T.SUPPORT T.PROBABILITY T.VARIANCE T.VALUETYPE
Age Missing 0 0 0 1
Commute Missing 0 0 0 1
Distance
The actual query returns many more rows; however, this sample illustrates the type of information that is
provided about the inputs. For discrete inputs, each possible value is listed in the table. For continuous-value
inputs such as Age, a complete listing is impossible, so the input is discretized as a mean. For more information
about how to use the information in the marginal statistics node, see Mining Model Content for Logistic
Regression Models (Analysis Services - Data Mining).
NOTE
The results have been flattened for easier viewing, but you can return the nested table in a single column if your provider
supports hierarchical rowsets.
SELECT
Predict([Call Center_LR].[Service Grade]) as Predicted ServiceGrade,
PredictHistogram([Call Center_LR].[Service Grade]) as [Results],
FROM
[Call Center_LR]
NATURAL PREDICTION JOIN
(SELECT 'Friday' AS [Day Of Week],
'AM' AS [Shift]) AS t
Sample results:
PREDICTED
SERVICE SERVICE $ADJUSTEDPR
GRADE GRADE $SUPPORT $PROBABILITY OBABILITY $VARIANCE $STDEV
For more information about the probability, support, and standard deviation values in the nested
NODE_DISTRIBUTION table, see Mining Model Content for Logistic Regression Models (Analysis Services -
Data Mining).
Sample Query 4: Making Predictions for a Discrete Value
Logistic regression is typically used in scenarios where you want to analyze the factors that contribute to a binary
outcome. Although the model used in the tutorial predicts a continuous value, ServiceGrade, in a real-life
scenario you might want to set up the model to predict whether service grade met some discretized target value.
Alternatively, you could output the predictions using a continuous value but later group the predicted outcomes
into Good, Fair, or Poor.
The following sample illustrates how to change the way that the predictable attribute is grouped. To do this, you
create a copy of the mining structure and then change the discretization method of the target column so that the
values are grouped rather than continuous.
The following procedure describes how to change the grouping of Service Grade values in the Call Center data.
To c r e a t e a d i sc r e t i z e d v e r si o n o f t h e C a l l C e n t e r m i n i n g st r u c t u r e a n d m o d e l s
1. In SQL Server Data Tools (SSDT), in Solution Explorer, expand Mining Structures.
2. Right-click Call Center.dmm and select Copy.
3. Right click Mining Structures and select Paste. A new mining structure iss added, named Call Center 1.
4. Right-click the new mining structure and select Rename. Type the new name, Call Center Discretized.
5. Double-click the new mining structure to open it in the designer. Notice that the mining models have all
been copied as well, and all have the extension 1. Leave the names as is for now.
6. In the Mining Structure tab, right-click the column for Service Grade, and select Properties.
7. Change the Content property from Continuous to Discretized. Change the DiscretizationMethod
property to Clusters. For Discretization BucketCount, type 3.
NOTE
These parameters are just used for illustrating the process, and do not necessarily produce a valid model,
8. From the Mining Model menu, select Process structure and all models.
The following sample query is based on this discretized model, and predicts the service grade for the specified
day of the week, together with the probabilities for each predicted outcome.
SELECT
(PredictHistogram([Call Center_LR 1].[Service Grade])) as [Predictions]
FROM
[Call Center_LR 1]
NATURAL PREDICTION JOIN
(SELECT 'Saturday' AS [Day Of Week]) AS t
Expected results:
Predictions:
$ADJUSTEDPROBA
SERVICE GRADE $SUPPORT $PROBABILITY BILITY $VARIANCE $STDEV
For a list of the functions that are common to all Microsoft algorithms, see General Prediction Functions (DMX).
For the syntax of specific functions, see Data Mining Extensions (DMX) Function Reference.
NOTE
For neural network and logistic regression models, the PredictSupport (DMX) function returns a single value that represents
the size of the training set for the entire model.
See Also
Data Mining Queries
Microsoft Logistic Regression Algorithm
Microsoft Logistic Regression Algorithm Technical Reference
Mining Model Content for Logistic Regression Models (Analysis Services - Data Mining)
Lesson 5: Building Neural Network and Logistic Regression Models (Intermediate Data Mining Tutorial)
Microsoft Naive Bayes Algorithm
11/27/2018 • 5 minutes to read • Edit Online
Example
As an ongoing promotional strategy, the marketing department for the Adventure Works Cycle company has
decided to target potential customers by mailing out fliers. To reduce costs, they want to send fliers only to those
customers who are likely to respond. The company stores information in a database about demographics and
response to a previous mailing. They want to use this data to see how demographics such as age and location can
help predict response to a promotion, by comparing potential customers to customers who have similar
characteristics and who have purchased from the company in the past. Specifically, they want to see the
differences between those customers who bought a bicycle and those customers who did not.
By using the Microsoft Naive Bayes algorithm, the marketing department can quickly predict an outcome for a
particular customer profile, and can therefore determine which customers are most likely to respond to the fliers.
By using the Microsoft Naive Bayes Viewer in SQL Server Data Tools (SSDT), they can also visually investigate
specifically which input columns contribute to positive responses to fliers.
Making Predictions
After the model has been trained, the results are stored as a set of patterns, which you can explore or use to make
predictions.
You can create queries to return predictions about how new data relates to the predictable attribute, or you can
retrieve statistics that describe the correlations found by the model.
For information about how to create queries against a data mining model, see Data Mining Queries. For
examples of how to use queries with a Naive Bayes model, see Naive Bayes Model Query Examples.
Remarks
Supports the use of Predictive Model Markup Language (PMML ) to create mining models.
Supports drillthrough.
Does not support the creation of data mining dimensions.
Supports the use of OLAP mining models.
See Also
Data Mining Algorithms (Analysis Services - Data Mining)
Feature Selection (Data Mining)
Naive Bayes Model Query Examples
Mining Model Content for Naive Bayes Models (Analysis Services - Data Mining)
Microsoft Naive Bayes Algorithm Technical Reference
Microsoft Naive Bayes Algorithm Technical Reference
11/27/2018 • 4 minutes to read • Edit Online
The algorithm is designed to minimize processing time and efficiently select the attributes that have the greatest
importance; however, you can control the data that is used by the algorithm by setting parameters as follows:
To limit the values that are used as inputs, decrease the value of MAXIMUM_INPUT_ATTRIBUTES.
To limit the number of attributes analyzed by the model, decrease the value of
MAXIMUM_OUTPUT_ATTRIBUTES.
To limit the number of values that can be considered for any one attribute, decrease the value of
MINIMUM_STATES.
MODEL_EXISTENCE_ONLY Means that the column will be treated as having two possible
states: Missing and Existing. A null is a missing value.
NOT NULL Indicates that the column cannot contain a null. An error will
result if Analysis Services encounters a null during model
training.
Requirements
A Naive Bayes tree model must contain a key column, at least one predictable attribute, and at least one input
attribute. No attribute can be continuous; if your data contains continuous numeric data, it will be ignored or
discretized.
Input and Predictable Columns
The Microsoft Naive Bayes algorithm supports the specific input columns and predictable columns that are listed
in the following table. For more information about what the content types mean when used in a mining model,
see Content Types (Data Mining).
NOTE
Cyclical and Ordered content types are supported, but the algorithm treats them as discrete values and does not perform
special processing.
See Also
Microsoft Naive Bayes Algorithm
Naive Bayes Model Query Examples
Mining Model Content for Naive Bayes Models (Analysis Services - Data Mining)
Mining Model Content for Naive Bayes Models
(Analysis Services - Data Mining)
5/16/2018 • 9 minutes to read • Edit Online
NOTE
Because a Naive Bayes model does not permit continuous data types, all the values of the input columns are treated as
discrete or discretized. You can specify how a value is discretized. For more information, Change the Discretization of a
Column in a Mining Model.
10 (Input attribute) Contains the name of an input attribute column, and child
nodes that contains the values for the attribute.
11 (Input attribute state) Contains the values or discretized values of all input
attributes that were paired with a particular output attribute.
NODE_CAPTION
The label or a caption associated with the node. This property is primarily for display purposes.
Model root blank
Marginal statistics blank
Predictable attribute The name of the predictable attribute.
Input attribute The name of the predictable attribute and the current input attribute. Ex:
Bike Buyer -> Age
Input attribute state The name of the predictable attribute and the current input attribute, plus the value of the
input. Ex:
Bike Buyer -> Age = Missing
CHILDREN_CARDINALITY
The number of children that the node has.
Model root Count of predictable attributes in the model plus 1 for the marginal statistics node.
Marginal statistics By definition has no children.
Predictable attribute Count of the input attributes that were related to the current predictable attribute.
Input attribute Count of the discrete or discretized values for the current input attribute.
Input attribute state Always 0.
PARENT_UNIQUE_NAME
The unique name of the parent node. For more information about relating parent and child nodes, see Using
Node Names and IDs.
NODE_DESCRIPTION
The same as the node caption.
NODE_RULE
An XML representation of the node caption.
MARGINAL_RULE
The same as the node rule.
NODE_PROBABILITY
The probability associated with this node.
Model root Always 0.
Marginal statistics Always 0.
Predictable attribute Always 1.
Input attribute Always 1.
Input attribute state A decimal number that represents the probability of the current value. Values for all input
attribute states under the parent input attribute node sum to 1.
MARGINAL_PROBABILITY
The same as the node probability.
NODE_DISTRIBUTION
A table that contains the probability histogram for the node. For more information, see NODE_DISTRIBUTION
Table.
NODE_SUPPORT
The number of cases that support this node.
Model root Count of all cases in training data.
Marginal statistics Always 0.
Predictable attribute Count of all cases in training data.
Input attribute Count of all cases in training data.
Input attribute state Count of cases in training data that contain only this particular value.
MSOLAP_MODEL_COLUMN
A label used for display purposes. Usually the same as ATTRIBUTE_NAME.
MSOLAP_NODE_SCORE
Represents the importance of the attribute or value within the model.
Model root Always 0.
Marginal statistics Always 0.
Predictable attribute Always 0.
Input attribute Interestingness score for the current input attribute in relation to the current predictable
attribute.
Input attribute state Always 0.
MSOLAP_NODE_SHORT_CAPTION
A text string that represents the name or the value of a column.
Model root Blank
Marginal statistics Blank
Predictable attribute The name of the predictable attribute.
Input attribute The name of the input attribute.
Input attribute state The value or discretized value of the input attribute.
Input attribute (10) A two-part hexadecimal number where the first part is always
20000000, and the second part starts with the hexadecimal
identifier of the related predictable attribute.
Example: 20000000b00000000
Input attribute state (11) A three-part hexadecimal number where the first part is
always 30000000, the second part starts with the
hexadecimal identifier of the related predictable attribute, and
the third part represents the identifier of the value.
Example: 30000000b00000000200000000
You can use the IDs to relate input attributes and states to a predictable attribute. For example, the following
query returns the names and captions for nodes that represent the possible combinations of input and
predictable attributes for the model, TM_NaiveBayes .
Expected results:
NODE_NAME NODE_CAPTION
You can then use the IDs of the parent nodes to retrieve the child nodes. The following query retrieves the nodes
that contain values for the Marital Status attribute, together with the probability of each node.
NOTE
The name of the column, PARENT_UNIQUE_NAME, must be enclosed in brackets to distinguish it from the reserved
keyword of the same name.
Expected results:
NODE_NAME NODE_CAPTION NODE_PROBABILITY
NODE_DISTRIBUTION Table
The nested table column, NODE_DISTRIBUTION, typically contains statistics about the distribution of values in
the node. In a Naive Bayes model, this table is populated only for the following nodes:
Marginal statistics node (24) Contains summary information for all predictable attributes
and input attributes, for entire set of training data.
Input attribute state (11) Contains statistics that describe the distribution of values in
the training data for this particular combination of a
predictable value and input attribute value.
You can use the node IDs or node captions to retrieve increasing levels of detail. For example, the following query
retrieves specific columns from the NODE_DISTRIBUTION table for only those input attribute nodes that are
related to the value, 'Marital Status = S' .
Expected results:
T.ATTRIBUTE_NAM T.ATTRIBUTE_VAL
NODE_CAPTION E UE T.SUPPORT T.PROBABILITY T.VALUETYPE
In these results, the value of the SUPPORT column tells you the count of customers with the specified marital
status who purchased a bike. The PROBABILITY column contains the probability of each attribute value, as
calculated for this node only. For general definitions of terms used in the NODE_DISTRIBUTION table, see
Mining Model Content (Analysis Services - Data Mining).
Information in the Marginal Statistics Node
In a Naive Bayes model, the nested table for the marginal statistics node contains the distribution of values for the
entire set of training data. For example, the following table contains a partial list of the statistics in the nested
NODE_DISTRIBUTION table for the model, TM_NaiveBayes :
The [Bike Buyer] column is included because the marginal statistics node always contains a description of the
predictable attribute and its possible values. All other columns that are listed represent input attributes, together
with the values that were used in the model. Values can only be missing, discrete or discretized.
In a Naive Bayes model, there can be no continuous attributes; therefore, all numeric data is represented as either
discrete (VALUE_TYPE = 4) or discretized (VALUE_TYPE = 5).
A Missing value (VALUE_TYPE = 1) is added to every input and output attribute to represent potential values
that were not present in the training data. You must be careful to distinguish between "missing" as a string and
the default Missing value. For more information, see Missing Values (Analysis Services - Data Mining).
See Also
Mining Model Content (Analysis Services - Data Mining)
Data Mining Model Viewers
Data Mining Queries
Microsoft Naive Bayes Algorithm
Naive Bayes Model Query Examples
5/16/2018 • 8 minutes to read • Edit Online
Sample results:
MODEL_CATALOG AdventureWorks
MODEL_NAME TM_NaiveBayes_Filtered
DATE_CREATED 3/1/2008 19:15
SERVICE_NAME Microsoft_Naive_Bayes
The model used for this example is based on the Naive Bayes model you create in the Basic Data Mining Tutorial,
but was modified by adding a second predictable attribute and applying a filter to the training data.
Sample Query 2: Retrieving a Summary of Training Data
In a Naive Bayes model, the marginal statistics node stores aggregated information about the distribution of
values in the training data. This summary is convenient and saves you from having to create SQL queries against
the training data to find the same information.
The following example uses a DMX content query to retrieve the data from the node (NODE_TYPE = 24).
Because the statistics are stored in a nested table, the FLATTENED keyword is used to make the results easier to
view.
NOTE
You must enclose the name of the columns, SUPPORT and PROBABILITY, in brackets to distinguish them from the
Multidimensional Expressions (MDX) reserved keywords of the same names.
Partial results:
T.ATTRIBUTE_NAM T.ATTRIBUTE_VAL
MODEL_NAME E UE T.SUPPORT T.PROBABILITY T.VALUETYPE
For example, these results tell you the number of training cases for each discrete value (VALUETYPE = 4),
together with the computed probability, adjusted for missing values (VALUETYPE = 1).
For a definition of the values provided in the NODE_DISTRIBUTION table in a Naive Bayes model, see Mining
Model Content for Naive Bayes Models (Analysis Services - Data Mining). For more information about how
support and probability calculations are affected by missing values, see Missing Values (Analysis Services - Data
Mining).
Sample Query 3: Finding More Information about Attributes
Because a Naive Bayes model often contains complex information about the relationships among different
attributes, the easiest way to view these relationships is to use the Microsoft Naive Bayes Viewer. However, you
can create DMX queries to return the data.
The following example shows how to return information from the model about a particular attribute, Region .
This query returns two types of nodes: the node that represents the input attribute (NODE_TYPE = 10), and
nodes for each value of the attribute (NODE_TYPE = 11). The node caption is used to identify the node, rather
than the node name, because the caption shows both the attribute name and attribute value.
NODE_PROBABILIT MSOLAP_NODE_SC
NODE_TYPE NODE_CAPTION Y NODE_SUPPORT ORE NODE_TYPE
Some of the columns stored in the nodes are the same that you can get from the marginal statistics nodes, such
as the node probability score and the node support values. However, the MSOLAP_NODE_SCORE is a special
value provided only for the input attribute nodes, and indicates the relative importance of this attribute in the
model. You can see much the same information in the Dependency Network pane of the viewer; however, the
viewer does not provide scores.
The following query returns the importance scores of all attributes in the model:
Sample results:
NODE_CAPTION MSOLAP_NODE_SCORE
By browsing the model content in the Microsoft Generic Content Tree Viewer, you will get a better idea of what
statistics might be interesting. Some simple examples were demonstrated here; more often you may need to
execute multiple queries or store the results and process them on the client.
Sample Query 4: Using System Stored Procedures
In addition to writing your own content queries, you can use some Analysis Services system stored procedures to
explore the results. To use a system stored procedure, prefix the stored procedure name with the CALL keyword:
Partial results:
ATTRIBUTE_NAME NODE_UNIQUE_NAME
NOTE
These system stored procedures are for internal communication between the Analysis Services server and the client and
should only be used for convenience when developing and testing mining models. When you create queries for a
production system, you should always write your own queries by using DMX.
For more information about Analysis Services system stored procedures, see Data Mining Stored Procedures
(Analysis Services - Data Mining).
SELECT
Predict([TM_NaiveBayes].[Bike Buyer])
FROM
[TM_NaiveBayes]
NATURAL PREDICTION JOIN
(SELECT '5-10 Miles' AS [Commute Distance],
'F' AS [Gender]) AS t
Example results:
EXPRESSION
The prediction function returns the most likely value, in this case, 0, which means this type of customer is unlikely
to purchase a bike.
Sample Query 6: Getting Predictions with Probability and Support Values
In addition to predicting an outcome, you often want to know how strong the prediction is. The following query
uses the same singleton query as the previous example, but adds the prediction function, PredictHistogram
(DMX), to return a nested table that contains statistics in support of the prediction.
SELECT
Predict([TM_NaiveBayes].[Bike Buyer]),
PredictHistogram([TM_NaiveBayes].[Bike Buyer])
FROM
[TM_NaiveBayes]
NATURAL PREDICTION JOIN
(SELECT '5-10 Miles' AS [Commute Distance],
'F' AS [Gender]) AS t
Example results:
$ADJUSTEDPROBA
BIKE BUYER $SUPPORT $PROBABILITY BILITY $VARIANCE $STDEV
The final row in the table shows the adjustments to support and probability for the missing value. Variance and
standard deviation values are always 0, because Naive Bayes models cannot model continuous values.
Sample Query 7: Predicting Associations
The Microsoft Naive Bayes algorithm can be used for association analysis, if the mining structure contains a
nested table with the predictable attribute as the key. For example, you could build a Naive Bayes model by using
the mining structure created in Lesson 3: Building a Market Basket Scenario (Intermediate Data Mining Tutorial)
of the data mining tutorial. The model used in this example was modified to add information about income and
customer region in the case table.
The following query example shows a singleton query that predicts products that are related to purchases of the
product, 'Road Tire Tube' . You might use this information to recommend products to a specific type of customer.
SELECT PredictAssociation([Association].[v Assoc Seq Line Items])
FROM [Association_NB]
NATURAL PREDICTION JOIN
(SELECT 'High' AS [Income Group],
'Europe' AS [Region],
(SELECT 'Road Tire Tube' AS [Model])
AS [v Assoc Seq Line Items])
AS t
Partial results:
MODEL
Water Bottle
Touring-3000
Touring-2000
Touring-1000
Function List
All Microsoft algorithms support a common set of functions. However, the Microsoft Naive Bayes algorithm
supports the additional functions that are listed in the following table.
To see the syntax of specific functions, see Data Mining Extensions (DMX) Function Reference.
See Also
Microsoft Naive Bayes Algorithm Technical Reference
Microsoft Naive Bayes Algorithm
Mining Model Content for Naive Bayes Models (Analysis Services - Data Mining)
Microsoft Neural Network Algorithm
5/16/2018 • 4 minutes to read • Edit Online
Example
The Microsoft Neural Network algorithm is useful for analyzing complex input data, such as from a
manufacturing or commercial process, or business problems for which a significant quantity of training data is
available but for which rules cannot be easily derived by using other algorithms.
Suggested scenarios for using the Microsoft Neural Network algorithm include the following:
Marketing and promotion analysis, such as measuring the success of a direct mail promotion or a radio
advertising campaign
Predicting stock movement, currency fluctuation, or other highly fluid financial information from historical
data
Analyzing manufacturing and industrial processes
Text mining
Any prediction model that analyzes complex relationships between many inputs and relatively fewer
outputs
Creating Predictions
After the model has been processed, you can use the network and the weights stored within each node to make
predictions. A neural network model supports regression, association, and classification analysis, Therefore, the
meaning of each prediction might be different. You can also query the model itself, to review the correlations that
were found and retrieve related statistics. For examples of how to create queries against a neural network model,
see Neural Network Model Query Examples.
For general information about how to create a query on a data mining model, see Data Mining Queries.
Remarks
Does not support drillthrough or data mining dimensions. This is because the structure of the nodes in the
mining model does not necessarily correspond directly to the underlying data.
Does not support the creation of models in Predictive Model Markup Language (PMML ) format.
Supports the use of OLAP mining models.
Does not support the creation of data mining dimensions.
See Also
Microsoft Neural Network Algorithm Technical Reference
Mining Model Content for Neural Network Models (Analysis Services - Data Mining)
Neural Network Model Query Examples
Microsoft Logistic Regression Algorithm
Microsoft Neural Network Algorithm Technical
Reference
11/28/2018 • 13 minutes to read • Edit Online
NOTE
These algorithm parameters are different from the HOLDOUT_SIZE and HOLDOUT_SEED properties, which are applied to a
mining structure to define a testing data set.
The algorithm next determines the number and complexity of the networks that the mining model supports. If
the mining model contains one or more attributes that are used only for prediction, the algorithm creates a
single network that represents all such attributes. If the mining model contains one or more attributes that are
used for both input and prediction, the algorithm provider constructs a network for each attribute.
For input and predictable attributes that have discrete values, each input or output neuron respectively
represents a single state. For input and predictable attributes that have continuous values, each input or output
neuron respectively represents the range and distribution of values for the attribute. The maximum number of
states that is supported in either case depends on the value of the MAXIMUM_STATES algorithm parameter. If
the number of states for a specific attribute exceeds the value of the MAXIMUM_STATES algorithm parameter,
the most popular or relevant states for that attribute are chosen, up to the maximum number of states allowed,
and the remaining states are grouped as missing values for the purposes of analysis.
The algorithm then uses the value of the HIDDEN_NODE_RATIO parameter when determining the initial
number of neurons to create for the hidden layer. You can set HIDDEN_NODE_RATIO to 0 to prevent the
creation of a hidden layer in the networks that the algorithm generates for the mining model, to treat the neural
network as a logistic regression.
The algorithm provider iteratively evaluates the weight for all inputs across the network at the same time, by
taking the set of training data that was reserved earlier and comparing the actual known value for each case in
the holdout data with the network's prediction, in a process known as batch learning. After the algorithm has
evaluated the entire set of training data, the algorithm reviews the predicted and actual value for each neuron.
The algorithm calculates the degree of error, if any, and adjusts the weights that are associated with the inputs for
that neuron, working backward from output neurons to input neurons in a process known as backpropagation.
The algorithm then repeats the process over the entire set of training data. Because the algorithm can support
many weights and output neurons, the conjugate gradient algorithm is used to guide the training process for
assigning and evaluating weights for inputs. A discussion of the conjugate gradient algorithm is outside the
scope of this documentation.
Feature Selection
If the number of input attributes is greater than the value of the MAXIMUM_INPUT_ATTRIBUTES parameter, or
if the number of predictable attributes is greater than the value of the MAXIMUM_OUTPUT_ATTRIBUTES
parameter, a feature selection algorithm is used to reduce the complexity of the networks that are included in the
mining model. Feature selection reduces the number of input or predictable attributes to those that are most
statistically relevant to the model.
Feature selection is used automatically by all Analysis Services data mining algorithms to improve analysis and
reduce processing load. The method used for feature selection in neural network models depends on the data
type of the attribute. For reference, the following table shows the feature selection methods used for neural
network models, and also shows the feature selection methods used for the Logistic Regression algorithm, which
is based on the Neural Network algorithm.
Neural Network Interestingness score The Neural Networks algorithm can use
both entropy-based and Bayesian
Shannon's Entropy scoring methods, as long as the data
contains continuous columns.
Bayesian with K2 Prior
Default.
Bayesian Dirichlet with uniform prior
(default)
The algorithm parameters that control feature selection for a neural network model are
MAXIMUM_INPUT_ATTRIBUTES, MAXIMUM_OUTPUT_ATTRIBUTES, and MAXIMUM_STATES. You can also
control the number of hidden layers by setting the HIDDEN_NODE_RATIO parameter.
Scoring Methods
Scoring is a kind of normalization, which in the context of training a neural network model means the process of
converting a value, such as a discrete text label, into a value that can be compared with other types of inputs and
weighted in the network. For example, if one input attribute is Gender and the possible values are Male and
Female, and another input attribute is Income, with a variable range of values, the values for each attribute are
not directly comparable, and therefore must be encoded to a common scale so that the weights can be
computed. Scoring is the process of normalizing such inputs to numeric values: specifically, to a probability
range. The functions used for normalization also help to distribute input value more evenly on a uniform scale so
that extreme values do not distort the results of analysis.
Outputs of the neural network are also encoded. When there is a single target for output (that is, prediction), or
multiple targets that are used for prediction only and not for input, the model create a single network and it
might not seem necessary to normalize the values. However, if multiple attributes are used for input and
prediction, the model must create multiple networks; therefore, all values must be normalized, and the outputs
too must be encoded as they exit the network.
Encoding for inputs is based on summing each discrete value in the training cases, and multiplying that value by
its weight. This is called a weighted sum, which is passed to the activation function in the hidden layer. A z-score
is used for encoding, as follows:
Discrete values
μ = p - the prior probability of a state
StdDev = sqrt(p(1-p))
Continuous values
Value present= 1 - μ/σ
After the values have been encoded, the inputs go through weighted summing, with network edges as weights.
Encoding for outputs uses the sigmoid function, which has properties that make it very useful for prediction.
One such property is that, regardless of how the original values are scaled, and regardless of whether values are
negative or positive, the output of this function is always a value between 0 and 1, which is suited for estimating
probabilities. Another useful property is that the sigmoid function has a smoothing effect, so that as values move
farther away from point of inflection, the probability for the value moves towards 0 or 1, but slowly.
Requirements
A neural network model must contain at least one input column and one output column.
Input and Predictable Columns
The Microsoft Neural Network algorithm supports the specific input columns and predictable columns that are
listed in the following table.
NOTE
Cyclical and Ordered content types are supported, but the algorithm treats them as discrete values and does not perform
special processing.
See Also
Microsoft Neural Network Algorithm
Mining Model Content for Neural Network Models (Analysis Services - Data Mining)
Neural Network Model Query Examples
Mining Model Content for Neural Network Models
(Analysis Services - Data Mining)
5/16/2018 • 10 minutes to read • Edit Online
The information in the input layer is straightforward: the top node for each input layer (NODE_TYPE = 18)
serves as an organizer for a collection of input nodes (NODE_TYPE = 21). The content of the input nodes is
described in the following table.
Each subnetwork (NODE_TYPE = 17) represents the analysis of the influence of the input layer on a particular
predictable attribute. If there are multiple predictable outputs, there are multiple subnetworks. The hidden layer
for each subnetwork contains multiple hidden nodes (NODE_TYPE = 22) that contain details about the weights
for each transition that ends in that particular hidden node.
The output layer (NODE_TYPE = 20) contains output nodes (NODE_TYPE = 23) that each contain distinct values
of the predictable attribute. If the predictable attribute is a continuous numeric data type, there is only one output
node for the attribute.
NOTE
The logistic regression algorithm uses a special case of a neural network that has only one predictable outcome and
potentially many inputs. Logistic regression does not use a hidden layer.
The easiest way to explore the structure of the inputs and subnetworks is to use the Microsoft Generic Content
Tree viewer. You can click any node to expand it and see the child nodes, or view the weights and other statistics
that is contained in the node.
To work with the data and see how the model correlates inputs with outputs, use the Microsoft Neural
Network Viewer. By using this custom viewer, you can filter on input attributes and their values, and graphically
see how they affect the outputs. The tooltips in the viewer show you the probability and lift associated with each
pair of inputs and output values. For more information, see Browse a Model Using the Microsoft Neural Network
Viewer.
NODE CONTENT
NODE_NAME
The name of the node. This column contains the same value as NODE_UNIQUE_NAME.
NODE_UNIQUE_NAME
The unique name of the node.
For more information about how the names and IDs provide structural information about the model, see the
section, Using Node Names and IDs.
NODE_TYPE
A neural network model outputs the following node types:
1 Model.
NODE_CAPTION
A label or a caption associated with the node. In neural network models, always blank.
CHILDREN_CARDINALITY
An estimate of the number of children that the node has.
NODE CONTENT
Model root Indicates the count of child nodes, which includes at least 1
network, 1 required marginal node, and 1 required input
layer. For example, if the value is 5, there are 3 subnetworks.
Hidden layer Indicates the number of hidden nodes that were created by
the model.
PARENT_UNIQUE_NAME
The unique name of the node's parent. NULL is returned for any nodes at the root level.
For more information about how the names and IDs provide structural information about the model, see the
section, Using Node Names and IDs.
NODE_DESCRIPTION
A user-friendly description of the node.
NODE CONTENT
Hidden node Integer that indicates the sequence of the hidden node in the
list of hidden nodes.
NODE_RULE
An XML description of the rule that is embedded in the node.
NODE CONTENT
Input node An XML fragment that contains the same information as the
NODE_DESCRIPTION column.
Hidden node Integer that indicates the sequence of the hidden node in the
list of hidden nodes.
Output node An XML fragment that contains the same information as the
NODE_DESCRIPTION column.
MARGINAL_RULE
For neural network models, always blank.
NODE_PROBABILITY
The probability associated with this node. For neural network models, always 0.
MARGINAL_PROBABILITY
The probability of reaching the node from the parent node. For neural network models, always 0.
NODE_DISTRIBUTION
A nested table that contains statistical information for the node. For detailed information about the contents of
this table for each node type, see the section, Understanding the NODE_DISTRIBUTION Table.
NODE_SUPPORT
For neural network models, always 0.
NOTE
Support probabilities are always 0 because the output of this model type is not probabilistic. Only the weights are
meaningful for the algorithm; therefore, the algorithm does not compute probability, support, or variance.
To get information about the support in the training cases for specific values, see the marginal statistics node.
MSOLAP_MODEL_COLUMN
|Node|Content|
|----------|-------------|
|Model root|Blank|
|Marginal statistics|Blank|
|Input layer|Blank|
|Input node|Input attribute name.|
|Hidden layer|Blank|
|Hidden node|Blank|
|Output layer|Blank|
|Output node|Input attribute name.|
MSOLAP_NODE_SCORE
For a neural network model, always 0.
MSOLAP_NODE_SHORT_CAPTION
For neural network models, always blank.
Remarks
The purpose of training a neural network model is to determine the weights that are associated with each
transition from an input to a midpoint, and from a midpoint to an endpoint. Therefore, the input layer of the
model principally exists to store the actual values that were used to build the model. The hidden layer stores the
weights that were computed, and provides pointers back to the input attributes. The output layer stores the
predictable values, and also provides pointers back to the midpoints in the hidden layer.
You can determine which input attributes are related to a specific hidden layer node by viewing the
NODE_DISTRIBUTION table in the hidden node (NODE_TYPE = 22). Each row of the NODE_DISTRIBUTION
table contains the ID of an input attribute node.
Similarly, you can determine which hidden layers are related to an output attribute by viewing the
NODE_DISTRIBUTION table in the output node (NODE_TYPE = 23). Each row of the NODE_DISTRIBUTION
table contains the ID of a hidden layer node, together with the related coefficient.
See Also
Microsoft Neural Network Algorithm
Microsoft Neural Network Algorithm Technical Reference
Neural Network Model Query Examples
Neural Network Model Query Examples
11/28/2018 • 9 minutes to read • Edit Online
NOTE
You must enclose the name of the nested table columns SUPPORT and PROBABILITY in brackets to distinguish them from
the reserved keywords of the same name.
Example results:
For a definition of what the columns in the schema rowset mean in the context of a neural network model, see
Mining Model Content for Neural Network Models (Analysis Services - Data Mining).
Sample Query 2: Retrieving Model Metadata from the Schema Rowset
You can find the same information that is returned in a DMX content query by querying the data mining schema
rowset. However, the schema rowset provides some additional columns. The following sample query returns the
date that the model was created, the date it was modified, and the date that the model was last processed. The
query also returns the predictable columns, which are not easily available from the model content, and the
parameters that were used to build the model. This information can be useful for documenting the model.
Example results:
Grade Of Service,
Number Of Orders
MAXIMUM_INPUT_ATTRIBUTES=255,
MAXIMUM_OUTPUT_ATTRIBUTES=255,
MAXIMUM_STATES=100, SAMPLE_SIZE=10000,
HIDDEN_NODE_RATIO=4
SELECT NODE_DESCRIPTION
FROM [Call Center Default NN].CONTENT
WHERE NODE_TYPE = 2
Example results:
NODE_DESCRIPTION
Day Of Week=Fri.
Level 1 Operators
Only a few representative rows from the results are shown here. However, you can see that the
NODE_DESCRIPTION provides slightly different information depending on the data type of the input attribute.
If the attribute is a discrete or discretized value, the attribute and either its value or its discretized range are
returned.
If the attribute is a continuous numeric data type, the NODE_DESCRIPTION contains only the attribute
name. However, you can retrieve the nested NODE_DISTRIBUTION table to obtain the mean, or return
the NODE_RULE to obtain the minimum and maximum values of the numeric range.
The following query shows how to query the nested NODE_DISTRIBUTION table to return the attributes in one
column, and their values in another column. For continuous attributes, the value of the attribute is represented by
its mean.
SELECT FLATTENED
(SELECT ATTRIBUTE_NAME, ATTRIBUTE_VALUE
FROM NODE_DISTRIBUTION) as t
FROM [Call Center Default NN -- Predict Service and Orders].CONTENT
WHERE NODE_TYPE = 21
Example results:
T.ATTRIBUTE_NAME T.ATTRIBUTE_VALUE
The minimum and maximum range values are stored in the NODE_RULE column, and are represented as an
XML fragment, as shown in the following example:
Example results:
70000000200000000 0.188805045 7
The partial results shown here demonstrate how the neural network model content relates the hidden node to the
input nodes.
The unique names of nodes in the hidden layer always begin with 70000000.
The unique names of nodes in the input layer always begin with 60000000.
Thus, these results tell you that the node denoted by the ID 70000000200000000 had six different coefficients
(VALUETYPE = 7) passed to it. The values of the coefficients are in the ATTRIBUTE_VALUE column. You can
determine exactly which input attribute the coefficient is for by using the node ID in the ATTRIBUTE_NAME
column. For example, the node ID 6000000000000000a refers to input attribute and value, Day of Week = 'Tue.'
You can use the node ID to create a query, or you can browse to the node by using the Microsoft Generic Content
Tree Viewer.
Similarly, if you query the NODE_DISTRIBUTION table of the nodes in the output layer (NODE_TYPE = 23), you
can see the coefficients for each output value. However, in the output layer, the pointers refer back to the nodes of
the hidden layer. For more information, see Mining Model Content for Neural Network Models (Analysis
Services - Data Mining).
Example results:
364 0.9532...
The predicted sales volume is higher than the current range of sales for Tuesday, and the probability of the
prediction is very high. However, you might want to create multiple predictions by using a batch process to test a
variety of hypotheses on the model.
NOTE
The Data Mining Add-Ins for Excel 2007 provide logistic regression wizards that make it easy to answer complex questions,
such as how many Level Two Operators would be needed to improve service grade to a target level for a specific shift. The
data mining add-ins are a free download, and include wizards that are based on the neural network and/or logistic
regression algorithms. For more information, see the Data Mining Add-ins for Office 2007 Web site.
PredictStdev (DMX) Returns the standard deviance for the predicted value.
PredictSupport (DMX) For neural network and logistic regression models, returns a
single value that represents the size of the training set for the
entire model.
For a list of the functions that are common to all Microsoft algorithms, see Algorithm Reference (Analysis
Services - Data Mining). For the syntax of specific functions, see Data Mining Extensions (DMX) Function
Reference.
See Also
Microsoft Neural Network Algorithm
Microsoft Neural Network Algorithm Technical Reference
Mining Model Content for Neural Network Models (Analysis Services - Data Mining)
Lesson 5: Building Neural Network and Logistic Regression Models (Intermediate Data Mining Tutorial)
Microsoft Sequence Clustering Algorithm
5/16/2018 • 5 minutes to read • Edit Online
Example
The Adventure Works Cycles web site collects information about what pages site users visit, and about the order
in which the pages are visited. Because the company provides online ordering, customers must log in to the site.
This provides the company with click information for each customer profile. By using the Microsoft Sequence
Clustering algorithm on this data, the company can find groups, or clusters, of customers who have similar
patterns or sequences of clicks. The company can then use these clusters to analyze how users move through the
Web site, to identify which pages are most closely related to the sale of a particular product, and to predict which
pages are most likely to be visited next.
Creating Predictions
After the model has been trained, the results are stored as a set of patterns. You can use the descriptions of the
most common sequences in the data to predict the next likely step of a new sequence. However, because the
algorithm includes other columns, you can use the resulting model to identify relationships between sequenced
data and inputs that are not sequential. For example, if you add demographic data to the model, you can make
predictions for specific groups of customers. Prediction queries can be customized to return a variable number of
predictions, or to return descriptive statistics.
For information about how to create queries against a data mining model, see Data Mining Queries. For
examples of how to use queries with a sequence clustering model, see Sequence Clustering Model Query
Examples.
Remarks
Does not support the use of Predictive Model Markup Language (PMML ) to create mining models.
Supports drillthrough.
Supports the use of OLAP mining models and the creation of data mining dimensions.
See Also
Data Mining Algorithms (Analysis Services - Data Mining)
Microsoft Sequence Clustering Algorithm Technical Reference
Sequence Clustering Model Query Examples
Browse a Model Using the Microsoft Sequence Cluster Viewer
Microsoft Sequence Clustering Algorithm Technical
Reference
11/27/2018 • 7 minutes to read • Edit Online
MINIMUM_SUPPORT
Specifies the minimum number of cases that is required in support of an attribute to create a cluster.
The default is 10.
MAXIMUM_SEQUENCE_STATES
Specifies the maximum number of states that a sequence can have.
Setting this value to a number greater than 100 may cause the algorithm to create a model that does not provide
meaningful information.
The default is 64.
MAXIMUM_STATES
Specifies the maximum number of states for a non-sequence attribute that the algorithm supports. If the number
of states for a non-sequence attribute is greater than the maximum number of states, the algorithm uses the
attribute's most popular states and treats the remaining states as Missing.
The default is 100.
Modeling Flags
The following modeling flags are supported for use with the Microsoft Sequence Clustering algorithm.
NOT NULL
Indicates that the column cannot contain a null. An error will result if Analysis Services encounters a null during
model training.
Applies to the mining structure column.
MODEL_EXISTENCE_ONLY
Means that the column will be treated as having two possible states: Missing and Existing. A null is treated as a
Missing value.
Applies to the mining model column.
For more information about the use of Missing values in mining models, and how missing values affect
probability scores, see Missing Values (Analysis Services - Data Mining).
Requirements
The case table must have a case ID column. Optionally the case table can contain other columns that store
attributes about the case.
The Microsoft Sequence Clustering algorithm requires sequence information, stored as a nested table. The
nested table must have a single Key Sequence column. A Key Sequence column can contain any type of data
that can be sorted, including string data types, but the column must contain unique values for each case.
Moreover, before you process the model, you must ensure that both the case table and the nested table are
sorted in ascending order on the key that relates the tables.
NOTE
If you create a model that uses the Microsoft Sequence algorithm but do not use a sequence column, the resulting model
will not contain any sequences, but will simply cluster cases based on other attributes that are included in the model.
Remarks
Use the PredictSequence (DMX) function for Prediction of Sequences. For more information about the
editions of SQL Server that support Sequence Prediction, see Features Supported by the Editions of SQL
Server 2012 (http://go.microsoft.com/fwlink/?linkid=232473).
The Microsoft Sequence Clustering algorithm does not support using the Predictive Model Markup
Language (PMML ) to create mining models.
The Microsoft Sequence Clustering algorithm supports drillthrough, the use of OLAP mining models, and
the use of data mining dimensions.
See Also
Microsoft Sequence Clustering Algorithm
Sequence Clustering Model Query Examples
Mining Model Content for Sequence Clustering Models (Analysis Services - Data Mining)
Mining Model Content for Sequence Clustering
Models
5/16/2018 • 12 minutes to read • Edit Online
The algorithm also creates a number of clusters, based on the transitions that were found in the data and any
other input attributes included when creating the model, such as customer demographics and so forth. Each
cluster (NODE_TYPE = 5) contains its own sequence node (NODE_TYPE = 13) that lists only the transitions that
were used in generating that specific cluster. From the sequence node, you can drill down to view the details of
individual state transitions (NODE_TYPE = 14).
For an explanation of sequence and state transitions, with examples, see Microsoft Sequence Clustering
Algorithm.
NODE_GUID
Blank.
NODE_CAPTION
A label or a caption associated with the node for display purposes.
You can rename the cluster captions while you are using the model; however, the new name is not persisted if you
close the model.
CHILDREN_CARDINALITY
An estimate of the number of children that the node has.
Model root Cardinality value equals the number of clusters plus one. For more information, see Cardinality.
Cluster nodes Cardinality is always 1, because each cluster has a single child node, which contains the list of
sequences in the cluster.
Sequence nodes Cardinality indicates the number of transitions that are included in that cluster. For example, the
cardinality of the sequence node for the model root tells you how many transitions were found in the entire
model.
PARENT_UNIQUE_NAME
The unique name of the node's parent.
NULL is returned for any nodes at the root level.
NODE_DESCRIPTION
Same as node caption.
NODE_RULE
Always blank.
MARGINAL_RULE
Always blank.
NODE_PROBABILITY
Model root Always 0.
Cluster nodes The adjusted probability of the cluster in the model. The adjusted probabilities do not sum to 1,
because the clustering method used in sequence clustering permits partial membership in multiple clusters.
Sequence nodes Always 0.
Transition nodes Always 0.
MARGINAL_PROBABILITY
Model root Always 0.
Cluster nodes The same value as NODE_PROBABILITY.
Sequence nodes Always 0.
Transition nodes Always 0.
NODE_DISTRIBUTION
A table that contains probabilities and other information. For more information, see NODE_DISTRIBUTION
Table.
NODE_SUPPORT
The number of transitions that support this node. Therefore, if there are 30 examples of sequence "Product A
followed by Product B" in the training data, the total support is 30.
Model root Total number of transitions in the model.
Cluster nodes Raw support for the cluster, meaning the number of training cases that contribute cases to this
cluster.
Sequence nodes Always 0.
Transition nodes Percentage of cases in the cluster that represent a specific transition. Can be 0, or can have a
positive value. Calculated by taking the raw support for the cluster node, and multiplying by the probability of the
cluster.
From this value, you can tell how many training cases contributed to the transition.
MSOLAP_MODEL_COLUMN
Not applicable.
MSOLAP_NODE_SCORE
Not applicable.
MSOLAP_NODE_SHORT_CAPTION
Same as NODE_DESCRIPTION.
Model root Multiple cluster nodes Lists all products in the model, with
support and probability.
Node with sequences for entire model
Because the clustering method permits
partial membership in multiple clusters,
support and probability can have
fractional values. That is, instead of
counting a single case once, each case
can potentially belong to multiple
clusters. Therefore, when the final
cluster membership is determined, the
value is adjusted by the probability of
that cluster.
Sequence node for model Multiple transition nodes Lists all products in the model, with
support and probability.
Individual cluster nodes Node with sequences for that cluster Lists all products in a cluster, but
only provides support and probability values
only for products that are characteristic
of the cluster.
Sequence nodes for individual clusters Multiple nodes with transitions for Exactly the same information as in
sequences in that cluster only individual cluster nodes.
NODE_DISTRIBUTION Table
The NODE_DISTRIBUTION table provides detailed probability and support information for the transitions and
sequences for a specific cluster.
A row is always added to the transition table to represent possible Missing values. For information about what
the Missing value means, and how it affects calculations, see Missing Values (Analysis Services - Data Mining).
The calculations for support and probability differ depending on whether the calculation applies to the training
cases or to the finished model. This is because the default clustering method, Expectation Maximization (EM ),
assumes that any case can belong to more than one cluster. When calculating support for the cases in the model,
it is possible to use raw counts and raw probabilities. However, the probabilities for any particular sequence in a
cluster must be weighted by the sum of all possible sequence and cluster combinations.
Cardinality
In a clustering model, the cardinality of the parent node generally tells you how many clusters are in the model.
However, a sequence clustering model has two kinds of nodes at the cluster level: one kind of node contains
clusters, and the other kind of node contains a list of sequences for the model as a whole.
Therefore, to learn the number of clusters in the model, you can take the value of NODE_CARDINALITY for the
(All) node and subtract one. For example, if the model created 9 clusters, the cardinality of the model root is 10.
This is because the model contains 9 cluster nodes, each with its own sequence node, plus one additional
sequence node labeled cluster 10, which represents the sequences for the model.
Walkthrough of Structure
An example might help clarify how the information is stored, and how you can interpret it. For example, you can
find the largest order, meaning the longest observed chain in the underlying AdventureWorksDW2012 data, by
using the following query:
USE AdventureWorksDW2012
SELECT DISTINCT OrderNumber, Count(*)
FROM vAssocSeqLineItems
GROUP BY OrderNumber
ORDER BY Count(*) DESC
From these results, you find that the order numbers 'SO72656', 'SO58845', and 'SO70714' contain the largest
sequences, with eight items each. By using the order IDs, you can view the details of a particular order to see
which items were purchased, and in what order.
SO58845 1 Mountain-500
SO58845 7 Sport-100
However, some customers who purchase the Mountain-500 might purchase different products. You can view all
the products that follow the Mountain-500 by viewing the list of sequences in the model. The following
procedures walk you through viewing these sequences by using the two viewers provided in Analysis Services:
To view related sequences by using the Sequence Clustering viewer
1. In Object Explorer, right-click the [Sequence Clustering] model, and select Browse.
2. In the Sequence Clustering viewer, click the State Transitions tab.
3. In the Cluster dropdown list, ensure that Population (All) is selected.
4. Move the slider bar at the left of the pane all the way to the top, to show all links.
5. In the diagram, locate Mountain-500, and click the node in the diagram.
6. The highlighted lines point to the next states (the products that were purchased after the Mountain-500)
and the numbers indicate the probability. Compare these to the results in the generic model content viewer.
To view related sequences by using the generic model content viewer
1. In Object Explorer, right-click the [Sequence Clustering] model, and select Browse.
2. In the viewer dropdown list, select the Microsoft Generic Content Tree Viewer.
3. In the Node caption pane, click the node named Sequence level for cluster 16.
4. In the Node details pane, find the NODE_DISTRIBUTION row, and click anywhere in the nested table.
The top row is always for the Missing value. This row is sequence state 0.
5. Press the down arrow key, or use the scroll bars, to move down through the nested table until you see the
row, Mountain-500.
This row is sequence state 20.
NOTE
You can obtain the row number for a particular sequence state programmatically, but if you are just browsing, it
might be easier to simply copy the nested table into an Excel workbook.
6. Return to the Node caption pane, and expand the node, Sequence level for cluster 16, if it is not already
expanded.
7. Look among its child nodes for Transition row for sequence state 20. Click the transition node.
8. The nested NODE_DISTRIBUTION table contains the following products and probabilities. Compare these
to the results in the State Transition tab of the Sequence Clustering viewer.
The following table shows the results from the NODE_DISTRIBUTION table, together with the rounded
probability values that are displayed in the graphical viewer.
SUPPORT PROBABILITY
PRODUCT (NODE_DISTRIBUTION TABLE) (NODE_DISTRIBUTION) TABLE) PROBABILITY (FROM GRAPH)
Although the case that we initially selected from the training data contained the product 'Mountain-500' followed
by 'LL Mountain Tire', you can see that there are many other possible sequences. To find detailed information for
any particular cluster, you must repeat the process of drilling down from the list of sequences in the cluster to the
actual transitions for each state, or product.
You can jump from the sequence listed in one particular cluster, to the transition row. From that transition row,
you can determine which product is next, and jump back to that product in the list of sequences. By repeating this
process for each first and second state you can work through long chains of states.
See Also
Mining Model Content (Analysis Services - Data Mining)
Microsoft Sequence Clustering Algorithm
Sequence Clustering Model Query Examples
Sequence Clustering Model Query Examples
5/16/2018 • 13 minutes to read • Edit Online
SELECT MINING_PARAMETERS
from $system.DMSCHEMA_MINING_MODELS
WHERE MODEL_NAME = 'Sequence Clustering'
Example results:
MINING_PARAMETERS
CLUSTER_COUNT=15,MINIMUM_SUPPORT=10,MAXIMUM_STATES=100,MAXIMUM_SEQUENCE_STATES=64
Note that this model was built by using the default value of 10 for CLUSTER_COUNT. When you specify a non-
zero number of clusters for CLUSTER_COUNT, the algorithm treats this number as a hint for the approximate
number of clusters to find. However, in the process of analysis, the algorithm may find more or fewer clusters. In
this case, the algorithm found that 15 clusters best fit the training data. Therefore, the list of parameter values for
the completed model reports the count of clusters as determined by the algorithm, not the value passed in when
creating the model.
How does this behavior differ from letting the algorithm determine the best number of clusters? As an
experiment, you can create another clustering model that uses this same data, but set CLUSTER_COUNT to 0.
When you do this, the algorithm detects 32 clusters. Therefore, by using the default value of 10 for
CLUSTER_COUNT, you constrain the number of results.
The value of 10 is used by default because reducing the number of clusters makes it easier for most people to
browse and understand groupings in the data. However, each model and set of data is different. You may wish to
experiment with different numbers of clusters to see which parameter value yields the most accurate model.
Sample Query 2: Getting a List of Sequences for a State
The mining model content stores the sequences that are found in the training data as a first state coupled with a
list of all related second states. The first state is used as the label for the sequence, and the related second states
are called transitions.
For example, the following query returns the complete list of first states in the model, before the sequences are
grouped into clusters. You can get this list by returning the list of sequences (NODE_TYPE = 13) that have the
model root node as parent (PARENT_UNIQUE_NAME = 0). The FLATTENED keyword makes the results easier
to read.
NOTE
The name of the columns, PARENT_UNIQUE_NAME, Support, and Probability must be enclosed in brackets to distinguish
them from the reserved keywords of the same name.
Partial results:
The list of sequences in the model is always sorted alphabetically in ascending order. The ordering of the
sequences is important because you can find the related transitions by looking at the order number of the
sequence. The Missing value is always transition 0.
For example, in the previous results, the product "Women's Mountain Shorts" is the sequence number 37 in the
model. You can use that information to view all of the products that were ever purchased after "Women's
Mountain Shorts."
To do this, first, you reference the value returned for NODE_UNIQUE_NAME in the previous query, to get the ID
of the node that contains all sequences for the model. You pass this value to the query as the ID of the parent
node, to get only the transitions included in this node, which happens to contain a list of al sequences for the
model. However, if you wanted to see the list of transitions for a specific cluster, you could pass in the ID of the
cluster node, and see only the sequences associated with that cluster.
SELECT NODE_UNIQUE_NAME
FROM [Sequence Clustering].CONTENT
WHERE NODE_DESCRIPTION = 'Transition row for sequence state 37'
AND [PARENT_UNIQUE_NAME] = '1081327'
Example results:
NODE_UNIQUE_NAME
1081365
The node represented by this ID contains a list of the sequences that follow the "Women's Mountain Shorts"
product, together with the support and probability values.
SELECT FLATTENED
(SELECT ATTRIBUTE_VALUE AS Product2,
[Support] AS [P2 Support],
[Probability] AS [P2 Probability]
FROM NODE_DISTRIBUTION) AS t
FROM [Sequence Clustering].CONTENT
WHERE NODE_UNIQUE_NAME = '1081365'
Example results:
Note that support for the various sequences related to Women's Mountain Shorts is 506 in the model. The
support values for the transitions also add up to 506. However, the numbers are not whole numbers, which
seems a bit odd if you expect support to simply represent a count of cases that contain each transition. However,
because the method for creating clusters calculates partial membership, the probability of any transition within a
cluster must be weighted by its probability of belonging to that particular cluster.
For example, if there are four clusters, a particular sequence might have a 40% chance of belonging to cluster 1, a
30% chance of belonging to cluster 2, a 20% chance of belonging to cluster 3, and a 10% chance of belonging to
cluster 4. After the algorithm determines the cluster that the transition is mostly likely to belong to, it weights the
probabilities within the cluster by the cluster prior probability.
Sample Query 3: Using System Stored Procedures
You can see from these query samples that the information stored in the model is complex, and that you might
need to create multiple queries to get the information that you need. However, the Microsoft Sequence
Clustering viewer provides a powerful set of tools for graphically browsing the information contained in a
sequence clustering model, and you can also use the viewer to query and drill down into the model.
In most cases, the information that is presented in the Microsoft Sequence Clustering viewer is created by using
Analysis Services system stored procedures to query the model. You can write Data Mining Extensions (DMX)
queries against the model content to retrieve the same information, but the Analysis Services system stored
procedures provide a convenient shortcut when for exploration or for testing models.
NOTE
System stored procedures are used for internal processing by the server and by the clients that Microsoft provides for
interacting with the Analysis Services server. Therefore, Microsoft reserves the right to change them at any time. Although
they are described here for your convenience, we do not support their use in a production environment. To ensure stability
and compatibility in a production environment, you should always write your own queries by using DMX.
This section provides some samples of how to use the system stored procedures to create queries against a
sequence clustering model:
Cluster Profiles and Sample Cases
The Cluster Profiles tab shows you a list of the clusters in the model, the size of each cluster, and a histogram that
indicates the states included in the cluster. There are two system stored procedures that you can use in queries to
retrieve similar information:
returns the characteristics of the cluster, with all the information that is found in the
GetClusterProfile
NODE_DISTRIBUTION table for the cluster.
GetNodeGraph returns nodes and edges that can be used to construct a mathematical graph representation
of the clusters, corresponding to what you see on the first tab of the Sequence Clustering view. The nodes
are clusters, and the edges represent weights or strength.
The following example illustrates how to use the system stored procedure, GetClusterProfiles , to return all of
the clusters in the model, with their respective profiles. This stored procedure executes a series of DMX
statements that return the complete set of profiles in the model. However, to use this stored procedure you must
know the address of the model.
CALL System.Microsoft.AnalysisServices.System.DataMining.Clustering.GetClusterProfiles('Sequence Clustering',
2147483647, 0)
The following example illustrates how to retrieve the profile for a specific cluster, Cluster 12, by using the system
stored procedure GetNodeGraph , and specifying the cluster ID, which is usually the same as the number in the
cluster name.
CALL System.Microsoft.AnalysisServices.System.DataMining.Clustering.GetNodeGraph('Sequence
Clustering','12',0)
If you omit the cluster ID, as shown in the following query, GetNodeGraph returns an ordered, flattened list of all
cluster profiles:
The Cluster Profile tab also displays a histogram of model sample cases. These sample cases represent the
idealized cases for the model. These cases are not stored in the model the same way that the training data is; you
must use a special syntax to retrieve the sample cases for the model.
CALL System.Microsoft.AnalysisServices.System.DataMining.Clustering.GetClusterCharacteristics('Sequence
Clustering','12',0.0005)
To return the characteristics of all clusters, you can leave the cluster ID empty.
CALL System.Microsoft.AnalysisServices.System.DataMining.Clustering.GetClusterCharacteristics('Sequence
Clustering','',0.0005)
The following example calls the system stored procedure GetClusterDiscrimination to compare the
characteristics of Cluster 1 and Cluster 12.
CALL System.Microsoft.AnalysisServices.System.DataMining.Clustering.GetClusterDiscrimination('Sequence
Clustering','1','12',0.0005,true)
If you want to write your own query in DMX to compare two clusters, or compare a cluster with its complement,
you must first retrieve one set of characteristics, and then retrieve the characteristics for the specific cluster that
you are interested in, and compare the two sets. This scenario is more complicated and typically requires some
client processing.
States and Transitions
The State Transitions tab of the Microsoft Sequence Clustering performs complicated queries on the back end
to retrieve and compare the statistics for different clusters. To reproduce these results requires a more complex
query and some client processing.
However, you can use the DMX queries described in Example 2 of the section, Content Queries, to retrieve
probabilities and states for sequences or for individual transitions.
Using the Model to Make Predictions
Prediction queries on a sequence clustering model can use many of the prediction functions that are used with
other clustering models. In addition, you can use the special prediction function, PredictSequence (DMX), to
make recommendations or to predict next states.
Sample Query 4: Predict Next State or States
You can use the PredictSequence (DMX) function to predict the next most likely state, given a value. You can also
predict multiple next states: for example, you can return a list of the top three products that a customer is likely to
purchase, to present a list of recommendations.
The following sample query is a singleton prediction query that returns the top five predictions, together with
their probability. Because the model includes a nested table, you must use the nested table,
[v Assoc Seq Line Items] , as the column reference when making predictions. Also, when you supply values as
input, you must join both the case table and the nested table columns, as shown by the nested SELECT
statements.
Example results:
1 Cycling Cap
2 Cycling Cap
3 Sport-100
5 Half-Finger Gloves
There are three columns in the results, even though you might only expect one column, because the query always
returns a column for the case table. Here the results are flattened; otherwise, the query would return a single
column that contains two nested table columns.
The column $sequence is a column returned by default by the PredictSequence function to order the prediction
results. The column, [Line Number] , is required to match the sequence keys in the model, but the keys are not
output.
Interestingly, the top predicted sequences after All-Purpose Bike Stand are Cycling Cap and Cycling Cap. This is
not an error. Depending on how the data is presented to the customer, and how it is grouped when training the
model, it is very possible to have sequences of this kind. For example, a customer might purchase a cycling cap
(red) and then another cycling cap (blue), or purchase two in a row if there were no way to specify quantity.
The values in rows 6 and 7 are placeholders. When you reach the end of the chain of possible transitions, rather
than terminating the prediction results, the value that was passed as an input is added to the results. For example,
if you increased the number of predictions to 20, the values for rows 6-20 would all be the same, All-Purpose
Bike Stand.
Function List
All Microsoft algorithms support a common set of functions. However, the Microsoft Sequence Clustering
algorithm supports the additional functions that are listed in the following table.
Cluster (DMX) Returns the cluster that is most likely to contain the input
case
ClusterDistance (DMX) Returns the distance of the input case from the specified
cluster, or if no cluster is specified, the distance of the input
case from the most likely cluster.
ClusterProbability (DMX) Returns the probability that the input case belongs to the
specified cluster.
IsInNode (DMX) Indicates whether the specified node contains the current
case.
PredictCaseLikelihood (DMX) Returns the likelihood that an input case will fit in the existing
model.
PredictHistogram (DMX) Returns a table that represents a histogram for the prediction
of a given column.
PredictNodeId (DMX) Returns the Node_ID of the node to which the case is
classified.
PredictStdev (DMX) Returns the predicted standard deviation for the specified
column.
See Also
Data Mining Queries
Microsoft Sequence Clustering Algorithm Technical Reference
Microsoft Sequence Clustering Algorithm
Mining Model Content for Sequence Clustering Models (Analysis Services - Data Mining)
Microsoft Time Series Algorithm
5/16/2018 • 10 minutes to read • Edit Online
An important feature of the Microsoft Time Series algorithm is that it can perform cross prediction. If you train
the algorithm with two separate, but related, series, you can use the resulting model to predict the outcome of
one series based on the behavior of the other series. For example, the observed sales of one product can
influence the forecasted sales of another product. Cross prediction is also useful for creating a general model that
can be applied to multiple series. For example, the predictions for a particular region are unstable because the
series lacks good quality data. You could train a general model on an average of all four regions, and then apply
the model to the individual series to create more stable predictions for each region.
Example
The management team at Adventure Works Cycles wants to predict monthly bicycle sales for the coming year.
The company is especially interested in whether the sale of one bike model can be used to predict the sale of
another model. By using the Microsoft Time Series algorithm on historical data from the past three years, the
company can produce a data mining model that forecasts future bike sales. Additionally, the company can
perform cross predictions to see whether the sales trends of individual bike models are related.
Each quarter, the company plans to update the model with recent sales data and update their predictions to
model recent trends. To correct for stores that do not accurately or consistently update sales data, they will create
a general prediction model, and use that to create predictions for all regions.
How the Algorithm Works
In SQL Server 2005 (9.x), the Microsoft Time Series algorithm used a single auto-regressive time series method,
named ARTXP. The ARTXP algorithm was optimized for short-term predictions, and therefore, excelled at
predicting the next likely value in a series. Beginning in SQL Server 2008, the Microsoft Time Series algorithm
added a second algorithm, ARIMA, which was optimized for long-term prediction. For a detailed explanation
about the implementation of the ARTXP and ARIMA algorithms, see Microsoft Time Series Algorithm Technical
Reference.
By default, the Microsoft Time Series algorithm uses a mix of the algorithms when it analyzes patterns and
making predictions. The algorithm trains two separate models on the same data: one model uses the ARTXP
algorithm, and one model uses the ARIMA algorithm. The algorithm then blends the results of the two models to
yield the best prediction over a variable number of time slices. Because ARTXP is best for short-term predictions,
it is weighted more heavily at the beginning of a series of predictions. However, as the time slices that you are
predicting move further into the future, ARIMA is weighted more heavily.
You can also control the mix of algorithms to favor either short- or long-term prediction in the times series.
Beginning in SQL Server 2008 Standard, you can specify that which algorithm to use:
Use only ARTXP for short-term prediction.
Use only ARIMA for long-term prediction.
Use the default blending of the two algorithms.
Beginning in SQL Server 2008 Enterprise, you can also customize how the Microsoft Time Series algorithm
blends the models for prediction. When you use a mixed model, the Microsoft Time Series algorithm blends the
two algorithms in the following way:
Only ARTXP is always used for making the first couple of predictions.
After the first couple of predictions, a combination of ARIMA and ARTXP is used.
As the number of prediction steps increases, predictions rely more heavily on ARIMA until ARTXP is no
longer used.
You control the mixing point, the rate at which the weight of ARTXP is decreased, and the weight of
ARIMA is increased by setting the PREDICTION_SMOOTHING parameter.
Both algorithms can detect seasonality in data at multiple levels. For example, your data might contain monthly
cycles nested within yearly cycles. To detect these seasonal cycles, you can either provide a periodicity hint or
specify that the algorithm should automatically detect periodicity.
In addition to periodicity, there are several other parameters that control the behavior of the Microsoft Time
Series algorithm when it detects periodicity, makes predictions, or analyzes cases. For information about how to
set algorithm parameters, see Microsoft Time Series Algorithm Technical Reference.
The TimeID column in the table contains a time identifier, and has two entries for each day. The TimeID column
becomes the case series. Therefore, you would designate this column as the key time column for the time series
model.
The Product column defines a product in the database. This column contains the product series. Therefore, you
would designate this column as a second key for the time series model.
The Sales column describes the gross profits of the specified product for one day, and the Volume column
describes the quantity of the specified product that remains in the warehouse. These two columns contain the
data that is used to train the model. Both Sales and Volume can be predictable attributes for each series in the
Product column.
Example 2: Time Series Data Set with Each Series in Separate Column
Although this example uses basically the same input data as the first example, the input data is structured
differently, as shown in the following table:
In this table, the TimeID column still contains the case series for the time series model, which you designate as
the key time column. However, the previous Sales and Volume columns are now split into two columns and each
of those columns are preceded by the product name. As a result, only a single entry exists for each day in the
TimeID column. This creates a time series model that would contain four predictable columns: A_Sales,
A_Volume, B_Sales, and B_Volume.
Furthermore, because you have separated the products into different columns, you do not have to specify an
additional series key column. All the columns in the model are either a case series column or a predictable
column.
See Also
Data Mining Algorithms (Analysis Services - Data Mining)
Browse a Model Using the Microsoft Time Series Viewer
Microsoft Time Series Algorithm Technical Reference
Time Series Model Query Examples
Mining Model Content for Time Series Models (Analysis Services - Data Mining)
Microsoft Time Series Algorithm Technical
Reference
11/28/2018 • 14 minutes to read • Edit Online
NOTE
The Microsoft Time Series algorithm is available in all editions of SQL Server; however, some advanced features, including
parameters for customizing the time series analysis, are supported only in specific editions of SQL Server. For a list of
features that are supported by the editions of SQL Server, see Features Supported by the Editions of SQL Server.
Detection of Seasonality
Both ARIMA and ARTXP algorithms support detection of seasonality or periodicity. Analysis Services uses Fast
Fourier transformation to detect seasonality before training. However, you can affect seasonality detection, and
the results of time series analysis, by setting algorithm parameters.
By changing the value of AUTODETECT_SEASONALITY, you can influence the number of possible time
segments that are generated.
By setting a value or multiple values for PERIODICITY_HINT, you can provide the algorithm with
information about expected cycles in the data and potentially increase the accuracy of detection.
NOTE
Both the ARTXP and ARIMA algorithms are very sensitive to seasonality hints. Therefore, providing the wrong hint can
adversely affect results.
In contrast, the following diagram illustrates the blending of the algorithms when PREDICTION_SMOOTHING
is set to 0.2. For step 0, the model weights ARIMA as 0.2 and ARTXP as 0.8. Thereafter, the weight of ARIMA
exponentially increases and the weight of ARTXP exponentially decreases.
PARAMETER DESCRIPTION
COMPLEXITY_PENALTY Controls the growth of the decision tree. The default is 0.1.
HISTORIC_MODEL_COUNT Specifies the number of historic models that will be built. The
default is 1.
Note that the braces are required. Also, this parameter has a
string data type. Therefore, if you type this parameter as
part of a Data Mining Extensions (DMX) statement, you
must enclose the number and braces in quotation marks.
PARAMETER DESCRIPTION
0:
Specifies that prediction uses ARTXP only. Forecasting is
optimized for fewer predictions.
Modeling Flags
The Microsoft Time Series algorithm supports the following modeling flags. When you create the mining
structure or mining model, you define modeling flags to specify how values in each column are handled during
analysis. For more information, see Modeling Flags (Data Mining).
NOT NULL Indicates that the column cannot contain a null. An error will
result if Analysis Services encounters a null during model
training.
Requirements
A time series model must contain a key time column that contains unique values, input columns, and at least
one predictable column.
Input and Predictable Columns
The Microsoft Time Series algorithm supports the specific input column content types, predictable column
content types, and modeling flags that are listed in the following table.
See Also
Microsoft Time Series Algorithm
Time Series Model Query Examples
Mining Model Content for Time Series Models (Analysis Services - Data Mining)
Mining Model Content for Time Series Models
(Analysis Services - Data Mining)
11/28/2018 • 25 minutes to read • Edit Online
WARNING
The name (All) on the ARTXP tree is retained only for backward compatibility. Prior to SQL Server 2008, the Time Series
algorithm used a single algorithm for analysis, the ARTXP algorithm.
The following sections explain how the nodes are arranged within each of these model types.
Structure of an ARTXP Model
The ARTXP algorithm creates a model similar to a decision trees model. It groups predictable attributes and splits
them whenever significant differences are found. Therefore, each ARTXP model contains a separate branch for
each predictable attribute. For example, the Basic Data Mining tutorial creates a model that predicts the amount
of sales for several regions. In this case, [Amount] is the predictable attribute and a separate branch is created
for each region. If you had two predictable attributes, [Amount] and [Quantity], a separate branch would be
created for each combination of an attribute and a region.
The top node for the ARTXP branch contains the same information that is in a decision tree root node. This
includes the number of children for that node (CHILDREN_CARDINALITY ), the number of cases that meet the
conditions of this node (NODE_SUPPORT), and a variety of descriptive statistics (NODE_DISTRIBUTION ).
If the node does not have any children, this means that no significant conditions were found that would justify
dividing the cases into further subgroups. The branch ends at this point and the node is termed a leaf node. The
leaf node contains the attributes, coefficients, and values that are the building blocks of the ARTXP formula.
Some branches may have additional splits, similar to a decision trees model. For example, the branch of the tree
that represents sales for the Europe region splits into two branches. A split occurs when a condition is found that
causes a significant difference between the two groups. The parent node tells you the name of the attribute that
caused the split, such as [Amount], and how many cases there are in the parent node. The leaf nodes provide
more detail: the value of the attribute, such as [Sales] >10,000 vs. [Sales] < 10,000), the number of cases that
support each condition, and the ARTXP formula.
NOTE
If you want to view the formulas, you can find the complete regression formula at the leaf node level, but not in an
intermediate or root node.
NODE_TYPE
A time series model outputs the following node types, depending on the algorithm.
ARTXP:
ARIMA:
28 (ARIMA Periodic Structure) Component of an ARIMA tree that describes a single periodic
structure.
NODE_CAPTION
A label or caption that is associated with the node.
This property is primarily for display purposes.
ARTXP: Contains the split condition for the node, displayed as a combination of attribute and value range.
ARIMA: Contains the short form of the ARIMA equation.
For information about the format of the ARIMA equation, see Mining Legend for ARIMA.
CHILDREN_CARDINALITY
The number of direct children that the node has.
PARENT_UNIQUE_NAME
The unique name of the node's parent. NULL is returned for any nodes at the root level.
NODE_DESCRIPTION
A description in text of the rules, splits, or formulas in the current node.
ARTXP: For more information, see Understanding the ARTXP Tree.
ARIMA: For more information, see Understanding the ARIMA Tree.
NODE_RULE
An XML description of the rules, splits, or formulas in the current node.
ARTXP: The NODE_RULE generally corresponds to the NODE_CAPTION.
ARIMA: For more information, see Understanding the ARIMA Tree.
MARGINAL_RULE
An XML description of the split or content that is specific to that node.
ARTXP: The MARGINAL_RULE generally corresponds to the NODE_DESCRIPTION.
ARIMA: Always blank; use NODE_RULE instead.
NODE_PROBABILITY
ARTXP: For tree nodes, always 1. For leaf nodes, the probability of reaching the node from the model root node.
ARIMA: Always 0.
MARGINAL_PROBABILITY
ARTXP: For tree nodes, always 1. For leaf nodes, the probability of reaching the node from the immediate parent
node.
ARIMA: Always 0.
NODE_DISTRIBUTION
A table that contains the probability histogram of the node. In a time series model, this nested table contains all
the components required to assemble the actual regression formula.
For more information about the node distribution table in an ARTXP tree, see Understanding the ARTXP Tree.
For more information about the node distribution table in an ARIMA tree, see Understanding the ARIMA Tree.
If you wish to see all the constants and other components composed into a readable format, use the Time Series
Viewer, click the node, and open the Mining Legend.
NODE_SUPPORT
The number of cases that support this node.
ARTXP: For the (All) node, indicates the total number of time slices included in the branch.
For terminal nodes, indicates the number of time slices that are included in the range that is described by
NODE_CAPTION. The number of time slices in the terminal nodes always sums to the NODE_SUPPORT value
of the branch (All) node.
ARIMA: A count of cases that support the current periodic structure. The value for support is repeated in all
nodes of the current periodic structure.
MSOLAP_MODEL_COLUMN
The predictable attribute for the data series represented in the node. (The same value as for ATTRIBUTE_NAME.)
MSOLAP_NODE_SCORE
A numeric value that characterizes the information value of the tree or split.
ARTXP: Value is always 0.0 for nodes without a split. For nodes with a split, the value represents the
interestingness score of the split.
For more information about scoring methods, see Feature Selection (Data Mining).
ARIMA: The Bayesian Information Criterion (BIC ) score of the ARIMA model. The same score is set on all the
ARIMA nodes related to the equation.
MSOLAP_NODE_SHORT_CAPTION
ARTXP: Same information as the NODE_DESCRIPTION.
ARIMA: Same information as the NODE_CAPTION: that is, the short form of the ARIMA equation.
In this case, the value 21.322 represents the value that is predicted for Quantity as a function of the following
elements of the equation.
For example, one element is Quantity(R250 North America,-7) . This notation means the quantity for the North
America region at t-7 , or seven time slices before the current time slice. The value for this data series is
multiplied by the coefficient -0.293. The coefficient for each element is derived during the training process and is
based on trends in the data.
There are multiple elements in this equation because the model has calculated that the quantity of the R250
model in the Europe region is dependent on the values of several other data series.
Model Content for an ARTXP Formula
The following table shows the same information for the formula, using the contents of the relevant node as
displayed in the Microsoft Generic Content Tree Viewer (Data Mining).
ATTRIBUTE_NAME ATTRIBUTE_VALUE SUPPORT PROBABILITY VARIANCE VALUETYPE
Quantity(R750 - 0 0 0 7 (Coefficient)
Europe,-8) 0.142120304829
9
Quantity(R250 - 0 0 0 7 (Coefficient)
North America,- 0.292914186039
7) 869
As you can see from comparing these examples, the mining model content contains the same information that is
available in the Mining Legend, but with additional columns for variance and support. The value for support
indicates the count of cases that support the trend described by this equation.
Using the ARTXP Time Series Formula
For most business users, the value of the ARTXP model content is that it combines both a tree view and a linear
representation of the data.
If the changes in the predictable attribute can be represented as a linear function of the independent
variables, the algorithm will automatically compute the regression equation and output that series in a
separate node
Whenever the relationship cannot be expressed as a linear correlation, the time series branches like a
decision tree.
By browsing the model content in the Microsoft Time Series Viewer you can see where the split occurs, and how
it affects the trend line.
If a direct correlation exists between time and sales for any part of the data series, the easiest way to get the
formula is to copy the formula from the Mining Legend, and then paste it into a document or presentation to
help explain the model. Alternatively, you could extract the mean, coefficient, and other information from the
NODE_DISTRIBUTION table for that tree and use it to compute extensions of the trend. If the entire series
exhibits a consistent linear relationship, the equation is contained in the (All) node. If there is any branching in the
tree, the equation is contained in the leaf node.
The following query returns all the ARTXP leaf nodes from a mining model, together with the nested table,
NODE_DISTRIBUTION, which contains the equation.
Example results:
From these results, which you can also browse by using the Microsoft Generic Content Tree Viewer (Data
Mining), you can tell at a glance which series are completely linear, which have multiple periodic structures, and
what the discovered periodicities are.
For example, the short form of the ARIMA Equation for the M200 Europe series tells you that only the default, or
daily, cycle was detected. The short form of the equation is provided in the NODE_CAPTION column.
However, for the M200 North America series, an additional periodic structure was found. The node TA00000001
has two child nodes, one with the equation, (1,0,4), and one with the equation, (1,1,4)(6). These equations are
concatenated and presented in the parent node.
For each periodic structure, the model content also provides the order and the moving average as child nodes.
For example, the following query retrieves the child nodes of one of the nodes listed in the previous example.
Notice that the column, PARENT_UNIQUE_NAME, must be enclosed in brackets to distinguish it from the
reserved keyword of the same name.
SELECT *
FROM Forecasting.CONTENT
WHERE [PARENT_UNIQUE_NAME] = ' TA00000001'
Because this is an ARIMA tree, not an ARTXP tree, you cannot use the IsDescendant (DMX) function to return the
child nodes of this periodic structure. Instead, you can use the attribute and node types to filter the results and
return the child nodes that provide more detail about how the equation was built, including the moving averages
and difference order.
Example results:
These examples illustrate that the further you drill down into the ARIMA tree, the more detail is revealed, but the
important information is combined and presented in the parent node as well.
Time Series Formula for ARIMA
To view the complete formula for any ARIMA node, we recommend that you use the Mining Legend of the
Microsoft Time Series Viewer, which presents the autoregressive order, moving averages, and other elements of
the equation already composed in a consistent format.
View the Formula for a Time Series Model (Data Mining)
This section presents a sample equation and explains the basic terms.
Mining Legend for ARIMA Formula
The following example shows the ARIMA formula for one part of the model, as displayed in the Mining Legend.
To view this formula, open the Forecasting model by using the Microsoft Time Series viewer, click the Model
tab, select the tree for the R250: Europe data series, and then click the node that represents the date series on or
after 7/5/2003. The mining legend composes all of the constants in a readable format, shown in this example:
ARIMA equation:
ARIMA ({1,1},0,{1,1.49791920964142,1.10640053499397,0.888873034670339,-5.05429403071953E-02,-
0.905265316720334,-0.961908900643379,-0.649991020901922}) Intercept:56.8888888888889
This equation is the long ARIMA format, which includes the values of the coefficients and the intercept. The short
format for this equation would be {1,0,7}, where 1 indicates the period as a count of time slices, 0 indicates the
term difference order, and 7 indicates the number of coefficients.
NOTE
A constant is calculated by Analysis Services for computing variance, but the constant itself is not displayed anywhere in the
user interface. However, you can view the variance for any point in the series as a function of this constant if you select
Show Deviations, in Chart view. The Tooltip for each data series shows the variance for a specific predicted point.
NODE DESCRIPTION: Displays the long format of the equation, which is also the form of the equation that
appears in the Mining Legend. The long form of the equation is similar to the short form, except that the actual
values of the coefficients are displayed instead of being counted.
NODE_RULE: Displays an XML representation of the equation. Depending on the node type, the XML
representation can include single or multiple periodic structures. The following table illustrates how XML nodes
are rolled up to higher levels of the ARIMA model.
27 (ARIMA Root) Includes all periodic structures for the data series, and the
content of all child nodes for each periodic structure.
30 (ARIMA Moving Average) Lists the coefficients for a single periodic structure.
NODE_DISTRIBUTION: Displays terms of the equation in a nested table, which you can query to obtain
specific terms. The node distribution table follows the same hierarchical structure as the XML rules. That is, the
root node of the ARIMA series (NODE_TYPE = 27) contains the intercept value and the periodicities for the
complete equation, which can include multiple periodicities, whereas the child nodes contain only information
specific to a certain periodic structure or to the child nodes of that periodic structure.
Periodicity
Difference order 15
(complement of coefficient)
NODE TYPE ATTRIBUTE VALUE TYPE
Value at t-1
...
Value at t-n
The value for the moving average order indicates the number of moving averages in a series. Generally the
moving average is calculated n-1 times if there are n terms in a series, but the number can be reduced for
easier computation.
The value for autoregressive order indicates the number of autoregressive series.
The value for difference order indicates how many times the series are compared, or differenced.
For an enumeration of the possible value types, see Microsoft.AnalysisServices.AdomdServer.MiningValueType.
Using the ARIMA Tree Information
If you use predictions that are based on the ARIMA algorithm in a business solution, you might want to paste the
equation into a report to demonstrate the method that was used to create the prediction. You can use the caption
to present the formulas in short format, or the description to present the formulas in long format.
If you are developing an application that uses time series predictions, you might find it useful to obtain the
ARIMA equation from the model content and then make your own predictions. To obtain the ARIMA equation
for any particular output, you can query the ARIMA root for that particular attribute directly, as shown in the
previous examples.
If you know the ID of the node that contains the series you want, you have two options to retrieve the
components of the equation:
Nested table format: Use a DMX query or query via OLEDB client.
XML representation: Use an XML query.
Remarks
It can be difficult to retrieve information from an ARTXP tree, because information for each split is in a different
place within the tree. Therefore, with an ARTXP model, you must get all the pieces and then do some processing
to reconstitute the complete formula. Retrieving an equation from an ARIMA model is easier because the formula
has been made available throughout the tree. For information about how to create a query to retrieve this
information, see Time Series Model Query Examples.
See Also
Mining Model Content (Analysis Services - Data Mining)
Microsoft Time Series Algorithm
Time Series Model Query Examples
Microsoft Time Series Algorithm Technical Reference
Time Series Model Query Examples
11/28/2018 • 12 minutes to read • Edit Online
SELECT MINING_PARAMETERS
FROM $system.DMSCHEMA_MINING_MODELS
WHERE MODEL_NAME = '<model name>'
Partial results:
MINING_PARAMETERS
COMPLEXITY_PENALTY=0.1,MINIMUM_SUPPORT=10,PERIODICITY_HINT={1,3},....
The default periodicity hint is {1} and appears in all models; this sample model was created with an additional
hint that might not be present in the final model.
NOTE
The results have been truncated here for readability.
SELECT NODE_UNIQUE_NAME
FROM Forecasting.CONTENT
WHERE ATTRIBUTE_NAME = 'R250 Europe: Quantity"
AND NODE_TYPE = 27
By using this node ID, you can retrieve details about the ARIMA equation for this tree. The following DMX
statement retrieves the short form of the ARIMA equation for the data series. It also retrieves the intercept from
the nested table, NODE_DISTRIBUTION. In this example, the equation is obtained by referencing the node
unique ID TA00000007. However, you may have to use a different node ID, and you may obtain slightly
different results from your model.
Example results:
For more information about how to interpret this information, see Mining Model Content for Time Series
Models (Analysis Services - Data Mining).
Sample Query 3: Retrieving the Equation for an ARTXP Model
For an ARTxp model, different information is stored at each level of the tree. For more information about the
structure of an ARTxp model, and how to interpret the information in the equation, see Mining Model Content
for Time Series Models (Analysis Services - Data Mining).
The following DMX statement retrieves information a part of the ARTxp tree that represents the quantity of sales
for the R250 model in Europe.
NOTE
The name of the nested table column, VARIANCE, must be enclosed in brackets to distinguish it from the reserved
keyword of the same name. The nested table columns, PROBABILITY and SUPPORT, are not included because they are
blank in most cases.
For more information about how to interpret this information, see Mining Model Content for Time Series
Models (Analysis Services - Data Mining).
Regardless of whether you extend or replace the training data, predictions always begin at the time stamp that
ends the original training set. In other words, if your new data contains n time slices, and you request predictions
for time steps 1 through n, the predictions will coincide with the same period as the new data, and you will not
get any new predictions.
To get new predictions for time periods that do not overlap with the new data, you must either start predictions
at the time slice n+1, or make sure that you request additional time slices.
For example, assume that the existing model has six months' worth of data. You want to extend this model by
adding the sales figures from the last three months. At the same time, you want to make a prediction about the
next three months. To obtain only the new predictions when you add the new data, specify the starting point as
time slice 4, and the ending point as time slice 7. You could also request a total of six predictions, but the time
slices for the first three would overlap with the new data just added.
For query examples and more information about the syntax for using REPLACE_MODEL_CASES and
EXTEND_MODEL_CASES, see PredictTimeSeries (DMX).
Making Predictions with EXTEND_MODEL_CASES
Prediction behavior differs depending on whether you extend or replace the model cases. When you extend a
model, the new data is attached to the end of the series and the size of the training set increases. However, the
time slices used for prediction queries always start at the end of the original series. Therefore, if you add three
new data points and request six predictions, the first three predictions returned overlap with the new data. In this
case, Analysis Services returns the actual new data points instead of making a prediction, until all the new data
points are used up. Then, Analysis Services makes predictions based on the composite series.
This behavior lets you add new data, and then show your actual sales figures in the prediction chart, instead of
seeing projections.
For example, to add three new data points and make three new predictions, you would do the following:
Create a PREDICTION JOIN on a time series model, and specify the source of three months' of new
data.
Request predictions for six time slices. To do this, specify 6 time slices, where the starting point is time
slice 1, and the ending point is time slice 7. This is true only for EXTEND_MODEL_CASES.
To get only the new predictions, you specify the starting point as 4 and the ending point as 7.
You must use the argument EXTEND_MODEL_CASES.
The actual sales figures are returned for the first three time slices, and predictions based on the extended
model are returned for the next three time slices.
Making Predictions with REPLACE_MODEL_CASES
When you replace the cases in a model, the size of the model stays the same but Analysis Services replaces the
individual cases in the model. This is useful for cross-prediction and scenarios in which maintaining the training
data set at a consistent size is important.
For example, one of your stores has insufficient sales data. You could create a general model by averaging sales
for all stores in a particular region and then training a model. Then, to make predictions for the store without
sufficient sales data, you create a PREDICTION JOIN on the new sales data for just that store. When you do
this, Analysis Services keeps the patterns derived from the regional model, but replaces the existing training
cases with the data from the individual store. As a result, your prediction values will be closer to the trend lines
for the individual store.
When you use the REPLACE_MODEL_CASES argument, Analysis Services continually adds new cases to the
end of the case set and deletes a corresponding number from the beginning of the case set. If you add more new
data than was in the original training set, Analysis Services discards the earliest data. If you supply sufficient new
values, the predictions can be based on completely new data.
For example, you trained your model on a case data set that contained 1000 rows. You then add 100 rows of
new data. Analysis Services drops the first 100 rows from the training set and adds the 100 rows of new data to
the end of the set for a total of 1000 rows. If you add 1100 rows of new data, only the most recent 1000 rows
are used.
Here is another example. To add three new month's worth of data and make three new predictions, you would
do the following actions:
Create a PREDICTION JOIN on a time series model and use the REPLACE_MODEL_CASE argument.
Specify the source of three months' of new data. This data might be from a completely different source
than the original training data.
Request predictions for six time slices. To do this, specify 6 time slices, or specify the starting point as time
slice 1, and the ending point as time slice 7.
NOTE
Unlike EXTEND_MODEL_CASES, you cannot return the same values that you added as input data. All six values
returned are predictions that are based on the updated model, which includes both old and new data.
NOTE
With REPLACE_MODEL_CASES, starting at timestamp 1 you get new predictions based on the new data, which
replaces the old training data.
For query examples and more information about the syntax for using REPLACE_MODEL_CASES and
EXTEND_MODEL_CASES, see PredictTimeSeries (DMX).
Missing Value Substitution in Time Series Models
When you add new data to a time series model by using a PREDICTION JOIN statement, the new dataset
cannot have any missing values. If any series is incomplete, the model must supply the missing values by using
either a null, a numeric means, a specific numeric mean, or a predicted value. If you specify
EXTEND_MODEL_CASES, Analysis Services replaces the missing values with predictions based on the
original model. If you use REPLACE_MODEL_CASES, Analysis Services replaces the missing values with the
value that you specify in the MISSING_VALUE_SUBSTITUTION parameter.
PredictNodeId (DMX) Returns the node ID for the specified predictable column.
PredictVariance (DMX) Returns the variance of the predictions for the specified
predictable column.
You can also query time series models by using the general
prediction function, Predict (DMX).
For a list of the functions that are common to all Microsoft algorithms, see General Prediction Functions (DMX).
For the syntax of specific functions, see Data Mining Extensions (DMX) Function Reference.
See Also
Data Mining Queries
Microsoft Time Series Algorithm
Microsoft Time Series Algorithm Technical Reference
Mining Model Content for Time Series Models (Analysis Services - Data Mining)
Plugin Algorithms
10/26/2018 • 2 minutes to read • Edit Online
Algorithm Requirements
To plug an algorithm into Analysis Services, you must implement the following COM interfaces:
IDMAlgorithm
Implements an algorithm that produces models, and implements the prediction operations of the resulting models.
IDMAlgorithmNavigation
Enables browsers to access the content of the models.
IDMPersist
Enables the models that the algorithm trains to be saved and loaded by Analysis Services.
IDMAlgorithmMetadata
Describes the capabilities and input parameters of the algorithm.
IDMAlgorithmFactory
Creates instances of the objects that implement the algorithm interface, and provides Analysis Services with access
to the algorithm-metadata interface.
Analysis Services uses these COM interfaces to communicate with plugin algorithms. Although plugin algorithms
that you use must support the Microsoft OLE DB for Data Mining specification, they do not have to support all the
data mining options in the specification. You can use the MINING_SERVICES schema rowset to determine the
capabilities of an algorithm. This schema rowset lists the data mining support options for each plugin algorithm
provider.
You must register new algorithms before you use them with Analysis Services. To register an algorithm, include
the following information in the .ini file of the instance of Analysis Services on which you want to include the
algorithms:
The algorithm name
ProgID (this is optional and will only be included for plugin algorithms)
A flag that indicates whether the algorithm is enabled or not
The following code sample illustrates how to register a new algorithm:
<ConfigurationSettings>
...
<DataMining>
...
<Algorithms>
...
<Sample_Plugin_Algorithm>
<Enabled>1</Enabled>
<ProgID>Microsoft.DataMining.SamplePlugInAlgorithm.Factory</ProgID>
</Sample_PlugIn_Algorithm>
...
</Algorithms>
...
</DataMining>
...
</ConfigurationSettings>
See Also
Data Mining Algorithms (Analysis Services - Data Mining)
DMSCHEMA_MINING_SERVICES Rowset
Mining Structures (Analysis Services - Data Mining)
5/16/2018 • 9 minutes to read • Edit Online
The mining structure in the diagram is based on a data source that contains multiple tables or views, joined on
the CustomerID field. One table contains information about customers, such as the geographical region, age,
income and gender, while the related nested table contains multiple rows of additional information about each
customer, such as products the customer has purchased. The diagram shows that multiple models can be built
on one mining structure, and that the models can use different columns from the structure.
Model 1 Uses CustomerID, Income, Age, Region, and filters the data on Region.
Model 2 Uses CustomerID, Income, Age, Region and filters the data on Age.
Model 3 Uses CustomerID, Age, Gender, and the nested table, with no filter.
Because the models use different columns for input, and because two of the models additionally restrict the data
that is used in the model by applying a filter, the models might have very different results even though they are
based on the same data. Note that the CustomerID column is required in all models because it is the only
available column that can be used as the case key.
This section explains the basic architecture of data mining structures: how you define a mining structure, how
you populate it with data, and how you use it to create models. For more information about how to manage or
export existing data mining structures, see Management of Data Mining Solutions and Objects.
Related Tasks
Use the links provided her to learn more about how to define, manage, and use mining structures.
TASKS LINKS
Work with relational mining structures Create a New Relational Mining Structure
Work with mining structures based on OLAP cubes Create a New OLAP Mining Structure
Change or query mining structure properties and data Change the Properties of a Mining Structure
Work with the underlying data sources and update source Edit the Data Source View used for a Mining Structure
data
Process a Mining Structure
See Also
Database Objects (Analysis Services - Multidimensional Data)
Mining Models (Analysis Services - Data Mining)
Mining Structure Columns
5/16/2018 • 3 minutes to read • Edit Online
Related Content
See the following topics for more information about how to define and use mining structure columns.
TOPIC LINKS
Describes the data types that you can use to define a mining Data Types (Data Mining)
structure column.
Describes the content types that are available for each type Content Types (Data Mining)
of data that is contained in a mining structure column.
Content types are dependent on data type. The content type
is assigned at the model level, and determines how the
column data is used by the model.
Introduces the concept of nested tables, and explains how Classified Columns (Data Mining)
nested tables can be added to the data source as mining
structure columns.
Lists and explains the distribution properties that you can set Column Distributions (Data Mining)
on a mining structure column to specify the expected
distribution of values in the column.
Explains the concept of discretization (sometimes referred to Discretization Methods (Data Mining)
as binning) and describes the methods that Analysis Services
provides for discretizing continuous numeric data.
Describes the modeling flags that you can set on a mining Modeling Flags (Data Mining)
structure column.
Describes classified columns, which are a special type of Classified Columns (Data Mining)
column that you can use to relate one mining structure
column to another.
Learn to add and modify mining structure columns. Mining Structure Tasks and How-tos
See Also
Mining Structures (Analysis Services - Data Mining)
Mining Model Columns
Data Types (Data Mining)
5/16/2018 • 2 minutes to read • Edit Online
Classified
Classified
NOTE
The Time and Sequence content types are only supported by third-party algorithms. The Cyclical and Ordered content
types are supported, but most algorithms treat them as discrete values and do not perform special processing.
The table also shows the content types supported for each data type.
The content type is specific to data mining and lets you customize the way that data is processed or calculated in
the mining model. For example, even if your column contains numbers, you might need to model them as
discrete values. If the column contains numbers, you can also specify that they be binned, or discretized, or specify
that the model handle them as continuous values. Thus, the content type can have a huge effect on the model..
For a list of all the content types, see Content Types (Data Mining).
NOTE
In other machine learning systems, you might encounter the terms nominal data, factors or categories, ordinal data, or
sequence data. In general, these correspond to content types. In SQL Server, the data type specifies only the value type for
storage, not its usage in the model.
Specifying a Data Type
If you create the mining model directly by using Data Mining Extensions (DMX), you can define the data type for
each column as you define the model, and Analysis Services will create the corresponding mining structure with
the specified data types at the same time. If you create the mining model or mining structure by using a wizard,
Analysis Services will suggest a data type, or you can choose a data type from a list.
See Also
Content Types (Data Mining)
Content Types (DMX)
Data Mining Algorithms (Analysis Services - Data Mining)
Mining Structures (Analysis Services - Data Mining)
Data Types (DMX)
Mining Model Columns
Mining Structure Columns
Nested Tables (Analysis Services - Data Mining)
5/16/2018 • 6 minutes to read • Edit Online
In this diagram, the first table, which is the parent table, contains information about customers, and associates a
unique identifier for each customer. The second table, the child table, contains the purchases for each customer.
The purchases in the child table are related to the parent table by the unique identifier, the CustomerKey column.
The third table in the diagram shows the two tables combined.
A nested table is represented in the case table as a special column that has a data type of TABLE. For any
particular case row, this kind of column contains selected rows from the child table that pertain to the parent table.
The data in a nested table can be used for prediction or for input, or for both. For example, you might have two
nested table columns in a model: one nested table column might contain a list of the products that a customer has
purchased, while the other nested table column contains information about the customer's hobbies and interests,
possibly obtained from a survey. In this scenario, you could use the customer's hobbies and interests as an input
for analyzing purchasing behavior, and predicting likely purchases.
NOTE
The CustomerKey field is the relational key that is used to link the case table and the nested table within the data source
view definition, and to establish the relationship of the columns within the mining structure. However, typically you should
not use this relational key in mining models built on that structure. Usually it is best to omit the relational key column from
the mining model if it serves only to join the tables and does not provide information that is interesting for analysis.
You can create nested tables programmatically by either using Data Mining Extensions (DMX) or Analysis
Management Objects (AMO ), or you can use the Data Mining Wizard and Data Mining Designer in SQL Server
Data Tools (SSDT).
See Also
Data Mining Algorithms (Analysis Services - Data Mining)
Mining Structures (Analysis Services - Data Mining)
Column Distributions (Data Mining)
5/16/2018 • 2 minutes to read • Edit Online
Log Normal
The values for the continuous column form a histogram, where the curve is elongated at the upper end and is
skewed toward the lower end.
Uniform
The values for the continuous column form a flat curve, in which all values are equally likely.
For more information about the algorithms that Analysis Services provides, see Data Mining Algorithms (Analysis
Services - Data Mining).
See Also
Content Types (Data Mining)
Mining Structures (Analysis Services - Data Mining)
Discretization Methods (Data Mining)
Distributions (DMX)
Mining Structure Columns
Discretization Methods (Data Mining)
5/16/2018 • 2 minutes to read • Edit Online
If you do not want Analysis Services to calculate the number of buckets, you can use the
DiscretizationBucketCount property to manually specify the number of buckets.
The following table describes the methods that you can use to discretize data in Analysis Services.
CLUSTERS The algorithm divides the data into groups by sampling the
training data, initializing to a number of random points, and
then running several iterations of the Microsoft Clustering
algorithm using the Expectation Maximization (EM) clustering
method. The CLUSTERS method is useful because it works on
any distribution curve. However, it requires more processing
time than the other discretization methods.
EQUAL_AREAS The algorithm divides the data into groups that contain an
equal number of values. This method is best used for normal
distribution curves, but does not work well if the distribution
includes a large number of values that occur in a narrow
group in the continuous data. For example, if one-half of the
items have a cost of 0, one-half the data will occur under a
single point in the curve. In such a distribution, this method
breaks the data up in an effort to establish equal
discretization into multiple areas. This produces an inaccurate
representation of the data.
Remarks
You can use the EQUAL_AREAS method to discretize strings.
The CLUSTERS method uses a random sample of 1000 records to discretize data. Use the
EQUAL_AREAS method if you do not want the algorithm to sample data.
See Also
Content Types (Data Mining)
Content Types (DMX)
Data Mining Algorithms (Analysis Services - Data Mining)
Mining Structures (Analysis Services - Data Mining)
Data Types (Data Mining)
Mining Structure Columns
Column Distributions (Data Mining)
Classified Columns (Data Mining)
5/16/2018 • 2 minutes to read • Edit Online
NOTE
The algorithms provided in Analysis Services do not support the use of classified columns; this feature is provided for use in
creating custom algorithms.
See Also
Content Types (Data Mining)
Mining Structures (Analysis Services - Data Mining)
Data Types (Data Mining)
Drillthrough on Mining Structures
10/26/2018 • 3 minutes to read • Edit Online
NOTE
If you enable drillthrough on both the mining structure and the mining model, any user who is a member of a role that has
drillthrough permissions on the mining model can also view columns in the mining structure, even if those columns are not
included in the mining model. Therefore, to protect sensitive data, you should set up the data source view to mask personal
information, and allow drillthrough access on the mining structure only when necessary.
Related Tasks
See the following topics for more information about how to use drillthrough with mining models.
Use drillthrough to structure from the mining model viewers Use Drillthrough from the Model Viewers
See examples of drillthrough queries for specific model types. Data Mining Queries
Get information about permissions that apply to specific Grant permissions on data mining structures and models
mining structures and mining models. (Analysis Services)
See Also
Drillthrough on Mining Models
Properties for Mining Structure and Structure
Columns
5/16/2018 • 4 minutes to read • Edit Online
NOTE
If you change the value of any property in the mining structure, even metadata such as a name or description, the mining
structure and its models must be reprocessed before you can view or query the model.
Language Specifies the language for the captions in the mining structure.
If you change the value for the Name property, the new name
is used as a caption or alias only; the identifier for the mining
structure does not change.
Source Displays the name of the data source, and the type of data
source.
DiscretizationMethod Displays the method that was used to discretize the column.
NameColumn Identifies the column that provides the name of the parent
element.
For more information about setting or changing properties, see Mining Structure Tasks and How -tos.
See Also
Create a Relational Mining Structure
Mining Structure Columns
Mining Structure Tasks and How-tos
5/16/2018 • 2 minutes to read • Edit Online
In This Section
Create a New Relational Mining Structure
Create a New OLAP Mining Structure
Add Columns to a Mining Structure
Remove Columns from a Mining Structure
Add a Nested Table to a Mining Structure
Change the Properties of a Mining Structure
Edit the Data Source View used for a Mining Structure
Process a Mining Structure
See Also
Designing and Implementing How -to Topics (Analysis Services - Data Mining)
Create a New Relational Mining Structure
5/16/2018 • 2 minutes to read • Edit Online
NOTE
You can click Detect to automatically detect whether a column contains continuous or discrete data. After you click
this button, the column content and data types will be updated in the Content Type and Data Type columns. For
more information about content types and data types, see Content Types (Data Mining) and Data Types (Data
Mining).
10. Click Next.
11. On the Completing the Wizard page, provide a name for the mining structure and the related initial
mining model that will be created, and then click Finish.
See Also
Mining Structure Tasks and How -tos
Create a New OLAP Mining Structure
11/27/2018 • 6 minutes to read • Edit Online
NOTE
OLAP mining models do not support using the Detect feature to automatically detect whether a column contains
continuous or discrete data.
Click Next.
11. On the Slice Source Cube page, you can filter the data that is used to create the mining structure.
Slicing the cube lets you restrict the data that is used to build the model. For example, you could build
separate models for each region by slicing on the Geography hierarchy and
Dimension: Choose a related dimension from the dropdown list.
Hierarchy: Select the level of the dimension hierarchy at which you want to apply the filter. For
example, if you are slicing by the [Geography] dimension, you would choose a hierarchy level such as
[Region Country Name] .
Operator: Choose an operator from the list.
Filter Expression: Type a value or expression to serve as the filter condition, or use the dropdown
list to select a value from the list of members at the specified level of the hierarchy.
For example, if you selected [Geography] as the dimension and [Region Country Name] as the
hierarchy level, the dropdown list contains all the valid countries that you can use as a filter condition.
You can make multiple selections. As a result, the data in the mining structure will be limited to cube
data from these geographical areas.
Parameters: Ignore this check box. This dialog box supports multiple cube filtering scenarios and
this option is not relevant to building a mining structure.
Click Next.
12. On the Split data into training and testing sets page, specify a percentage of the mining structure data
to reserve for testing, or specify the maximum number of test cases. Click Next.
If you specify both values, the limits are combined to use whichever is lowest.
13. On the Completing the Wizard page, provide a name for the new OLAP mining structure and the initial
mining model.
14. Click Finish.
15. On the Completing the Wizard page, you also have the option to create a mining model dimension
and/or a cube using the mining model dimension. These options are supported only for models built using
the following algorithms:
Microsoft Clustering algorithm
Microsoft Decision Trees algorithm
Microsoft Association Rules algorithm
Create mining model dimension: Select this check box and provide a type name for the mining model
dimension. When you use this option, a new dimension is created within the original cube that was used to
build the mining structure. You can use this dimension to drill down and conduct further analysis. Because
the dimension is located within the cube, the dimension is automatically mapped to the case data
dimension.
Create cube using mining model dimension: Select this check box, and provide a name for the new
cube. When you use this option, a new cube is created that contains both the existing dimensions that were
used in building the structure, and the new data mining dimension that contains the results from the model.
See Also
Mining Structure Tasks and How -tos
Add Columns to a Mining Structure
5/16/2018 • 2 minutes to read • Edit Online
NOTE
You can add multiple copies of columns to a mining structure; however, you should avoid using more than one instance of
the column within the same model, to avoid false correlations between the source and the derived column.
NOTE
If you add a column that already exists, a copy will be included in the structure, and the name appended with a "1". You can
change the name of the copied column to something more descriptive by typing a new name in the Name property of the
mining structure column.
See Also
Mining Structure Tasks and How -tos
Remove Columns from a Mining Structure
5/16/2018 • 2 minutes to read • Edit Online
See Also
Mining Structure Tasks and How -tos
Add a Nested Table to a Mining Structure
5/16/2018 • 2 minutes to read • Edit Online
See Also
Mining Structure Tasks and How -tos
Change the Properties of a Mining Structure
5/16/2018 • 2 minutes to read • Edit Online
See Also
Mining Structure Tasks and How -tos
Edit the Data Source View used for a Mining
Structure
5/16/2018 • 2 minutes to read • Edit Online
See Also
Mining Structure Tasks and How -tos
Process a Mining Structure
5/16/2018 • 2 minutes to read • Edit Online
See Also
Mining Structure Tasks and How -tos
Mining Models (Analysis Services - Data Mining)
11/28/2018 • 10 minutes to read • Edit Online
The metadata specifies the name of the model and the server where it is stored, as well as a definition of the
model, including the columns from the mining structure that were used in building the model, the definitions of
any filters that were applied when processing the model, and the algorithm that was used to analyze the data. All
these choices-the data columns and their data types, filters, and algorithm-have a powerful influence on the
results of analysis.
For example, you can use the same data to create multiple models, using perhaps a clustering algorithm, decision
tree algorithm, and Naïve Bayes algorithm. Each model type creates different set of patterns, itemsets, rules, or
formulas, which you can use for making predictions. Generally each algorithm analyses the data in a different
way, so the content of the resulting model is also organized in different structures. In one type of model, the data
and patterns might be grouped in clusters; in another type of model, data might be organized into trees, branches,
and the rules that divide and define them.
The model is also affected by the data that you train it on: even models trained on the same mining structure can
yield different results if you filter the data differently or use different seeds during analysis. However, the actual
data is not stored in the model-only summary statistics are stored, with the actual data residing in the mining
structure. If you have created filters on the data when you trained the model, the filter definitions are saved with
the model object as well.
The model does contain a set of bindings, which point back to the data cached in the mining structure. If the data
has been cached in the structure and has not been cleared after processing, these bindings enable you to drill
through from the results to the cases that support the results. However, the actual data is stored in the structure
cache, not in the model.
Mining Model Architecture
Related Content
TOPICS LINKS
Learn how to build mining structures that can support Mining Structure Columns
multiple mining models. Learn about the usage of columns in
models. Mining Model Columns
Learn about different algorithms, and how the choice of Mining Model Content (Analysis Services - Data Mining)
algorithm affects the model content.
Data Mining Algorithms (Analysis Services - Data Mining)
Learn now you can set properties on the model that affects Mining Model Properties
its composition and behavior.
Modeling Flags (Data Mining)
Learn about the programmable interfaces for data mining. Developing with Analysis Management Objects (AMO)
Learn how to use the custom data mining viewers in Analysis Data Mining Model Viewers
Services.
View examples of the different types of queries that you can Data Mining Queries
use against data mining models.
Related Tasks
Use the following links to get more specific information about working with data mining models
TASK LINK
Add and delete mining models Add a Mining Model to an Existing Mining Structure
Work with mining model columns Exclude a Column from a Mining Model
EXPORT (DMX)
IMPORT (DMX)
Populate models with data, or update data in a model Process a Mining Model
See Also
Database Objects (Analysis Services - Multidimensional Data)
Mining Model Columns
5/16/2018 • 2 minutes to read • Edit Online
See Also
Data Mining Algorithms (Analysis Services - Data Mining)
Mining Structures (Analysis Services - Data Mining)
Change the Properties of a Mining Model
Exclude a Column from a Mining Model
Mining Structure Columns
Content Types (Data Mining)
5/16/2018 • 6 minutes to read • Edit Online
Discrete
Discrete means that the column contains a finite number of values with no continuum between values. For
example, a gender column is a typical discrete attribute column, in that the data represents a specific number
of categories.
The values in a discrete attribute column cannot imply ordering, even if the values are numeric. Moreover,
even if the values used for the discrete column are numeric, fractional values cannot be calculated. Telephone
area codes are a good example of discrete data that is numeric.
The Discrete content type is supported by all data mining data types.
Continuous
Continuous means that the column contains values that represent numeric data on a scale that allows interim
values. Unlike a discrete column, which represents finite, countable data, a continuous column represents
scalable measurements, and it is possible for the data to contain an infinite number of fractional values. A
column of temperatures is an example of a continuous attribute column.
When a column contains continuous numeric data, and you know how the data should be distributed, you can
potentially improve the accuracy of the analysis by specifying the expected distribution of values. You specify
the column distribution at the level of the mining structure. Therefore, the setting applies to all models that are
based on the structure, For more information, see Column Distributions (Data Mining).
The Continuous content type is supported by the following data types: Date, Double, and Long.
Discretized
Discretization is the process of putting values of a continuous set of data into buckets so that there are a
limited number of possible values. You can discretize only numeric data.
Thus, the discretized content type indicates that the column contains values that represent groups, or buckets,
of values that are derived from a continuous column. The buckets are treated as ordered and discrete values.
You can discretize your data manually, to ensure that you get the buckets you want, or you can use the
discretization methods provided in SQL Server Analysis Services. Some algorithms perform discretization
automatically. For more information, see Change the Discretization of a Column in a Mining Model.
The Discretized content type is supported by the following data types: Date, Double, Long, and Text.
Key
The key content type means that the column uniquely identifies a row. In a case table, typically the key column
is a numeric or text identifier. You set the content type to key to indicate that the column should not be used
for analysis, only for tracking records.
Nested tables also have keys, but the usage of the nested table key is a little different. You set the content type
to key in a nested table if the column is the attribute that you want to analyze. The values in the nested table
key must be unique for each case but there can be duplicates across the entire set of cases.
For example, if you are analyzing the products that customers purchase, you would set content type to key for
the CustomerID column in the case table, and set content type to key again for the PurchasedProducts
column in the nested table.
NOTE
Nested tables are available only if you use data from an external data source that has been defined as an Analysis
services data source view.
This content type is supported by the following data types: Date, Double, Long, and Text.
Key Sequence
The key sequence content type can only be used in sequence clustering models. When you set content type to
key sequence, it indicates that the column contains values that represent a sequence of events. The values are
ordered, but do not have to be an equal distance apart.
This content type is supported by the following data types: Double, Long, Text, and Date.
Key Time
The key time content type can only be used in time series models. When you set content type to key time, it
indicates that the values are ordered and represent a time scale.
This content type is supported by the following data types: Double, Long, and Date.
Table
The table content type indicates that the column contains another data table, with one or more columns and
one or more rows. For any particular row in the case table, this column can contain multiple values, all related
to the parent case record. For example, if the main case table contains a listing of customers, you could have
several columns that contain nested tables, such as a ProductsPurchased column, where the nested table
lists products bought by this customer in the past, and a Hobbies column that lists the interests of the
customer.
The data type of this column is always Table.
Cyclical
The cyclical content type means that the column contains values that represent a cyclical ordered set. For
example, the numbered days of the week is a cyclical ordered set, because day number one follows day
number seven.
Cyclical columns are considered both ordered and discrete in terms of content type.
This content type is supported by all the data mining data types in Analysis Services. However, most
algorithms treat cyclical values as discrete values and do not perform special processing.
Ordered
The Ordered content type also indicates that the column contains values that define a sequence or order.
However, in this content type the values used for ordering do not imply any distance or magnitude
relationship between values in the set. For example, if an ordered attribute column contains information about
skill levels in rank order from one to five, there is no implied information in the distance between skill levels; a
skill level of five is not necessarily five times better than a skill level of one.
Ordered attribute columns are considered to be discrete in terms of content type.
This content type is supported by all the data mining data types in Analysis Services. However, however, most
algorithms treat ordered values as discrete values and do not perform special processing.
Classified
In addition to the preceding content types that are in common use with all models, for some data types you
can use classified columns to define content types. For more information about classified columns, see
Classified Columns (Data Mining).
See Also
Content Types (DMX)
Data Types (Data Mining)
Data Types (DMX)
Change the Properties of a Mining Structure
Mining Structure Columns
Mining Model Properties
5/16/2018 • 2 minutes to read • Edit Online
Properties of Models
The following table describes the properties that are specific to mining models. Additionally, there are properties
that you can set on individual columns in the mining
PROPERTY DESCRIPTION
AlgorithmParameters Sets values for algorithm parameters that are available for
each algorithm type.
Filter Sets a filter that is applied to the data that is used for training
and testing the mining model. The filter definition is stored
with the model and can be used optionally when you create
prediction queries, or when you test the accuracy of the
model.
Name Sets the name of the mining model column. You can type a
new name, to provide an alias for the mining model column.
Usage Sets how the column will be used by the mining model.
See Also
Mining Model Columns
Mining Structures (Analysis Services - Data Mining)
Mining Model Tasks and How -tos
Change the Properties of a Mining Model
Data Mining Tools
Create a Relational Mining Structure
Create an Alias for a Model Column
Missing Values (Analysis Services - Data Mining)
5/16/2018 • 8 minutes to read • Edit Online
VALUE CASES
0 9296
1 9098
Missing 0
This distribution shows that about half of the customers have purchased a bike, and half have not. This particular
data set is very clean; therefore, every case has a value in the [Bike Buyer] column, and the count of Missing
values is 0. However, if any case had a null in the [Bike Buyer] field, Analysis Services would count that row as a
case with a Missing value.
If the input is a continuous column, the model tabulates two possible states for the attribute: Existing and
Missing. In other words, either the column contains a value of some numeric data type, or it contains no value.
For cases that have a value, the model calculates mean, standard deviation, and other meaningful statistics. For
cases that have no value, the model provides a count of the Missing vales and adjusts predictions accordingly.
The method for adjusting the prediction differs depending on the algorithm and is described in the following
section.
NOTE
For attributes in a nested table, missing values are not informative. For example, if a customer has not purchased a
product, the nested Products table would not have a row corresponding to that product, and the mining model would
not create an attribute for the missing product. However, if you are interested in customers who have not purchased
certain products, you can create a model that is filtered on the non-existence of the products in the nested table, by using
a NOT EXISTS statement in the model filter. For more information, see Apply a Filter to a Mining Model.
0 9296 50.55%
1 9098 49.42%
VALUE CASES PROBABILITY
Missing 0 0.03%
It may seem odd that the probability of the Missing value is calculated as 0.03%, when the number of cases is 0.
In fact, this behavior is by design, and represents an adjustment that lets the model handle unknown values
gracefully.
In general, probability is calculated as the favorable cases divided by all possible cases. In this example, the
algorithm computes the sum of the cases that meet a particular condition ([Bike Buyer] = 1, or [Bike Buyer] = 0),
and divides that number by the total count of rows. However, to account for the Missing cases, 1 is added to the
number of all possible cases. As a result, the probability for the unknown case is no longer zero, but a very small
number, indicating that the state is merely improbable, not impossible.
The addition of the small Missing value does not change the outcome of the predictor; however, it enables
better modeling in scenarios where the historical data does not include all possible outcomes.
NOTE
Data mining providers differ in the way they handle missing values. For example, some providers assume that missing data
in a nested column is sparse representation, but that missing data in a non-nested column is missing at random.
If you are certain that all outcomes are specified in your data and want to prevent probabilities from being
adjusted, you should set the NOT_NULL modeling flag on the column in the mining structure.
NOTE
Each algorithm, including custom algorithms that you may have obtained from a third-party plug-in, can handle missing
values differently.
TASKS LINKS
Add flags to individual model columns to control handling of View or Change Modeling Flags (Data Mining)
missing values
Set properties on a mining model to control handling of Change the Properties of a Mining Model
missing values
Alter the way that the mining structure handles missing Change the Properties of a Mining Structure
values
See Also
Mining Model Content (Analysis Services - Data Mining)
Modeling Flags (Data Mining)
Feature Selection (Data Mining)
5/16/2018 • 9 minutes to read • Edit Online
In short, feature selection helps solve two problems: having too much data that is of little value, or having too
little data that is of high value. Your goal in feature selection should be to identify the minimum number of
columns from the data source that are significant in building a model.
NOTE
Feature selection affects only the columns that are used in the model, and has no effect on storage of the mining structure.
The columns that you leave out of the mining model are still available in the structure, and data in the mining structure
columns will be cached.
See Also
Customize Mining Models and Structure
Modeling Flags (Data Mining)
11/28/2018 • 6 minutes to read • Edit Online
NOTE
Third-party plug-ins might have other modeling flags, in addition to those pre-defined by Analysis Services.
NOTE
Missing is a special state used by the algorithm, and differs from the text value "Missing" in a column. For more
information, see Missing Values (Analysis Services - Data Mining).
REGRESSOR
Indicates that the column is a candidate for used as a regressor during processing. This flag is defined on a
mining model column, and can only be applied to columns that have a continuous numeric data type. For more
information about the use of this flag, see the section in this topic, Uses of the REGRESSOR Modeling Flag.
You can add or change the modeling flags used in a model by using the Data Mining Designer and editing the
properties of the associated columns. Such changes require that the structure or model be reprocessed.
You can specify modeling flags in a new mining structure or mining model by using DMX, or by using AMO or
XMLA scripts. However, you cannot change the modeling flags used in an existing mining model and structure
by using DMX. You must create a new mining model by using the syntax,
ALTER MINING STRUCTURE....ADD MINING MODEL .
Note If you modify a mining model and change the content type of a column from continuous to discrete, you
must manually change the flag on the mining column and then reprocess the model.
Regressors in Linear Regression Models
Linear regression models are based on the Microsoft Decision Trees algorithm. Even if you do not use the
Microsoft Linear Regression algorithm, any decision tree model can contain a tree or nodes that represents a
regression on a continuous attribute.
Therefore, in these models you do not need to specify that a continuous column represents a regressor. The
Microsoft Decision Trees algorithm will partition the dataset into regions with meaningful patterns even if you
do not set the REGRESSOR flag on the column. The difference is that when you set the modeling flag, the
algorithm will try to find regression equations of the following form to fit the patterns in the nodes of the tree.
a*C1 + b*C2 + ...
Then, the sum of the residuals is calculated, and if the deviation is too great, a split is forced in the tree.
For example, if you are predicting customer purchasing behavior using Income as an attribute, and set the
REGRESSOR modeling flag on the column, the algorithm would first try to fit the Income values by using a
standard regression formula. If the deviation is too great, the regression formula is abandoned and the tree
would be split on some other attribute. The decision tree algorithm would then try fit a regressor for income in
each of the branches after the split.
You can use the FORCE_REGRESSOR parameter to guarantee that the algorithm will use a particular regressor.
This parameter can be used with the Decision Trees algorithm and Linear Regression algorithm.
Related Tasks
Use the following links to learn more about using modeling flags.
TASK TOPIC
Edit modeling flags by using the Data Mining Designer View or Change Modeling Flags (Data Mining)
Specify a hint to the algorithm to recommend likely Specify a Column to Use as Regressor in a Model
regressors
See the modeling flags supported by specific algorithms (in Data Mining Algorithms (Analysis Services - Data Mining)
the Modeling Flags section for each algorithm reference
topic)
Learn more about mining structure columns and the Mining Structure Columns
properties that you can set on them
Learn about mining model columns and modeling flags that Mining Model Columns
can be applied at the model level
See syntax for working with modeling flags in DMX Modeling Flags (DMX)
statements
Understand missing values and how to work with them Missing Values (Analysis Services - Data Mining)
Learn about managing models and structures and setting Moving Data Mining Objects
usage properties
Mining Model Content (Analysis Services - Data
Mining)
11/28/2018 • 22 minutes to read • Edit Online
NOTE
If you use a different data mining service, or if you create your own plug-in algorithms, additional custom node
types may be available.
NOTE
The Microsoft Clustering algorithm allows users to assign friendly names to each cluster. However, these friendly
names are not persisted on the server, and if you reprocess the model, the algorithm will generate new cluster
names.
The caption and description for each node are automatically generated by the algorithm, and serve as
labels to help you understand the content of the node. The text generated for each field depends on the
model type. In some cases, the name, caption, and description may contain exactly the same string, but in
some models, the description may contain additional information. See the topic about the individual
model type for details of the implementation.
NOTE
Analysis Services server supports the renaming of nodes only if you build models by using a custom plug-in
algorithm that implements renaming,. To enable renaming, you must override the methods when you create the
plug-in algorithm.
NOTE
In Analysis Services, only the immediate child nodes are counted when calculating the cardinality of a node.
However, if you create a custom plug-in algorithm, you can overload CHILDREN_CARDINALITY to count cardinality
differently. This may be useful, for example, if you wanted to count the total number of descendants, not just the
immediate children.
Although cardinality is counted in the same way for all models, how you interpret or use the cardinality
value differs depending on the model type. For example, in a clustering model, the cardinality of the top
node tells you the total number of clusters that were found. In other types of models, cardinality may
always have a set value depending on the node type. For more information about how to interpret
cardinality, see the topic about the individual model type.
NOTE
Some models, such as those created by the Microsoft Neural Network algorithm, additionally contain a special
node type that provides descriptive statistics about the training data for the entire model. By definition, these
nodes never have child nodes.
Node Distribution
The NODE_DISTRIBUTION column contains a nested table that in many nodes provides important and
detailed information about the patterns discovered by the algorithm. The exact statistics provided in this
table change depending on the model type, the position of the node in the tree, and whether the
predictable attribute is a continuous numeric value or a discrete value; however, they can include the
minimum and maximum values of an attribute, weights assigned to values, the number of cases in a node,
coefficients used in a regression formula, and statistical measures such as standard deviation and
variance. For more information about how to interpret node distribution, see the topic for the specific type
of model type that you are working with.
NOTE
The NODE_DISTRIBUTION table may be empty, depending on the node type. For example, some nodes serve only
to organize a collection of child nodes, and it is the child nodes that contain the detailed statistics.
The nested table, NODE_DISTRIBUTION, always contains the following columns. The content of each
column varies depending on the model type. For more information about specific model types, see
Mining Model Content by Algorithm Type.
ATTRIBUTE_NAME
Content varies by algorithm. Can be the name of a column, such as a predictable attribute, a rule, an
itemset, or a piece of information internal to the algorithm, such as part of a formula.
This column can also contain an attribute-value pair.
ATTRIBUTE_VALUE
Value of the attribute named in ATTRIBUTE_NAME.
If the attribute name is a column, then in the most straightforward case, the ATTRIBUTE_VALUE contains
one of the discrete values for that column.
Depending on how the algorithm processes values, the ATTRIBUTE_VALUE can also contain a flag that
tells you whether a value exists for the attribute (Existing), or whether the value is null (Missing).
For example, if your model is set up to find customers who have purchased a particular item at least once,
the ATTRIBUTE_NAME column might contain the attribute-value pair that defines the item of interest,
such as Model = 'Water bottle' , and the ATTRIBUTE_VALUE column would contain only the keyword
Existing or Missing.
SUPPORT
Count of the cases that have this attribute-value pair, or that contain this itemset or rule.
In general, for each node, the support value tells you how many cases in the training set are included in
the current node. In most model types, support represents an exact count of cases. Support values are
useful because you can view the distribution of data within your training cases without having to query
the training data. The Analysis Services server also uses these stored values to calculate stored probability
versus prior probability, to determine whether inference is strong or weak.
For example, in a classification tree, the support value indicates the number of cases that have the
described combination of attributes.
In a decision tree, the sum of support at each level of a tree sums to the support of its parent node. For
example, if a model containing 1200 cases is divided equally by gender, and then subdivided equally by
three values for Income-Low, Medium, and High-the child nodes of node (2), which are nodes (4), (5) and
(6), always sum to the same number of cases as node (2).
For a clustering model, the number for support can be weighted to include the probabilities of belonging
to multiple clusters. Multiple cluster membership is the default clustering method. In this scenario,
because each case does not necessarily belong to one and only one cluster, support in these models might
not add up to 100 percent across all clusters.
PROBABILITY
Indicates the probability for this specific node within the entire model.
Generally, probability represents support for this particular value, divided by the total count of cases
within the node (NODE_SUPPORT).
However, probability is adjusted slightly to eliminate bias caused by missing values in the data.
For example, if the current values for [Total Children] are 'One' and 'Two', you want to avoid creating a
model that predicts that it is impossible to have no children, or to have three children. To ensure that
missing values are improbable, but not impossible, the algorithm always adds 1 to the count of actual
values for any attribute.
Example:
Probability of [Total Children = One] = [Count of cases where Total Children = One] + 1/[Count of all
cases] + 3
Probability of [Total Children = Two]= [Count of cases where Total Children = Two] +1/[Count of all
cases] +3
NOTE
The adjustment of 3 is calculated by adding 1 to the total number of existing values, n.
After adjustment, the probabilities for all values still add up to 1. The probability for the value with no data
(in this example, [Total Children = 'Zero', 'Three', or some other value]), starts at a very low non-zero level,
and rises slowly as more cases are added.
VARIANCE
Indicates the variance of the values within the node. By definition, variance is always 0 for discrete values.
If the model supports continuous values, variance is computed as σ (sigma), using the denominator n, or
the number of cases in the node.
There are two definitions in general use to represent standard deviation (StDev). One method for
calculating standard deviation takes into account bias, and another method computes standard deviation
without using bias. In general, Microsoft data mining algorithms do not use bias when computing
standard deviation.
The value that appears in the NODE_DISTRIBUTION table is the actual value for all discrete and
discretized attributes, and the mean for continuous values.
VALUE_TYPE
Indicates the data type of the value or an attribute, and the usage of the value. Certain value types apply
only to certain model types:
The value types are derived from the ADMOMD.NET enumeration. For more information, see
Microsoft.AnalysisServices.AdomdServer.MiningValueType.
Node Score
The meaning of the node score differs depending on the model type, and can be specific to the node type
as well. For information about how NODE_SCORE is calculated for each model and node type, see
Mining Model Content by Algorithm Type.
Node Probability and Marginal Probability
The mining model schema rowset includes the columns NODE_PROBABILITY and
MARGINAL_PROBABILITY for all model types. These columns contain values only in nodes where a
probability value is meaningful. For example, the root node of a model never contains a probability score.
In those nodes that do provide probability scores, the node probability and marginal probabilities
represent different calculations.
Marginal probability is the probability of reaching the node from its parent.
Node probability is the probability of reaching the node from the root.
Node probability is always less than or equal to marginal probability.
For example, if the population of all customers in a decision tree is split equally by gender (and no values
are missing), the probability of the child nodes should be .5. However, suppose that each of the nodes for
gender is divided equally by income levels-High, Medium, and Low. In this case the
MARGINAL_PROBABILITY score for each child node should always be .33 but the NODE_PROBABILTY
value will be the product of all probabilities leading to that node and thus always less than the
MARGINAL_PROBABILITY value.
Model root 1 1
Association rules models Mining Model Content for Association Model Query Examples
Association Models (Analysis
Services - Data Mining)
Clustering models Mining Model Content for Decision Clustering Model Query Examples
Tree Models (Analysis Services -
Data Mining)
Decision trees model Mining Model Content for Decision Decision Trees Model Query
Tree Models (Analysis Services - Examples
Data Mining)
ALGORITHM OR MODEL TYPE MODEL CONTENT QUERYING MINING MODELS
Linear regression models Mining Model Content for Linear Linear Regression Model Query
Regression Models (Analysis Services Examples
- Data Mining)
Logistic regression models Mining Model Content for Logistic Linear Regression Model Query
Regression Models (Analysis Services Examples
- Data Mining)
Naïve Bayes models Mining Model Content for Naive Naive Bayes Model Query Examples
Bayes Models (Analysis Services -
Data Mining)
Neural network models Mining Model Content for Neural Neural Network Model Query
Network Models (Analysis Services - Examples
Data Mining)
Sequence clustering Mining Model Content for Sequence Sequence Clustering Model Query
Clustering Models (Analysis Services Examples
- Data Mining)
Time series models Mining Model Content for Time Time Series Model Query Examples
Series Models (Analysis Services -
Data Mining)
See Also
Microsoft Generic Content Tree Viewer (Data Mining)
Data Mining Algorithms (Analysis Services - Data Mining)
Drillthrough on Mining Models
10/10/2018 • 3 minutes to read • Edit Online
Related Tasks
See the following topics for more information about how to use drillthrough with mining models.
TASKS LINKS
Use drillthrough in the mining model viewers Use Drillthrough from the Model Viewers
Retrieve case data for a model by using drillthrough Drill Through to Case Data from a Mining Model
Enable drillthrough on an existing mining model Enable Drillthrough for a Mining Model
See examples of drillthrough queries for specific model types. Data Mining Queries
Enable drillthrough in the Mining Model Wizard Completing the Wizard (Data Mining Wizard).
See Also
Drillthrough on Mining Structures
Filters for Mining Models (Analysis Services - Data
Mining)
11/27/2018 • 7 minutes to read • Edit Online
If the conditions are complex, you can use the second filter dialog box to work with one table at a time. When you
close the second filter dialog box, the expression is evaluated and then combined with filter conditions that have
been set on other columns in the case table.
Creating Filters on Nested Tables
If the data source view contains nested tables, you can use the second filter dialog box to build conditions on the
rows in the nested tables.
For example, if your case table is related to customers, and the nested table shows the products that a customer
has purchased, you can create a filter for customers who have purchased particular items by using the following
syntax in the nested table filter: [ProductName]='Water Bottle' OR ProductName='Water Bottle Cage' .
You can also filter on the existence of a particular value in the nested table by using the EXISTS or NOT EXISTS
keywords and a subquery. This lets you create conditions such as
EXISTS (SELECT * FROM Products WHERE ProductName='Water Bottle') . The EXISTS SELECT(<subquery>) returns true
if the nested table contains at least one row that includes the value, Water Bottle .
You can combine conditions on the case table with conditions on the nested table. For example, the following
syntax includes a condition on the case table ( Age > 30 ), a subquery on the nested table (
EXISTS (SELECT * FROM Products) ), and multiple conditions on the nested table (
WHERE ProductName='Milk' AND Quantity>2 ) ).
(Age > 30 AND EXISTS (SELECT * FROM Products WHERE ProductName='Milk' AND Quantity>2) )
When you have finished building the filter, the filter text is evaluated by Analysis Services, translated to a DMX
expression, and then saved with the model.
For instructions on how to use the filter dialog boxes in SQL Server Data Tools (SSDT), see Apply a Filter to a
Mining Model.
You can get the value of the Filter property of the MiningModel object in AMO, or inspect the Filter
element in XMLA.
You might also establish a naming convention for models to reflect the contents of the filter. This can make it
easier to tell related models apart.
How can I save a filter?
The filter expression is saved as a script that is stored with the associated mining model or nested table. If you
delete the filter text, it can only be restored by manually re-creating the filter expression. Therefore, if you create
complex filter expressions, you should create a backup copy of the filter text.
Why can't I see any effects from the filter?
Whenever you change or add a filter expression, you must reprocess the structure and model before you can
view the effects of the filter.
Why do I see filtered attributes in prediction query results?
When you apply a filter to a model, it affects only the selection of cases used for training the model. The filter
does not affect the attributes known to the model, or change or suppress data that is present in the data source.
As a result, queries against the model can return predictions for other types of cases, and dropdown lists of
values used by the model might show attribute values excluded by the filter.
For example, suppose you train the [Bike Buyer] model using only cases involving women aged 20-30. You can
still run a prediction query that predicts the probability of a man buying a bike, or predict the outcome for a
woman aged 30-40. That is because the attributes and values present in the data source define what is
theoretically possible, while the cases define the occurrences used for training. However, these queries would
return very small probabilities, because the training data does not contain any cases with the target values.
If you need to completely hide or anonymize attribute values in the model, there are various options:
Filter the incoming data as part of the definition of the data source view, or in the relational data source.
Mask or encode the attribute value.
Collapse excluded values into a category as part of the mining structure definition.
Related Resources
For more information about filter syntax, and examples of filter expressions, see Model Filter Syntax and
Examples (Analysis Services - Data Mining).
For information about how to use model filters when you are testing a mining model, see Choose an Accuracy
Chart Type and Set Chart Options.
See Also
Model Filter Syntax and Examples (Analysis Services - Data Mining)
Testing and Validation (Data Mining)
Model Filter Syntax and Examples (Analysis Services -
Data Mining)
11/27/2018 • 9 minutes to read • Edit Online
Filter Syntax
Filter expressions generally are equivalent to the content of a WHERE clause. You can connect multiple conditions
by using the logical operators AND, OR, and NOT.
In nested tables, you can also use the EXISTS and NOT EXISTS operators. An EXISTS condition evaluates to
true if the subquery returns at least one row. This is useful in cases where you want to restrict the model to cases
that contain a particular value in the nested table: for example, customers who have purchased an item at least
once.
A NOT EXISTS condition evaluates to true if the condition specified in the subquery does not exist. An example
is when you want to restrict the model to customers who have never purchased a particular item.
The general syntax is as follows:
filter
Contains one or more predicates, connected by logical operators.
predicate list
One or more valid filter expressions, separated by logical operators.
columnName
The name of a mining structure column.
logical operator
AND, OR, NOT
avPredicate
Filter expression that can be applied to scalar mining structure column only. An avPredicate expression can be
used in both model filters or nested table filters.
An expression that uses any of the following operators can only be applied to a continuous column. :
< (less than)
> (greater than)
>= (greater than or equal to)
<= (less than or equal to)
NOTE
Regardless of the data type, these operators cannot be applied to a column that has the type Discrete, Discretized, or Key.
An expression that uses any of the following operators can be applied to a continuous, discrete, discretized, or key
column:
= (equals)
!= (not equal to)
IS NULL
If the argument, avPredicate, applies to a discretized column, the value used in the filter can be any value in a
specific bucket.
In other words, you do not define the condition as AgeDisc = '25-35' , but instead compute and then use a value
from that interval.
Example: AgeDisc = 27 means any value in the same interval as 27, which in this case is 25-35.
nestedTablePredicate
Filter expression that applies to a nested table. Can be used in model filters only.
The sub-query argument of the argument, nestedTablePredicate, can only apply to a table mining structure
column
subquery
A SELECT statement followed by a valid predicate or list of predicates.
All the predicates must be of the type described in avPredicates. Furthermore, the predicates can refer only to
columns that are included in the current nested table, identified by the argument, columnName.
Limitations on Filter Syntax
The following restrictions apply to filters:
A filter can contain only simple predicates. These include mathematical operators, scalars, and column
names.
User-defined functions are not supported in the filter syntax.
Non-Boolean operators, such as the plus or minus signs, are not supported in the filter syntax.
Examples of Filters
The following examples demonstrate the use of filters applied to a mining model. If you create the filter expression
by using SQL Server Data Tools (SSDT), in the Property window and the Expression pane of the filter dialog
box, you would see only the string that appears after the WITH FILTER keywords. Here, the definition of the
mining structure is included to make it easier to understand the column type and usage.
Example 1: Typical Case -Level Filtering
This example shows a simple filter that restricts the cases used in the model to customers whose occupation is
architect and whose age is over 30.
CustomerId,
Age,
Occupation,
MaritalStatus,
ProductsOnSale
ProductName KEY
) WITH FILTER(OnSale),
ProductName KEY
) WITH FILTER(!OnSale)
WITH DRILLTHROUGH,
NOTE
Note that any extra columns that you add to the model might affect the results. Therefore, if you do not want the column to
be used in computation of the series, you should add the column only to the mining structure, and not to the model. You
can also set the model flag on the column to PredictOnly or to Ignore. For more information, see Modeling Flags (Data
Mining).
For other model types, you can use dates as input criteria or filter criteria just like you would in any other column.
However, if you need to use a specific level of granularity that is not supported by a Continuous data type, you
can create a derived value in the data source by using expressions to extract the unit to use in filtering and
analysis.
WARNING
When you specify a dates as filter criteria, you must use the following format, regardless of the date format for the current
OS: mm/dd/yyyy . Any other format results in an error.
For example, if you want to filter your call center results to show only weekends, you can create an expression in
the data source view that extracts the weekday name for each date, and then use that weekday name value for
input or as a discrete value in filtering. Just remember that repeating values can affect the model, so you should
use only one of the columns, not the date column plus the derived value.
See Also
Filters for Mining Models (Analysis Services - Data Mining)
Testing and Validation (Data Mining)
Mining Model Tasks and How-tos
5/16/2018 • 2 minutes to read • Edit Online
In This Section
Add a Mining Model to an Existing Mining Structure
Delete a Mining Model from a Mining Structure
Exclude a Column from a Mining Model
Create an Alias for a Model Column
Change the Discretization of a Column in a Mining Model
View or Change Modeling Flags (Data Mining)
Specify a Column to Use as Regressor in a Model
Change the Properties of a Mining Model
Apply a Filter to a Mining Model
Delete a Filter from a Mining Model
Enable Drillthrough for a Mining Model
View or Change Algorithm Parameters
Make a Copy of a Mining Model
Process a Mining Model
Create a Data Mining Dimension
See Also
Mining Structure Tasks and How -tos
Mining Models (Analysis Services - Data Mining)
Data Mining Concepts
Add a Mining Model to an Existing Mining Structure
5/16/2018 • 2 minutes to read • Edit Online
See Also
Mining Model Tasks and How -tos
Delete a Mining Model from a Mining Structure
5/16/2018 • 2 minutes to read • Edit Online
See Also
Mining Model Tasks and How -tos
Exclude a Column from a Mining Model
11/27/2018 • 2 minutes to read • Edit Online
See Also
Mining Model Tasks and How -tos
Create an Alias for a Model Column
10/26/2018 • 2 minutes to read • Edit Online
See Also
Mining Model Tasks and How -tos
Mining Model Properties
Change the Discretization of a Column in a Mining
Model
11/28/2018 • 2 minutes to read • Edit Online
NOTE
If the column usage is set to Ignore, the Properties window for the column is blank.
The new value will take effect when you select a different element in the designer.
3. In the Properties window, click the text box next to DiscretizationBucketCount and type a numeric value.
NOTE
If you change these properties, the structure must be reprocessed, along with any models that you want to use the
new setting.
See Also
Mining Model Tasks and How -tos
View or Change Modeling Flags (Data Mining)
5/16/2018 • 2 minutes to read • Edit Online
NOTE
After you change a modeling flag, you must reprocess the model.
See Also
Mining Model Tasks and How -tos
Modeling Flags (Data Mining)
Specify a Column to Use as Regressor in a Model
5/16/2018 • 2 minutes to read • Edit Online
NOTE
The algorithm will automatically detect which columns are the best regressors. You only need to force regressors
when you want to ensure that a column is included in the final formula.
NOTE
If the column usage is set to Ignore, the Properties window for the column is blank.
The new value will take effect when you select a different element in the designer.
See Also
Mining Model Tasks and How -tos
Apply a Filter to a Mining Model
11/28/2018 • 4 minutes to read • Edit Online
10. Click the AND/OR text box in the next row of the grid to add a condition.
For example, to create a BETWEEN condition, select AND from the drop-down list of logical operands.
11. Select an operator and type a value as described in Steps 7 and 8.
For example, select Income as the column again, select the less than operator (<), and then type 40000.
12. Click the next row in the grid.
13. The filter condition in the Expression text box is automatically updated to include the new condition. The
completed expression is as follows: [Income] > '30000'AND [Income] < '40000'
To add a filter on the nested table in a mining model
1. In the <name>Model Filter Dialog box, click an empty row in the grid under Mining Structure Column.
2. Select the name of the nested table from the drop-down list.
The icon at the left side of the text box changes to indicate that the selected item is the name of a table.
3. Click the Operator text box and select Contains or Not Contain.
These are the only conditions available for the nested table in the Model Filter dialog box, because you
are restricting the case table to only those cases that contain a certain value in the nested table. You will set
the value for the condition on the nested table in the next step.
4. Click the Value box, and then click the (...) button to build an expression.
The <name>Filter dialog box opens. This dialog box can set conditions only on the current table, which in
this case is the nested table.
5. Click the Mining Structure Column box and select a column name from the dropdown lists of nested
table columns.
6. Click Operator and select an operator from the list of valid operators for the column.
7. Click Value and type a value.
For example, for Mining Structure Column, select Model. For Operator, select <>, and type the value
Water Bottle. This condition creates the following filter expression:
EXISTS (SELECT * FROM [<nested table name>] WHERE [Model] <> 'Water Bottle' )
NOTE
Because the number of nested table attributes is potentially unlimited, Analysis Services does not supply a list of possible
values from which to select. You must type the exact value. Also, you cannot use a LIKE operator in a nested table.
1. Add more conditions as necessary, combining the conditions by selecting AND or OR in the AND/OR
box at the left side of the Conditions grid. Click OK.
2. In the Model Filter dialog box, review the conditions that you created by using the Filter dialog box. The
conditions for the nested table are appended to the conditions for the case table, and the complete set of
filter conditions is displayed in the Expression text box.
3. Optionally, click Edit Query to manually change the filter expression.
NOTE
If you change any part of a filter expression manually, the grid will be disabled and thereafter you must work with
the filter expression in text edit mode only. To restore grid editing mode, you must clear the filter expression and
start over.
See Also
Filters for Mining Models (Analysis Services - Data Mining)
Mining Model Tasks and How -tos
Delete a Filter from a Mining Model
Delete a Filter from a Mining Model
11/28/2018 • 2 minutes to read • Edit Online
NOTE
You can view the properties of a mining model in SQL Server Data Tools (SSDT), but not in SQL Server Management Studio.
See Also
Drill Through to Case Data from a Mining Model
Mining Model Tasks and How -tos
Filters for Mining Models (Analysis Services - Data Mining)
Enable Drillthrough for a Mining Model
11/28/2018 • 2 minutes to read • Edit Online
NOTE
If the training cases have not been cached, you must change the MiningStructureCacheMode property to
KeepTrainingCases and then reprocess the model before you can view the case data.
See Also
Drillthrough Queries (Data Mining)
View or Change Algorithm Parameters
5/16/2018 • 2 minutes to read • Edit Online
select MINING_PARAMETERS
from $system.DMSCHEMA_MINING_MODELS
WHERE MODEL_NAME = '<model name>'
See Also
Mining Model Tasks and How -tos
Process a Mining Model
5/16/2018 • 2 minutes to read • Edit Online
See Also
Mining Model Tasks and How -tos
Make a Copy of a Mining Model
11/28/2018 • 2 minutes to read • Edit Online
See Also
Filters for Mining Models (Analysis Services - Data Mining)
Mining Model Tasks and How -tos
Delete a Filter from a Mining Model
Create a Data Mining Dimension
5/16/2018 • 2 minutes to read • Edit Online
See Also
Mining Structure Tasks and How -tos
Testing and Validation (Data Mining)
5/16/2018 • 4 minutes to read • Edit Online
Learn how to set up a testing data set using a wizard or Training and Testing Data Sets
DMX commands
Learn how to test the distribution and representativeness of Cross-Validation (Analysis Services - Data Mining)
the data in a mining structure
Learn about the accuracy chart types provided. Lift Chart (Analysis Services - Data Mining)
Learn how to create a classification matrix, sometimes called Classification Matrix (Analysis Services - Data Mining)
a confusion matrix, for assessing the number of true and
false positives and negatives.
See Also
Data Mining Tools
Data Mining Solutions
Testing and Validation Tasks and How -tos (Data Mining)
Training and Testing Data Sets
10/26/2018 • 7 minutes to read • Edit Online
PROPERTY DESCRIPTION
If you add or change a test data set to an existing structure, you must reprocess the structure and all associated
models. Also, because dividing the source data causes the model to be trained on a different subset of the data,
you might see different results from your model.
Specifying Holdout Programmatically
You can define testing and training data sets on a mining structure by using DMX statements, AMO, or XML
DDL. The ALTER MINING STRUCTURE statement does not support the use of holdout parameters.
DMX In the Data Mining Extensions (DMX) language, the CREATE MINING STRUCTURE statement has
been extended to include a WITH HOLDOUT clause..
ASSL You can either create a new mining structure, or add a testing data set to an existing mining
structure, by using the Analysis Services Scripting Language (ASSL )..
AMO You can also view and modify holdout data sets by using AMO..
You can view information about the holdout data set in an existing mining structure by querying the data mining
schema rowset. You can do this by making a DISCOVER ROWSET call, or you can use a DMX query.
To retrieve only the test cases, and additionally filter the test cases on one of the columns in the mining structure,
use the following syntax:
SELECT * from <structure>.CASES WHERE IsTestCase() AND <structure column name> = '<value>'
Related Content
TOPICS LINKS
Describes how filters on a model interact with training and Filters for Mining Models (Analysis Services - Data Mining)
testing data sets.
Describes how the use of training and testing data affects Cross-Validation (Analysis Services - Data Mining)
cross-validation.
Provides information on the programmatic interfaces for AMO Concepts and Object Model
working with training and testing sets in a mining structure.
MiningStructure Element (ASSL)
Provides DMX syntax for creating holdout sets. CREATE MINING STRUCTURE (DMX)
Retrieve information about cases in the training and testing Data Mining Schema Rowsets
sets.
Data Mining Schema Rowsets (SSAs)
See Also
Data Mining Tools
Data Mining Concepts
Data Mining Solutions
Testing and Validation (Data Mining)
Lift Chart (Analysis Services - Data Mining)
11/27/2018 • 9 minutes to read • Edit Online
The x-axis of the chart represents the percentage of the test dataset that is used to compare the predictions. The y-
axis of the chart represents the percentage of predicted values.
The diagonal straight line, shown here in blue, appears in every chart. It represents the results of random
guessing, and is the baseline against which to evaluate lift. For each model that you add to a lift chart, you get two
additional lines: one line shows the ideal results for the training data set if you could create a model that always
predicted perfectly, and the second line shows the actual lift, or improvement in results, for the model.
In this example, the ideal line for the filtered model is shown in dark blue, and the line for actual lift in yellow. You
can tell from the chart that the ideal line peaks at around 40 percent, meaning that if you had a perfect model, you
could reach 100 percent of your targeted customers by sending a mailing to only 40% of the total population. The
actual lift for the filtered model when you target 40 percent of the population is between 60 and 70 percent,
meaning you could reach 60-70 percent of your targeted customers by sending the mailing to 40 percent of the
total customer population.
The Mining Legend contains the actual values at any point on the curves. You can change the place that is
measured by clicking the vertical gray bar and moving it. In the chart, the gray line has been moved to 30 percent,
because this is the point where both the filtered and unfiltered models appear to be most effective, and after this
point the amount of lift declines.
The Mining Legend also contains scores and statistics that help you interpret the chart. These results represent
the accuracy of the model at the gray line, which in this scenario is positioned to include 30 percent of the overall
test cases.
SERIES AND MODEL SCORE TARGET POPULATION PREDICT PROBABILITY
Back to Top
Interpreting the Results
From these results, you can see that, when measured at 30 percent of all cases, the general model, [Targeted
mailing all], can predict the bike buying behavior of 47.40% of the target population. In other words, if you sent
out a targeted mailing to only 30 percent of the customers in your database, you could reach slightly less than half
of your target audience. If you used the filtered model, you could get slightly better results, and reach about 51
percent of your targeted customers.
The value for Predict probability represents the threshold required to include a customer among the "likely to
buy" cases. For each case, the model estimates the accuracy of each prediction and stores that value, which you
can use to filter out or to target customers. For example, to identify the customers from the basic model who are
likely buyers, you would use a query to retrieve cases with a Predict probability of at least 61 percent. To get the
customers targeted by the filtered model, you would create query that retrieved cases that met all the criteria: age
and a PredictProbability value of at least 46 percent.
It is interesting to compare the models. The filtered model appears to capture more potential customers, but when
you target customers with a prediction probability score of 46 percent, you also have a 53 percent chance of
sending a mailing to someone who will not buy a bike. Therefore, if you were deciding which model is better, you
would want to balance the greater precision and smaller target size of the filtered model against the selectiveness
of the basic model.
The value for Score helps you compare models by calculating the effectiveness of the model across a normalized
population. A higher score is better, so in this case you might decide that targeting customers under 30 is the most
effective strategy, despite the lower prediction probability.
How is the Score Calculated?
The score is calculated as the geometric mean score of all the points constituting a scatter plot in which the x-axis
contains the actual values, the y-axis contains the predicted value, and each point has an associated probability.
The statistical meaning of any individual point score is the predictive lift for the model measured at that point. The
average of all points constitutes the score for the model.
Back to Top
Lift Chart for Model with No Target Value
If you do not specify the state of the predictable column, you create the type of chart shown in the following
diagram. This chart shows how the model performs for all states of the predictable attribute. For example, this
chart would tell you how well the model predicts both customers who are likely to buy a bike, and those who are
unlikely to buy a bike.
The x-axis is the same as in the chart with the predictable column specified, but the y-axis now represents the
percentage of predictions that are correct. Therefore, the ideal line is the diagonal line, which shows that at 50
percent of the data, the model correctly predicts 50% of the cases, the maximum that can be expected.
You can click in the chart to move the vertical gray bar, and the Mining Legend displays the percentage of cases
overall, and the percentage of cases that were predicted correctly. For example, if you position the gray slider bar
at the 50 percent mark, the Mining Legend displays the following accuracy scores. These figures are based on
the TM_Decision Tree model created in the Basic Data Mining Tutorial.
This table tells you that, at 50 percent of the population, the model that you created correctly predicts 40 percent
of the cases. You might consider this a reasonably accurate model. However, remember that this particular model
predicts all values of the predictable attribute. Therefore, the model might be accurate in predicting that 90 percent
of customers will not buy a bike.
Back to Top
Restrictions on Lift Charts
Lift charts require that the predictable attribute be a discrete value. In other words, you cannot use lift charts to
measure the accuracy of models that predict continuous numeric values.
The prediction accuracy for all discrete values of the predictable attribute is shown in a single line. If you want to
see prediction accuracy lines for any individual value of the predictable attribute, you must create a separate lift
chart for each targeted value.
You can add multiple models to a lift chart, as long as the models all have the same predictable attribute. Models
that do not share the attribute will be unavailable for selection in the Input tab.
You cannot display time series models in a lift chart or profit chart. A common practice for measuring the accuracy
of time series predictions is to reserve a portion of historical data and compare that data to the predictions. For
more information, see Microsoft Time Series Algorithm.
Related Content
Back to Top
See Also
Testing and Validation (Data Mining)
Profit Chart (Analysis Services - Data Mining)
11/27/2018 • 4 minutes to read • Edit Online
Saving Charts
When you create an accuracy chart or profit chart, no objects are created on the server. Instead, queries are
executed against an existing model and the results are rendered in the viewer. If you need to save the results, you
must copy either the chart or the results to Excel or another file.
Related Content
The following topics contain more information about how you can build and use accuracy charts.
TOPICS LINKS
Provides a walkthrough of how to create a lift chart for the Basic Data Mining Tutorial
Targeted Mailing model.
Testing Accuracy with Lift Charts (Basic Data Mining Tutorial)
Explains related chart types. Lift Chart (Analysis Services - Data Mining)
Describes cross-validation for mining models and mining Cross-Validation (Analysis Services - Data Mining)
structures.
Describes steps for creating lift charts and other accuracy Testing and Validation Tasks and How-tos (Data Mining)
charts.
See Also
Testing and Validation (Data Mining)
Testing Accuracy with Lift Charts (Basic Data Mining Tutorial)
Classification Matrix (Analysis Services - Data Mining)
5/16/2018 • 4 minutes to read • Edit Online
0 362 144
1 121 373
The first result cell, which contains the value 362, indicates the number of true positives for the value 0. Because 0
indicates that the customer did not purchase a bike, this statistic tells you that model predicted the correct value
for non bike-buyers in 362 cases.
The cell directly underneath that one, which contains the value 121, tells you the number of false positives, or how
many times the model predicted that someone would buy a bike when actually they did not.
The cell that contains the value 144 indicates the number of false positives for the value 1. Because 1 means that
the customer did purchase a bike, this statistic tells you that in 144 cases, the model predicted someone would not
buy a bike when in fact they did.
Finally, the cell that contains the value 373 indicates the number of true positives for the target value of 1. In other
words, in 373 cases the model correctly predicted that someone would buy a bike.
By summing the values in cells that are diagonally adjacent, you can determine the overall accuracy of the model.
One diagonal tells you the total number of accurate predictions, and the other diagonal tells you the total number
of erroneous predictions.
Using Multiple Predictable Values
The [Bike Buyer] case is especially easy to interpret because there are only two possible values. When the
predictable attribute has multiple possible values, the classification matrix adds a new column for each possible
actual value and then counts the number of matches for each predicted value. The following table shows the
results on a different model, where three values (0, 1, 2) are possible.
0 111 3 5
1 2 123 17
2 19 0 20
Although the addition of more columns makes the report look more complex, the additional detail can be very
useful when you want to assess the cumulative cost of making the wrong prediction. To create sums on the
diagonals or to compare the results for different combinations of rows, you can click the Copy button provided in
the Classification Matrix tab and paste the report into Excel. Alternatively, you can use a client such as the Data
Mining Client for Excel, which supports SQL Server 2005 (9.x) and later versions, to create a classification report
directly in Excel that includes both counts and percentages. For more information, see SQL Server Data Mining.
Related Content
The following topics contain more information about how you can build and use classification matrices and other
charts.
TOPICS LINKS
Provides a walkthrough of how to create a lift chart for the Basic Data Mining Tutorial
Targeted Mailing model.
Testing Accuracy with Lift Charts (Basic Data Mining Tutorial)
Explains related chart types. Lift Chart (Analysis Services - Data Mining)
Describes uses of cross-validation for mining models and Cross-Validation (Analysis Services - Data Mining)
mining structures.
Describes steps for creating lift charts and other accuracy Testing and Validation Tasks and How-tos (Data Mining)
charts.
See Also
Testing and Validation (Data Mining)
Scatter Plot (Analysis Services - Data Mining)
5/16/2018 • 2 minutes to read • Edit Online
You can pause the mouse on any point scattered around the line to view the predicted and actual values in a
tooltip. There is no Mining Legend for a scatter plot; however, the chart itself contains a legend that displays the
score associated with the model. For more information about interpreting the score, see Mining Model Content
for Linear Regression Models (Analysis Services - Data Mining).
You can copy the visual representation of the chart to the Clipboard, but not the underlying data or the formula. If
you want to view the regression formula for the line, you can create a content query against the model. For more
information, see Linear Regression Model Query Examples.
Restrictions on Scatter Plots
A scatter plot can only be created if the model that you choose on the Input Selection tab contains a continuous
predictable attribute. You do not have to make any additional selections; the scatter plot chart type is automatically
displayed in the Lift Chart tab based on model and attribute type.
Although time series models predict continuous numbers, you cannot measure the accuracy of a time series
model by using a scatter plot. There are other methods that you can use, such as reserving a portion of the
historical data. For more information, see Time Series Model Query Examples.
Related Content
The following topics contain more information about how you can build and use scatter plots and related accuracy
charts.
TOPICS LINKS
Provides a walkthrough of how to create a lift chart for the Basic Data Mining Tutorial
Targeted Mailing model.
Testing Accuracy with Lift Charts (Basic Data Mining Tutorial)
Explains related chart types. Lift Chart (Analysis Services - Data Mining)
Describes uses of cross-validation for mining models and Cross-Validation (Analysis Services - Data Mining)
mining structures.
Describes steps for creating lift charts and other accuracy Testing and Validation Tasks and How-tos (Data Mining)
charts.
See Also
Testing and Validation (Data Mining)
Cross-Validation (Analysis Services - Data Mining)
11/28/2018 • 11 minutes to read • Edit Online
Configuring Cross-Validation
You can customize the way that cross-validation works to control the number of cross-sections, the models that
are tested, and the accuracy bar for predictions. If you use the cross-validation stored procedures, you can also
specify the data set that is used for validating the models. This wealth of choices means that you can easily
produce many sets of different results that must then be compared and analyzed.
This section provides information to help you configure cross-validation appropriately.
Setting the Number of Partitions
When you specify the number of partitions, you determine how many temporary models will be created. For
each partition, a cross-section of the data is flagged for use as the test set, and a new model is created by training
on the remaining data not in the partition. This process is repeated until Analysis Services has created and tested
the specified number of models. The data that you specified as being available for cross-validation is distributed
evenly among all partitions.
The example in the diagram illustrates the usage of data if three folds are specified.
In the scenario in the diagram, the mining structure contains a holdout data set that is used for testing, but the
test data set has not been included for cross-validation. As a result, all the data in the training data set, 70 percent
of the data in the mining structure, is used for cross-validation. The cross-validation report shows the total
number of cases used in each partition.
You can also specify the amount of data that is used during cross-validation, by specifying the number of overall
cases to use. The cases are distributed evenly across all folds.
For mining structures stored in an instance of SQL Server Analysis Services, the maximum value that you can
set for the number of folds is 256, or the number of cases, whichever is less. If you are using a session mining
structure, the maximum number of folds is 10.
NOTE
As you increase the number of folds, the time required to perform cross-validation increases accordingly, because a model
must be generated and tested for each fold. You may experience performance problems if the number of folds is too high.
NOTE
You can set a value of 0.0 for the threshold, but the value is meaningless, because every prediction will be counted as
correct, even those with zero probability. Be careful not to accidentally set State Threshold to 0.0.
Results of Cross-Validation
If you use the Data Mining Designer, these results are displayed in a grid-like Web viewer. If you use the cross-
validation stored procedures, these same results are returned as a table.
The report contains two types of measures: aggregates that indicate the variability of the data set when divided
into folds, and model-specific measures of accuracy for each fold. The following topics provide more information
about these metrics:
Cross-Validation Formulas
Lists all the measures by test type. Describes in general how the measures can be interpreted.
Measures in the Cross-Validation Report
Describes the formulas for calculating each measure, and lists the type of attribute that each measure can be
applied to.
Restrictions on Cross-Validation
If you perform cross-validation by using the cross-validation report in SQL Server Development Studio, there
are some limitations on the models that you can test and the parameters you can set.
By default, all models associated with the selected mining structure are cross-validated. You cannot
specify the model or a list of models.
Cross-validation is not supported for models that are based on the Microsoft Time Series algorithm or
the Microsoft Sequence Clustering algorithm.
The report cannot be created if your mining structure does not contain any models that can be tested by
cross-validation.
If the mining structure contains both clustering and non-clustering models and you do not choose the
#Cluster option, results for both types of models are displayed in the same report, even though the
attribute, state, and threshold settings might not be appropriate for the clustering models.
Some parameter values are restricted. For example, a warning is displayed if the number of folds is more
than 10, because generating so many models might cause the report to display slowly.
If you are testing multiple mining models, and the models have filters, each model is filtered separately. You
cannot add a filter to a model or change the filter for a model during cross-validation.
Because cross-validation by defaults tests all mining models that are associated with a structure, you may receive
inconsistent results if some models have a filter and others do not. To ensure that you compare only those
models that have the same filter, you should use the stored procedures and specify a list of mining models. Or,
use only the mining structure test set with no filters to ensure that a consistent set of data is used for all models.
If you perform cross-validation by using the stored procedures, you have the additional option of choosing the
source of testing data. If you perform cross-validation by using the Data Mining Designer, you must use the
testing data set that is associated with the model or structure, if any. Generally, if you want to specify advanced
settings, you should use the cross-validation stored procedures.
Cross-validation cannot be used with time series or sequence clustering models. Specifically, no model that
contains a KEY TIME column or a KEY SEQUENCE column can be included in cross-validation.
Related Content
See the following topics for more information about cross-validation, or information about related methods for
testing mining models, such as accuracy charts.
TOPICS LINKS
Describes how to set cross-validation parameters in SQL Cross-Validation Tab (Mining Accuracy Chart View)
Server Development Studio.
Explains the cross-validation report format and defines the Measures in the Cross-Validation Report
statistical measures provided for each model type.
Lists the stored procedures for computing cross-validation Data Mining Stored Procedures (Analysis Services - Data
statistics. Mining)
Describes how to create a testing data set for mining Training and Testing Data Sets
structures and related models.
TOPICS LINKS
See examples of other accuracy chart types. Classification Matrix (Analysis Services - Data Mining)
Describes steps for creating various accuracy charts. Testing and Validation Tasks and How-tos (Data Mining)
See Also
Testing and Validation (Data Mining)
Measures in the Cross-Validation Report
5/16/2018 • 3 minutes to read • Edit Online
Case likelihood:
This measure usually indicates how likely it is that a case
belongs to a particular cluster. For cross-validation, the scores
are summed and then divided by the number of cases, so
here the score is an average case likelihood.
Cases that have missing values for the target attribute are
excluded, meaning the counts of all values might not add up.
Pass/Fail:
Count of rows or values in the partition where the predicted
state matches the target state, and where the predict
probability value is greater than 0.
Lift:
The ratio of the actual prediction probability to the marginal
probability in the test cases. Rows that have missing values
for the target attribute are excluded.
Log score:
The logarithm of the actual probability for each case,
summed, and then divided by the number of rows in the
input dataset, excluding rows that have missing values for the
target attribute.
Log Score:
The logarithm of the actual probability for each case,
summed, and then divided by the number of rows in the
input dataset, excluding rows that have missing values for the
target attribute.
Mean:
Average of the partition values for a particular measure.
Standard Deviation:
Average of the deviation from the mean for a specific
measure, across all the partitions in a model.
See Also
Testing and Validation (Data Mining)
Cross-Validation Formulas
5/16/2018 • 3 minutes to read • Edit Online
True positive Discrete attribute, value is specified Count of cases that meet these
conditions:
True Negative Discrete attribute, value is specified Count of cases that meet these
conditions:
False positive Discrete attribute, value is specified Count of cases that meet these
conditions:
False Negative Discrete attribute, value is specified Count of cases that meet these
conditions:
Pass/fail Discrete attribute, no specified target Count of cases that meet these
conditions:
Otherwise, fail.
Lift Discrete attribute. Target value can be The mean log likelihood for all rows
specified but is not required. with values for the target attribute,
where log likelihood for each case is
calculated as
Log(ActualProbability/MarginalProbabili
ty). To compute the mean, the sum of
the log likelihood values is divided by
the number of rows in the input
dataset, excluding rows with missing
values for the target attribute.
Log score Discrete attribute. Target value can be Log of the actual probability for each
specified but is not required. case, summed, and then divided by the
number of rows in the input dataset,
excluding rows with missing values for
the target attribute.
Mean absolute error Continuous attribute Sum of the absolute error for all cases
in the partition, divided by the number
of cases in the partition.
Root mean square error Continuous attribute Square root of the mean squared error
for the partition.
MEASURE APPLIES TO IMPLEMENTATION
Root mean squared error Discrete attribute. Target value can be Square root of the mean of the squares
specified but is not required. of complement of the probability score,
divided by the number of cases in the
partition, excluding rows with missing
values for the target attribute.
Root mean squared error Discrete attribute, no specified target. Square root of the mean of the squares
of complement of the probability score,
divided by the number of cases in the
partition, excluding cases with missing
values for the target attribute.
See Also
Testing and Validation (Data Mining)
Cross-Validation (Analysis Services - Data Mining)
Testing and Validation Tasks and How-tos (Data
Mining)
5/16/2018 • 2 minutes to read • Edit Online
In This Section
Create a Lift Chart, Profit Chart, or Classification Matrix
Create a Cross-Validation Report
Choose and Map Model Testing Data
Apply Filters to Model Testing Data
Choose the Column to Use for Testing a Mining Model
Using Nested Table Data as an Input for an Accuracy Chart
Create a Lift Chart, Profit Chart, or Classification
Matrix
11/28/2018 • 4 minutes to read • Edit Online
NOTE
If the Synchonize prediction columns and values box is selected, Analysis Services analyzes the data in the
predictable columns of the model and the test data, and attempts to find the best match. Therefore, do not clear the
box unless absolutely necessary to force a comparison of the columns.
5. Click the Predict Value text box, and select a value from the list. If the predictable column is a continuous
data type, you must type a value in the text box.
For more information, see Choose the Column to Use for Testing a Mining Model.
Select testing data
1. On the Input Selection tab of the Mining Accuracy Chart tab, specify the source of the data that you will
use to generate the chart by selecting one of the options in the group, Select data set to be used for
accuracy chart.
Select the option, Use Mining Model test cases, if you want to use the subset of cases that is
defined by the intersection of the mining structure test cases and any filters that may have been
applied during model creation.
Select the option, Use mining structure test cases, to use the full set of testing cases that were
defined as part of the mining structures holdout data set.
Select the option, Specify a different data set, if you want to use external data. The data set must
be available as a data source view. Click the browse (...) button to choose the data tables to use for
the accuracy chart. For more information, see Choose and Map Model Testing Data.
If you are using an external data set, you can optionally filter the input data set. For more information,
see Apply Filters to Model Testing Data.
NOTE
You cannot create a filter on the model test cases or the mining structure test cases on the Input Selection tab. To create a
filter on the mining model, modify the Filter property of the model. For more information, see Apply a Filter to a Mining
Model.
See Also
Lift Chart (Analysis Services - Data Mining)
Classification Matrix (Analysis Services - Data Mining)
Create a Cross-Validation Report
5/16/2018 • 3 minutes to read • Edit Online
NOTE
If you do not enter a value, the Target Threshold option is not available, and the model is assessed for all possible
values of the predictable attribute.
5. Optionally, for Target Threshold, type a decimal number between 0 and 1 to specify the minimum
probability that a prediction must have to be counted as accurate.
For additional tips about how to set probability thresholds, see Measures in the Cross-Validation Report.
6. Click Get Results.
Print the cross-validation report
1. Right-click the completed report on the Cross Validation tab.
2. In the shortcut menu, select Print or Print Preview to review the report first.
Create a copy of the report in Microsoft Excel
1. Right-click the completed report on the Cross Validation tab.
2. In the shortcut menu, select Select All.
3. Right-click the selected text, and select Copy.
4. Paste the selection into an open Excel workbook. If you use the Paste option, the report is pasted into Excel
as HTML, which preserves row and column formatting. If you paste the report by using the Paste Special
options for text or Unicode text, the report is pasted in row -delimited format.
See Also
Measures in the Cross-Validation Report
Choose and Map Model Testing Data
11/28/2018 • 5 minutes to read • Edit Online
See Also
Testing and Validation Tasks and How -tos (Data Mining)
Apply Filters to Model Testing Data
11/28/2018 • 4 minutes to read • Edit Online
The behavior of filters is slightly different, depending on whether you are filtering model training data or a testing
data set:
When you define a filter on a testing data set, you create a WHERE clause on the incoming data. If you are
filtering an input data set used for evaluating a model, the filter expression is translated to a Transact-SQL
statement and applied to the input table when the chart is created. As a result, the number of test cases can
be greatly reduced.
When you apply a filter to a mining model, the filter expression that you create is translated to a Data
Mining Extensions (DMX) statement, and applied to the individual model. Therefore, when you apply a filter
to a model, only a subset of the original data is used to train the model. This can cause problems if you filter
the training model with one set of criteria, so that the model is tuned to a certain set of data, and then test
the model with another set of criteria.
If you defined a testing data set when you created the structure, the model cases used for training include
only those cases that are in the mining structure training set and which meet the conditions of the filter.
Thus, when you are testing a model and select the option Use mining model test cases, the testing cases
will include only the cases that are in the mining structure test set and which meet the conditions of the
filter. However, if you did not define a holdout data set, the model cases used for testing include all the cases
in the data set that meet the filter conditions
Filter conditions that you apply on a model also affect drillthrough queries on the model cases.
In summary, when you test multiple models, even if all the models are based on the same mining structure, you
must be aware that the models potentially use different subsets of data for training and testing. This can have the
following effects on accuracy charts:
The total number of cases in the testing sets can vary among the models being tested.
The percentages for each model may not align in the chart, if the models use different subsets of training
data or testing data.
To determine whether a model contains a predefined filter that might affect results, you can look for the Filter
property in the Property pane, or you can query the model by using the data mining schema rowsets. For
example, the following query returns the filter text for the specified model:
SELECT [FILTER] FROM $system.DMSCHEMA_MINING_MODELS WHERE MODEL_NAME = 'name of model'
WARNING
If you want to remove the filter from an existing mining model, or change the filter conditions, you must reprocess the
mining model.
For more information about the kinds of filters you can apply, and how filter expressions are evaluated, see Model
Filter Syntax and Examples (Analysis Services - Data Mining).
Create a filter on external testing data
1. Double-click the mining structure that contains the model you want to test, to open Data Mining Designer.
2. Select the Mining Accuracy Chart tab, and then select the Input Selection tab.
3. On the Input Selection tab, under Select data set to be used for Accuracy Chart, select the option
Specify a different data set.
4. Click the browse button (...) to open a dialog box and choose the external data set.
5. Choose the case table, and add a nested table if necessary. Map columns in the model to columns in the
external data set as necessary. Close the Specify Column Mapping dialog box to save the source table
definition.
6. Click Open Filter Editor to define a filter for the data set.
The Data Set Filter dialog box opens. If the structure contains a nested table, you can create a filter in two
parts. First, set conditions on the case table by using the Data Set Filter dialog box, and then set conditions
on the nested rows by using the Filter dialog box.
7. In the Data Set Filter dialog box, click the top row in the grid, under Mining Structure Column, and
select a table or column from the list.
If the data source view contains multiple tables, or a nested table, you must first select the table name.
Otherwise, you can select columns from the case table directly.
Add a new row for each column that you want to filter.
8. Use Operator, and Value columns to define how the column is filtered.
Note Type values without using quotation marks.
9. Click the And/Or text box and select a logical operator to define how multiple conditions are combine.
10. Optionally, click the browse button (...) at the right of the Value text box to open the Filter dialog box and
set conditions on the nested table or on the individual case table columns.
11. Verify that the completed filter conditions are correct by viewing the text in the Expression pane.
12. Click OK.
The filter condition is applied to the data source when you create the accuracy chart.
See Also
Choose and Map Model Testing Data
Using Nested Table Data as an Input for an Accuracy Chart
Choose an Accuracy Chart Type and Set Chart Options
Choose the Column to Use for Testing a Mining
Model
11/28/2018 • 2 minutes to read • Edit Online
See Also
Choose and Map Model Testing Data
Choose an Accuracy Chart Type and Set Chart Options
Choose an Accuracy Chart Type and Set Chart
Options
5/16/2018 • 2 minutes to read • Edit Online
See Also
Choose and Map Model Testing Data
Apply Filters to Model Testing Data
Data Mining Queries
5/16/2018 • 8 minutes to read • Edit Online
WARNING
Not all models are used to make predictions. For example, you can create a clustering model that does not
have a predictable attribute. However, even if a model does not have a predictable attribute, you can create
prediction queries that return other types of useful information from the model.
Custom prediction functions: Each model type provides a set of prediction functions designed
for working with the patterns created by that algorithm.
For example, the Lag function is provided for time series models, to let you view the historical data
used for the model. For clustering models, functions such as ClusterDistance are more
meaningful.
For more information about the functions that are supported for each model type, see the
following links:
Decision Trees Model Query Examples Sequence Clustering Model Query Examples
Linear Regression Model Query Examples Time Series Model Query Examples
You can also call VBA functions, or create your own functions. For more information, see Functions
(DMX).
General statistics: There are a number of functions that can be used with almost any model type,
which return a standard set of descriptive statistics, such as standard deviation.
For example, the PredictHistogram function returns a table that lists all the states of the specified
column.
For more information, see General Prediction Functions (DMX).
Custom statistics: Additional supporting functions are provided for each model type, to generate
statistics that are relevant to the specific analytical task.
For example, when you are working with a clustering model, you can use the function,
PredictCaseLikelihood, to return the likelihood score associated with a certain case and cluster.
However, if you created a linear regression model, you would be more interested in retrieving the
coefficient and intercept, which you can do using a content query.
Model content functions: The content of all models is represented in a standardized format that
lets you retrieve information with a simple query. You create queries on the model content by using
DMX. You can also get some type of model content by using the data mining schema rowsets.
In the model content, the meaning of each row or node of the table that is returned differs
depending on the type of algorithm that was used to build the model, as well as the data type of
the column. For more information, see Content Queries (Data Mining).
Requirements
Before you can create a query against a model, the data mining model must have been processed.
Processing of Analysis Services objects requires special permissions. For more information on processing
mining models, see Processing Requirements and Considerations (Data Mining).
To execute queries against a data mining model requires different levels of permissions, depending on the
type of query that you run. For example, drillthrough to case or structure data typically requires additional
permissions which can be set on the mining structure object or mining model object.
However, if your query uses external data, and includes statements such as OPENROWSET or
OPENQUERY, the database that you are querying must enable these statements, and you must have
permission on the underlying database objects.
For more information on the security contexts required to run data mining queries, see Security Overview
(Data Mining)
In This Section
The topics in this section introduce each type of data mining query in more detail, and provide links to
detailed examples of how to create queries against data mingin models.
Prediction Queries (Data Mining)
Content Queries (Data Mining)
Drillthrough Queries (Data Mining)
Data Definition Queries (Data Mining)
Data Mining Query Tools
Related Tasks
Use these links to learn how to create and work with data mining queries.
TASKS LINKS
View tutorials and walkthroughs on data mining queries Lesson 6: Creating and Working with Predictions (Basic
Data Mining Tutorial)
Use data mining query tools in SQL Server Management Create a DMX Query in SQL Server Management Studio
Studio and SQL Server Data Tools (SSDT)
Create a Prediction Query Using the Prediction Query
Builder
Work with external data used in prediction queries Choose and Map Input Data for a Prediction Query
Work with the results of queries View and Save the Results of a Prediction Query
Use DMX and XMLA query templates provided in Create a Singleton Prediction Query from a Template
Management Studio
Create a Data Mining Query by Using XMLA
Learn more about content queries and see examples Create a Content Query on a Mining Model
Set query options and troubleshoot query permissions Change the Time-out Value for Data Mining Queries
and problems
Use the data mining components in Integration Services Data Mining Query Task
See Also
Data Mining Algorithms (Analysis Services - Data Mining)
Mining Model Content (Analysis Services - Data Mining)
Prediction Queries (Data Mining)
11/28/2018 • 10 minutes to read • Edit Online
Singleton prediction queries Use a singleton query when you want to predict outcomes for
a single new case, or multiple new cases. You provide the
input values directly in the query, and the query is executed
as a single session.
Batch predictions Use batch predictions when you have external data that you
want to feed into the model, to use as the basis for
predictions. To make predictions for an entire set of data, you
map the data in the external source to the columns in the
model, and then specify the type of predictive data you want
to output.
Time Series predictions Use a time series query when you want to predict a value
over some number of future steps. SQL Server Data Mining
also provides the following functionality in time series queries:
The following sections describe the general syntax of prediction queries, the different types of prediction queries,
and how to work with the results of prediction queries.
Basic Prediction Query Design
Adding Prediction Functions
Singleton Queries
Batch Prediction Queries
Time Series Queries
Working with the Results of Queries
WARNING
Despite the name, singleton prediction queries do not just make single predictions-you can generate multiple predictions for
each set of inputs. You provide multiple input cases by creating a SELECT statement for each input case and combining them
with the UNION operator.
When you create a singleton prediction query, you must provide the new data to the model in the form of a
PREDICTION JOIN. This means that even though you are not mapping to an actual table, you must make sure
that the new data matches the existing columns in the mining model. If the new data columns and the new data
match exactly, Analysis Services will map the columns for you. This is called a NATURAL PREDICTION JOIN.
However, if the columns do not match, or if the new data does not contain the same kind and amount of data that
is in the model, you must specify which columns in the model map to the new data, or specify the missing values.
Batch Prediction Queries
A batch prediction query is useful when you have external data that you want to use in making predictions. For
example, you might have built a model that categorizes customers by their online activity and purchasing history.
You could apply that model to a list of newly acquired leads, to create projections for sales, or to identify targets
for proposed campaigns.
When you perform a prediction join, you must map the columns the model to the columns in the new data source.
Therefore, the data source that you choose for an input must data that is somewhat similar to the data in the
model. The new information does not have to match exactly, and can be incomplete. For example, suppose the
model was trained using information about income and age, but the customer list you are using for predictions
has age but nothing about income. In this scenario, you could still map the new data to the model and create a
prediction for each customer. However, if income was an important predictor for the model, the lack of complete
information would affect the quality of predictions.
To get the best results, you should join as many of the matching columns as possible between the new data and
the model. However, the query will succeed even if there are no matches. If no columns are joined, the query will
return the marginal prediction, which is equivalent to the statement SELECT <predictable-column> FROM <model>
without a PREDICTION JOIN clause.
After you have successfully mapped all relevant columns, you run the query, and Analysis Services makes
predictions for each row in the new data based on patterns in the model. You can save the results back to a new
table in the data source view that contains the external data, or you can copy and paste the data is you are using
SQL Server Data Tools (SSDT) or SQL Server Management Studio.
WARNING
If you use the designer in SQL Server Data Tools (SSDT), the external data source must first be defined as a data source view.
If you use DMX to create a prediction join, you can specify the external data source by using the OPENQUERY,
OPENROWSET, or SHAPE commands. The default data access method in the DMX templates is OPENQUERY.
For information about these methods, see <source data query>.
Predictions in Time Series Mining Models
Time series models are different from other models types; you can either use the model as it is to create
predictions, or you can provide new data to the model to update the model and create predictions based on recent
trends. If you add new data, you can specify the way the new data should be used.
Extending the model cases means that you add the new data onto the existing series of data in the time
series model. Henceforth, predictions are based on the new, combined series. This option is good when you
want to simply add a few data points to an existing model.
For example, suppose that you have an existing time series model that has been trained on the sales data
from the previous year. After you have collected several months of new sales data, you decide to update
your sales forecasts for the current year. You can create a prediction join that updates the model by adding
new data and extends the model to make new predictions.
Replacing the model cases means that you keep the trained model, but replace the underlying cases with a
new set of case data. This option is useful when you want to keep the trend in the model, but apply it to a
different set of data.
For example, your original model might have been trained on a set of data with very high sales volumes;
when you replace the underlying data with a new series (perhaps from a store with lower sales volume),
you preserve the trend, but the predictions begin from the values in the replacement series.
Regardless of which approach you use, the starting point for predictions is always the end of the original series.
For more information about how to create prediction joins on time series models, see Time Series Model Query
Examples or PredictTimeSeries (DMX).
SELECT
PredictTimeSeries([Forecasting].[Amount]) as [PredictedAmount]
, PredictTimeSeries([Forecasting].[Quantity]) as [PredictedQty]
FROM
[Forecasting]
The results of this query are two columns, one for each predicted series, where each row contains a nested table
with the predicted values:
PredictedAmount
$TIME AMOUNT
201101 172067.11
$TIME AMOUNT
201102 363390.68
PredictedQty
$TIME QUANTITY
201101 77
$TIME QUANTITY
201102 260
If your provider cannot handle hierarchical rowsets, you can flatten the results by using the FLATTEN keyword in
the prediction query. For more information, including examples of flattened rowsets, see SELECT (DMX).
See Also
Content Queries (Data Mining)
Data Definition Queries (Data Mining)
Content Queries (Data Mining)
11/28/2018 • 7 minutes to read • Edit Online
WARNING
This cache cannot be cleared or deleted if you need to separate data into training and testing sets. If the cache is cleared,
you cannot query the case data.
The following examples show the common patterns for creating queries on the case data, or queries on the data
in the mining structure:
Get all the cases for a model
SELECT FROM <model>.CASES
Use this statement to retrieve specified columns from the case data used to build a model. You must have
drillthrough permissions on the model to run this query.
View all the data that is included in the structure
SELECT FROM <structure>.CASES
Use this statement to view all the data that is included in the structure, including columns that are not included in
a particular mining model. You must have drillthrough permissions on the model, as well as on the structure, to
retrieve data from the mining structure.
Get range of values
SELECT DISTINCT RangeMin(<column>), RangeMax(<column>) FROM <model>
Use this statement to find the minimum value, maximum value, and mean of a continuous column, or of the
buckets of a DISCRETIZED column.
Get distinct values
SELECT DISTINCT <column>FROM <model>
Use this statement to retrieve all the values of a DISCRETE column. Do not use this statement for DISCRETIZED
columns; use the RangeMin and RangeMax functions instead.
Find the cases that were used to train a model or structure
SELECT FROM <mining structure.CASES WHERE IsTrainingCase()
Use this statement to get the complete set of data that was used in a training a model.
Find the cases that are used for testing a model or structure
SELECT FROM <mining structure.CASES WHERE IsTestingCase()
Use this statement to get the data that has been set aside for testing mining models related to a specific structure.
Drillthrough from a specific model pattern to underlying case data
SELECT FROM <model>.CASESWHERE IsTrainingCase() AND IsInNode(<node>)
Use this statement to retrieve detailed case data from a trained model. You must specify a specific node: for
example, you must know the node ID of the cluster, the specific branch of the decision tree, etc. Moreover, you
must have drillthrough permissions on the model to run this query.
Queries on Model Patterns, Statistics, and Attributes
The content of a data mining model is useful for many purposes. With a model content query, you can:
Extract formulas or probabilities for making your own calculations.
For an association model, retrieve the rules that are used to generate a prediction.
Retrieve the descriptions of specific rules so that you can use the rules in a custom application.
View the moving averages detected by a time series model.
Obtain the regression formula for some segment of the trend line.
Retrieve actionable information about customers identified as being part of a specific cluster.
The following examples show some of the common patterns for creating queries on the model content:
Get patterns from the model
SELECT FROM <model>.CONTENT
Use this statement to retrieve detailed information about specific nodes in the model. Depending on the
algorithm type, the node can contain rules and formulas, support and variance statistics, and so forth.
Retrieve attributes used in a trained model
CALL System.GetModelAttributes(<model>)
Use this stored procedure to retrieve the list of attributes that were used by a model. This information is useful
for determining attributes that were eliminated as a result of feature selection, for example.
Retrieve content stored in a data mining dimension
SELECT FROM <model>.DIMENSIONCONTENT
Use this statement to retrieve the data from a data mining dimension.
This query type is principally for internal use. However, not all algorithms support this functionality. Support is
indicated by a flag in the MINING_SERVICES schema rowset.
If you develop your own plug-in algorithm, you might use this statement to verify the content of your model for
testing.
Get the PMML representation of a model
SELECT * FROM <model>.PMML
Gets an XML document that represents the model in PMML format. Not all model types are supported.
Examples
Although some model content is standard across algorithms, some parts of the content vary greatly depending
on the algorithm that you used to build the model. Therefore, when you create a content query, you must
understand what information in the model is most useful to your specific model.
A few examples are provided in this section to illustrate how the choice of algorithm affects the kind of
information that is stored in the model. For more information about mining model content, and the content that
is specific to each model type, see Mining Model Content (Analysis Services - Data Mining).
Example 1: Content Query on an Association Model
The statement, SELECT FROM <model>.CONTENT , returns different kinds of information, depending on the type of
model you are querying. For an association model, a key piece of information is the node type. Nodes are like
containers for information in the model content. In an association model, nodes that represent rules have a
NODE_TYPE value of 8, whereas nodes that represent itemsets have a NODE_TYPE value of 7.
Thus, the following query returns the top 10 itemsets, ranked by support (the default ordering).
The following query builds on this information. The query returns three columns: the ID of the node, the
complete rule, and the product on the right-hand side of the itemset-that is, the product that is predicted to be
associated with some other products as part of an itemset.
The FLATTENED keyword indicates that the nested rowset should be converted into a flattened table. The
attribute that represents the product on the right-hand side of the rule is contained in the
NODE_DISTRIBUTION table; therefore, we retrieve only the row that contains an attribute name, by adding a
requirement that the length be greater than 2.
A simple string function is used to remove the name of the model from the third column. (Usually the model
name is prefixed to the values of nested columns.)
The WHERE clause specifies that the value of NODE_TYPE should be 8, to retrieve only rules.
For more examples, see Association Model Query Examples.
Example 2: Content Query on a Decision Trees Model
A decision tree model can be used for prediction as well as for classification. This example assumes that you are
using the model to predict an outcome, but you also want to find out which factors or rules can be used to classify
the outcome.
In a decision tree model, nodes are used to represent both trees and leaf nodes. The caption for each node
contains the description of the path to the outcome. Therefore, to trace the path for any particular outcome, you
need to identify the node that contains it, and get the details for that node.
In your prediction query, you add the prediction function PredictNodeId (DMX), to get the ID of the related node,
as shown in the following example:
Once you have the ID of the node that contains the outcome, you can retrieve the rule or path that explains the
prediction by creating a content query that includes the NODE_CAPTION, as follows:
SELECT NODE_CAPTION
FROM [<decision tree model name>]
WHERE NODE_UNIQUE_NAME= '<node id>'
See Also
Understanding the DMX Select Statement
Data Mining Queries
Drillthrough Queries (Data Mining)
11/28/2018 • 5 minutes to read • Edit Online
NOTE
If you enable drillthrough on both the mining structure and the mining model, any user who is a member of a role that
has drillthrough permissions on the mining model can also view columns in the mining structure, even if those columns
are not included in the mining model. Therefore, to protect sensitive data, you should set up the data source view to mask
personal information, and allow drillthrough access on the mining structure only when necessary.
Limitations on Drillthrough
The following limitations apply to drillthrough operations on a model, depending on the algorithm that was
used to create the model:
Microsoft Naïve Bayes algorithm Not supported. These algorithms do not assign cases to
specific nodes in the content.
Microsoft Neural Network algorithm Not supported. These algorithms do not assign cases to
specific nodes in the content.
Microsoft Logistic Regression algorithm Not supported. These algorithms do not assign cases to
specific nodes in the content.
Microsoft Linear Regression algorithm Supported. However, because the model creates a single
node, All, drilling through returns all the training cases for
the model. If the training set is large, loading the results may
take a very long time.
ALGORITHM NAME ISSUE
Microsoft Time Series algorithm Supported. However, you cannot drill through to structure or
case data by using the Mining Model Viewer in Data
Mining Designer. You must create a DMX query instead.
You can also return the dates from the cases in the model, by
using the Lag (DMX) function.
Related Tasks
Use the following links to work with drillthrough in specific scenarios.
TASK LINK
Procedure describing use of drillthrough in the Data Mining Drill Through to Case Data from a Mining Model
Designer
To alter an existing mining model to allow drillthrough Enable Drillthrough for a Mining Model
Enabling drillthrough on a mining structure by using the CREATE MINING STRUCTURE (DMX)
DMX WITH DRILLTHROUGH clause
For information about assigning permissions that apply to Grant permissions on data mining structures and models
drillthrough on mining structures and mining models (Analysis Services)
See Also
Data Mining Model Viewers
Data Mining Queries
Drill Through to Case Data from a Mining Model
5/16/2018 • 2 minutes to read • Edit Online
NOTE
You can add the ability to drillthrough on an existing mining model by setting the property AllowDrillthrough to True.
However, after you enable drillthrough, the model must be reprocessed before you can see the case data. For more
information, see Enable Drillthrough for a Mining Model.
Depending on the type of viewer you are using, you can select the node for drillthrough in the following ways:
Microsoft Association Viewer Rules tab Click a row that contains a set of rules.
Microsoft Association Viewer Itemsets tab Click a row that contains an itemset.
Microsoft Sequence Clustering Rules tab Click a row that contains a set of rules.
Viewer
Microsoft Sequence Clustering Itemsets tab Click a row that contains an itemset.
Viewer
NOTE
Some models cannot use drillthrough. The ability to use drillthrough depends on the algorithm that was used to create the
model. For a list of the mining model types that support drillthrough, see Drillthrough Queries (Data Mining).
See Also
Drillthrough Queries (Data Mining)
Create Drillthrough Queries using DMX
5/16/2018 • 2 minutes to read • Edit Online
WARNING
To view the data, drillthrough must have been enabled, and you must have the necessary permissions.
For additional information about using DMX queries to return case data, see SELECT FROM <model>.CASES
(DMX) and SELECT FROM <structure>.CASES.
Examples
The following DMX query returns the case data for a specific product series, from a time series model. The query
also returns the column Amount, which was not used in the model but is available in the mining structure.
Note that in this example, an alias has been used to rename the structure column. If you do not assign an alias to
the structure column, the column is returned with the name 'Expression'. This is the default behavior for all
unnamed columns.
See Also
Drillthrough Queries (Data Mining)
Drillthrough on Mining Structures
Data Definition Queries (Data Mining)
10/26/2018 • 4 minutes to read • Edit Online
WARNING
If your model is based on data from a cube data srouce, you cannot use DMX to export the model, and should use backup
and restore instead.
Related Tasks
The following table provides links to tasks that are related to data definition queries.
Work with templates for DMX queries. Use Analysis Services Templates in SQL Server Management
Studio
Design queries of all kinds, using Prediction Query Builder. Create a Prediction Query Using the Prediction Query Builder
Capture query definitions by using SQL Server Profiler, and Use SQL Server Profiler to Monitor Analysis Services
use traces to monitor Analysis Services.
Learn more about the scripting languages and programming XML for Analysis (XMLA) Reference
languages provided for Analysis Services.
Developing with Analysis Management Objects (AMO)
Learn how to manage models in SQL Server Management Export and Import Data Mining Objects
Studio and SQL Server Data Tools (SSDT).
EXPORT (DMX)
IMPORT (DMX)
Learn more about OPENROWSET and other ways to query <source data query>.
external data.
See Also
Data Mining Wizard (Analysis Services - Data Mining)
Data Mining Schema Rowsets (SSAs)
10/26/2018 • 2 minutes to read • Edit Online
NOTE
You can also query the data mining schema rowsets by using XMLA. For more information about how to do this in SQL
Server Management Studio, see Create a Data Mining Query by Using XMLA.
DMSCHEMA_MINING_COLUMNS Lists all columns used in mining models in the current context.
DMSCHEMA_MINING_SERVICE_PARAMETERS Lists all parameters for the mining services that are available
on the current instance.
DMSCHEMA_MODEL_CONTENT Returns the content of the model if the model has been
processed.
NOTE
The list in the table is not comprehensive; it shows only those rowsets that may be of most interest for troubleshooting.
Examples
The following section provides some examples of queries against the data mining schema rowsets.
Example 1: List Data Mining Services
The following query returns a list of the mining services that are available on the current server, meaning the
algorithms that are enabled. The columns provided for each mining service include the modeling flags and content
types that can be used by each algorithm, the GUID for each service, and any prediction limits that may have been
added for each service.
SELECT *
FROM $system.DMSCHEMA_MINING_SERVICES
SELECT MINING_PARAMETERS
FROM $system.DMSCHEMA_MINING_MODELS
WHERE MODEL_NAME = 'TM Clustering'
SELECT *
FROM $system.DBSCHEMA_TABLES
Data Mining Query Tools
10/26/2018 • 4 minutes to read • Edit Online
Query Editor
The Query Editor in SQL Server Management Studio also lets you build and run DMX queries. You can connect
to an instance of Analysis Services, and then select a database, mining structure columns, and a mining model.
The Metadata Explorer contains a list of prediction functions that you can browse.
DMX Templates
SQL Server Management Studio provides interactive DMX query templates that you can use to build DMX
queries. If you do not see the list of templates, click View on the toolbar, and select Template Explorer. To see all
Analysis Services templates, including templates for DMX, MDX, and XMLA, click the cube icon.
To build a query using a template, you can drag the template into an open query window, or you can double-click
the template to open a new connection and a new query pane.
For an example of how to create a prediction query from a template, see Create a Singleton Prediction Query
from a Template.
WARNING
The Data Mining Add-in for Microsoft Office Excel also contains a number of templates, along with an interactive query
builder which can help you compose complex DMX statements. To use the templates, click Query, and click Advanced in
the Data Mining Client.
COMPONENT DESCRIPTION
Data Mining Query task Executes DMX queries and other DMX statements as part of
a control flow.
Data Mining Query transformation Executes a prediction query within a data flow, using data
supplied by a data flow source.
See Also
Data Mining Extensions (DMX) Reference
Data Mining Solutions
Understanding the DMX Select Statement
Structure and Usage of DMX Prediction Queries
Create a Prediction Query Using the Prediction Query Builder
Create a DMX Query in SQL Server Management Studio
Data Mining Query Tasks and How-tos
5/16/2018 • 2 minutes to read • Edit Online
See Also
Create a Singleton Query in the Data Mining Designer
Data Mining Queries
Create a DMX Query in SQL Server Management
Studio
5/16/2018 • 2 minutes to read • Edit Online
See Also
Data Mining Query Tools
Data Mining Extensions (DMX) Reference
Create a Singleton Query in the Data Mining
Designer
5/16/2018 • 2 minutes to read • Edit Online
See Also
Prediction Queries (Data Mining)
Apply Prediction Functions to a Model
11/28/2018 • 5 minutes to read • Edit Online
2. Click the Source column, and choose a value from the list:
<model name> Select this option to include values from the mining model
in the output. You can only add predictable columns.
The columns that you add with this option are included in
the SELECT portion of the resulting DMX statement.
Custom Expression Select this option to type a custom expression and then
assign an alias to the output.
3. After adding each function or expression, switch to DMX view to see how the function is added within the
DMX statement.
WARNING
The Prediction Query Builder does not validate the DMX until you click Results. Often, you will find that the
expression that is produced by the query builder is not valid DMX. Typical causes are referencing a column that is not
related to the predictable column, or trying to predict a column in a nested table, which requires a sub-SELECT
statement. At this point, you can switch to DMX view and continue editing the statement.
EXCEL!CEILING(PredictSupport([TM_Clustering].[Bike Buyer]),2)
If you want to add other clauses elsewhere in the statement-for example, if you want to add a WHERE clause-you
cannot add it by using the grid; you must switch to DMX view first.
See Also
Data Mining Queries
Choose and Map Input Data for a Prediction Query
5/16/2018 • 5 minutes to read • Edit Online
WARNING
You cannot add new columns or map columns that are in a different data source view. The data source view that you select
must contain all the columns that you need for the prediction query.
After you have identified the tables that contain the data you will use for predictions, you must map the columns
in the external data to the columns in the mining model. For example, if your model predicts customer purchasing
behavior based on demographics and survey responses, your input data should contains information that
generally corresponds to what is in the model. You do not need to have matching data for every single column,
but the more columns you can match, the better. If you try to map columns that have different data types, you
might get an error. In that case, you could define a named calculation in the data source view to cast or convert the
new column data to the data type required by the model. For more information, see Define Named Calculations in
a Data Source View (Analysis Services).
When you choose the data to use for prediction, some columns in the selected data source might be automatically
mapped to the mining model columns, based on name similarity and matching data type. You can use the Modify
Mapping dialog box in the Mining Model Prediction to change the columns that are mapped, delete
inappropriate mappings, or create new mappings for existing columns. The Mining Model Prediction design
surface also supports drag-and-drop editing of connections.
To create a new connection, just select a column in the Mining Model table and drag it to the
corresponding column in the SelectInput Table(s) table.
To remove a connection, select the connection line and press the DELETE key.
The following procedure describes how you can modify the joins that have been created between the case table
and a nested table used as inputs to a prediction query, using the Specify Nested Join dialog box.
Select an input table
1. On the Select Input Table(s) table of the Mining Accuracy Chart tab in Data Mining Designer in SQL
Server Data Tools (SSDT), click Select Case Table.
The Select Table dialog box opens, in which you can select the table that contains the data on which to
base your queries.
2. In the Select Table dialog box, select a data source from the Data Source list.
3. Under Table/View Name, select the table that contains the data you want to use to test the models.
4. Click OK.
The columns in the mining structure are automatically mapped to the columns that have the same name in
the input table.
Change the way that input data is mapped to the model
1. In Data Mining Designer in SQL Server Data Tools (SSDT), select the Mining Model Prediction tab.
2. On the Mining Model menu, select Modify Connections.
The Modify Mapping dialog box opens. In this dialog box, the column Mining Model Column lists the
columns in the selected mining structure. The column Table Column lists the columns in the external data
source that you chose in the SelectInput Table(s) dialog box. The columns in the external data source are
mapped to columns in the mining model.
3. Under Table Column, select the row that corresponds to the mining model column that you want to map
to.
4. Select a new column from the list of available columns in the external data source. Select the blank item in
the list to delete the column mapping.
5. Click OK.
The new column mappings are displayed in the designer.
Remove a relationship between input tables
1. On the Select Input Table(s) table of the Mining Model Prediction tab in Data Mining Designer in SQL
Server Data Tools (SSDT), click Modify Join.
The Specify Nested Join dialog box opens.
2. Select a relationship.
3. Click Remove Relationship.
4. Click OK.
The relationship between the case table and the nested table has been removed.
Create a new relationship between input tables
1. On the Select Input Table(s) table of the Mining Model Prediction tab in Data Mining Designer, click
Modify Join.
The Specify Nested Join dialog box opens.
2. Click Add Relationship.
The Create Relationship dialog box opens.
3. Select the key of the nested table in Source Columns.
4. Select the key of the case table in Destination Columns.
5. Click OK in the Create Relationship dialog box.
6. Click OK in the Specify Nested Join dialog box.
A new relationship has been created between the case table and the nested table.
Add a nested table to the input tables of a prediction query
1. On the Mining Model Prediction tab in Data Mining Designer, click Select Case Table to open the
Select Table dialog box.
NOTE
You cannot add a nested table to the inputs unless you have specified a case table. Use of a nested table requires
that the mining model you are using for prediction also uses a nested table.
2. In the Select Table dialog box, select a data source from the Data Source list, and select the table in the
data source view that contains the case data. Click OK.
3. Click Select Nested Table to open the Select Table dialog box.
4. In the Select Table dialog box, select a data source from the Data Source list, and select the table in the
data source view that contains the nested data. Click OK.
If a relationship already exists, the columns in the mining model are automatically mapped to the columns
that have the same name in the input table. You can modify the relationship between the nested table and
the case table by clicking Modify Join, which opens the Create Relationship dialog box.
See Also
Prediction Queries (Data Mining)
Manually Edit a Prediction Query
5/16/2018 • 2 minutes to read • Edit Online
NOTE
If you switch back to Design view from Query Text view, any changes that you made in Query Text view will be lost.
Modify a query
1. On the Mining Model Prediction tab in Data Mining Designer in SQL Server Data Tools (SSDT), click
SQL.
The grid at the bottom of the screen is replaced by a text editor that contains the query. You can type
changes to the query in this editor.
2. To run the query, on the Mining Model menu, select Result, or click the button to switch to query results.
NOTE
If the query that you have created is invalid, the Results window does not display an error and does not display any
results. Click the Design button, or select Design or Query from the Mining Model menu to correct the problem
and run the query again.
See Also
Data Mining Queries
Prediction Query Builder (Data Mining)
Lesson 6: Creating and Working with Predictions (Basic Data Mining Tutorial)
View and Save the Results of a Prediction Query
5/16/2018 • 2 minutes to read • Edit Online
WARNING
If the destination does not support hierarchical rowsets, you can add the FALTTENED keyword to the results to save
as a flat table.
Create a Content Query on a Mining Model
10/26/2018 • 2 minutes to read • Edit Online
FROM $system.DMSCHEMA_MINING_MODEL_CONTENT
4. Click Execute.
The Results pane displays the contents of the model.
NOTE
To view a list of all the schema rowsets that you can query on the current instance, use this query:
SELECT * FROM $system. DISCOVER_SCHEMA_ROWSETS. Or, for a list of schema rowsets specific to data mining,
see Data Mining Schema Rowsets.
See Also
Mining Model Content (Analysis Services - Data Mining)
Data Mining Schema Rowsets
Query the Parameters Used to Create a Mining
Model
5/16/2018 • 2 minutes to read • Edit Online
NOTE
You can also create a query against a data mining model by using the MDX template.
3. If the instance contains multiple databases, select the database that contains the model you want to query
from the Available Databases list in the toolbar.
To return model parameters for an existing mining model
1. In the DMX query pane, type or paste the following text:
SELECT MINING_PARAMETERS
FROM $system.DMSCHEMA_MINING_MODELS
WHERE MODEL_NAME = ''
2. In Object Explorer, select the mining model you want, and then drag it into the DMX Query pane, between
the single quotation marks.
3. Press F5, or click Execute.
Example
The following code returns a list of the parameters that were used to create the mining model that you build in the
Basic Data Mining Tutorial. These parameters include the explicit values for any defaults used by the mining
services available from providers on the server.
SELECT MINING_PARAMETERS
FROM $system.DMSCHEMA_MINING_MODELS
WHERE MODEL_NAME = 'TM Clustering'
The code example returns the following parameters for the clustering model:
eExample Results:
MINING_PARAMETERS
CLUSTER_COUNT=10,CLUSTER_SEED=0,CLUSTERING_METHOD=1,MAXIMUM_INPUT_ATTRIBUTES=255,
MAXIMUM_STATES=100,MINIMUM_SUPPORT=1,MODELLING_CARDINALITY=10,SAMPLE_SIZE=50000,S
TOPPING_TOLERANCE=10
See Also
Data Mining Query Tasks and How -tos
Data Mining Queries
Create a Singleton Prediction Query from a
Template
11/27/2018 • 3 minutes to read • Edit Online
The procedure that follows describes how to use the Template Explorer in SQL Server Management Studio to
quickly create this query.
To open the Analysis Services templates in SQL Server Management Studio
1. In SQL Server Management Studio, on the View menu, click Template Explorer.
2. Click the cube icon to open the Analysis Servertemplates.
To open a prediction query template
1. In Template Explorer, in the list of Analysis Server templates, expand DMX, and thenexpand Prediction
Queries.
2. Double-click Singleton Prediction.
3. In the Connect to Analysis Services dialog box, type the name of the server that has the instance of
Analysis Services that contains the mining model to be queried.
4. Click Connect.
5. The template opens in the specified database, together with a mining model Object Browser that contains
data mining functions and a list of data mining structures and related models.
To customize the singleton query template
1. In the template, click the Available Databases drop-down list, and then select an instance of Analysis
Service from the list.
2. In the Mining Model list, select the mining model that you want to query.
The list of columns in the mining model appears in the Metadata pane of the object browser.
3. On the Query menu, select Specify Values for Template Parameters.
4. In the select list row, type * to return all columns, or type a comma-delimited list of columns and
expressions to return specific columns.
If you type *, the predictable column is returned, together with any columns for which you provide new
values for in step 6.
For the sample code shown at the start of this topic, the select list row was set to *.
5. In the mining model row, type the name of the mining model from among the list of mining models that
appear in Object Explorer.
For the sample code shown at the start of this topic, the mining model row was set to the name,
TM_Decision_Tree.
6. In the value row, type the new data value for which you want to make a prediction.
For the sample code shown at the start of this topic, the value row was set to 2 to predict bike buying
behavior based on the number of children at home.
7. In the column row, type the name of the column in the mining model to which the new data should be
mapped.
For the sample code shown at the start of this topic, the column row was set to Number Children at
Home.
NOTE
When you use the Specify Values for Template Parameters dialog box, you do not have to add square brackets
around the column name. The brackets will automatically be added for you.
See Also
Creating Predictions (Basic Data Mining Tutorial)
Create a Data Mining Query by Using XMLA
10/26/2018 • 2 minutes to read • Edit Online
<RestrictionList>
<SchemaName>DMSCHEMA_MINING_MODEL_CONTENT</SchemaName>
</RestrictionList>
</Restrictions>
4. Click Execute.
The Results pane shows a list of column names for the specified schema rowset.
To create a content query using the MINING MODEL CONTENT schema rowset
1. In the Discover Schema Rowsets template, change the request type by replacing the text inside the
request type tags.
Replace this line:
<RequestType>DISCOVER_SCHEMA_ROWSETS</RequestType>
<RestrictionList>
</RestrictionList>
</Restrictions>
5. Click Execute.
The Results pane displays the schema definition, together with the values for the specified model.
See Also
Mining Model Content (Analysis Services - Data Mining)
Data Mining Schema Rowsets
Change the Time-out Value for Data Mining Queries
5/16/2018 • 2 minutes to read • Edit Online
See Also
Data Mining Query Tasks and How -tos
Data Mining Queries
Data Mining Solutions
11/28/2018 • 3 minutes to read • Edit Online
In This Section
Data Mining Projects
Processing Data Mining Objects
Related Projects for Data Mining Solutions
Deployment of Data Mining Solutions
TASKS TOPICS
Test the models you create, validate the quality of your Testing and Validation (Data Mining)
training data, and create charts that represent the accuracy
of data mining models.
Train the model by populating the structure and related Processing Data Mining Objects
models with data. Update and extend models with new data.
Customize a mining model by applying filters to the training Customize Mining Models and Structure
data, choosing a different algorithm, or setting advanced
algorithm parameters.
Customize a mining model by applying filters to the data Add Mining Models to a Structure (Analysis Services - Data
used in training the mode. Mining)
See Also
Data Mining Tutorials (Analysis Services)
Data Mining Projects
11/28/2018 • 14 minutes to read • Edit Online
WARNING
To successfully build and deploy your project, you must have access to an instance of Analysis Services that is running in
OLAP/Data Mining mode. You cannot develop or deploy data mining solutions on an instance of Analysis Services that
supports tabular models, nor can you use data directly from a Power Pivot workbook or from a tabular model that uses the
in-memory data store. To determine whether the instance of Analysis Services that you have can support data mining, see
Determine the Server Mode of an Analysis Services Instance.
Within each data mining project that you create, you will follow these steps:
1. Choose a data source, such as a cube, database, or even Excel or text files, which contains the raw data you
will use for building models.
2. Define a subset of the data in the data source to use for analysis, and save it as a data source view.
3. Define a mining structure to support modeling.
4. Add mining models to the mining structure, by choosing an algorithm and specifying how the algorithm will
handle the data.
5. Train models by populating them with the selected data, or a filtered subset of the data.
6. Explore, test, and rebuild models.
When the project is complete, you can deploy it for users to browse or query, or provide programmatic access to
the mining models in an application, to support predictions and analysis.
WARNING
If you want to filter the data, you can do so in the data source view, but you can also create filters on the data at the level of
the mining model. Because the filter definition is stored with the mining model, using model filters makes it easier to
determine the data that was used for training the model. Moreover, you can create multiple related models, with different
filter criteria. For more information, see Filters for Mining Models (Analysis Services - Data Mining).
Note that the data source view that you create can contain additional data that is not directly used for analysis. For
example, you might add to your data source view data that is used for testing, predictions, or for drillthrough. For
more information about these uses, see Testing and Validation (Data Mining) and Drillthrough.
Mining Structures
Once you have created your data source and data source view, you must select the columns of data that are most
relevant to your business problem, by defining mining structures within the project. A mining structure tells the
project which columns of data from the data source view should actually be used in modeling, training, and testing.
To add a new mining structure, you start the Data Mining Wizard. The wizard automatically defines a mining
structure, walks you through the process of choosing the data, and optionally lets you add an initial mining model
to the structure. Within the mining structure, you choose tables and columns from the data source view or from an
OLAP cube, and define relationships among tables, if your data includes nested tables.
Your choice of data will look very different in the Data Mining Wizard, depending on whether you use relational or
online analytical processing (OLAP ) data sources.
When you choose data from a relational data source, setting up a mining structure is easy: you choose
columns from the data in the data source view, and set additional customizations such as aliases, or define
how values in the column should be grouped or binned. For more information, see Create a Relational
Mining Structure.
When you use data from an OLAP cube, the mining structure must be in the same database as the OLAP
solution. To create a mining structure, you select attributes from the dimensions and related measures in
your OLAP solution. Numeric values are typically found in measures, and categorical variables in
dimensions. For more information, see Create an OLAP Mining Structure.
You can also define mining structures by using DMX. For more information, see Data Mining Extensions
(DMX) Data Definition Statements.
After you have created the initial mining structure, you can copy, modify, and alias the structure columns.
Each mining structure can contain multiple mining models. Therefore, after you are done, you can open the mining
structure again, and use Data Mining Designer to add more mining models to the structure.
You also have the option to separate your data into a training data set, used for building models, and a holdout
data set to use in testing or validating your mining models.
WARNING
Some model types, such as time series models, do not support the creation of holdout data sets because they require a
continuous series of data for training. For more information, see Training and Testing Data Sets.
Mining Models
The mining model defines the algorithm, or the method of analysis that you will use on the data. To each mining
structure, you add one or more mining models.
Depending on your needs, you can combine many models in a single project, or create separate projects for each
type of model or analytical task.
After you have created a structure and model, you process each model by running the data from the data source
view through the algorithm, which generates a mathematical model of the data. This process is also known as
training the model. For more information, see Processing Requirements and Considerations (Data Mining).
After the model has been processed, you can then visually explore the mining model and create prediction queries
against it. If the data from the training process has been cached, you can use drillthrough queries to return detailed
information about the cases used in the model.
When you want to use a model for production (for example, for use in making predictions, or for exploration by
general users) you can deploy the model to a different server. If you need to reprocess the model in future, you
must also export the definition of the underlying mining structure (and, necessarily, the definition of the data
source and data source view ) at the same time.
When you deploy a model, you must also ensure that the correct processing options are set on the structure and
model, and that potential users have the permissions they need to perform queries, view models, or drillthrough to
structure o model data. For more information, see Security Overview (Data Mining).
Related Tasks
The following topics describe use of the Data Mining Wizard to create a data mining project and associated
objects.
TASKS TOPICS
Describes how to work with mining structure columns Create a Relational Mining Structure
Provides more information about how to add new mining Add Mining Models to a Structure (Analysis Services - Data
models, and process a structure and models Mining)
Provides links to resources that help you customize the Customize Mining Models and Structure
algorithms that build mining models
Provides links to information about each of the mining model Data Mining Model Viewers
viewers
Learn how to create a lift chart, profit chart, or classification Testing and Validation (Data Mining)
matrix, or test a mining structure
Learn about processing options and permissions Processing Data Mining Objects
See Also
Data Mining Designer
Creating Multidimensional Models Using SQL Server Data Tools (SSDT)
Workspace Database
Import a Data Mining Project using the Analysis
Services Import Wizard
11/28/2018 • 3 minutes to read • Edit Online
WARNING
You cannot specify the objects you want to import; when you choose an existing Analysis Services database, all
multidimensional and data mining objects are imported.
Click Next.
5. The page, Completing the Wizard, displays the progress of the import operation. You cannot cancel the
operation or change the objects that are being imported. Click Finish when done.
The new project is automatically opened using SQL Server Data Tools (SSDT).
See Also
Project Properties
Processing Data Mining Objects
5/16/2018 • 2 minutes to read • Edit Online
Processing Requirements
Processing requirements may differ depending on whether your mining models are based solely on relational
data, or on multidimensional data source.
For relational data source, processing requires only that you create training data and run mining algorithms on
that data. However, mining models that are based on OLAP objects, such as dimensions and measures, require
that the underlying data be in a processed state. This may requires that the multidimensional objects be processed
to populate the mining model.
For more information, see Processing Requirements and Considerations (Data Mining).
See Also
Drillthrough Queries (Data Mining)
Mining Structures (Analysis Services - Data Mining)
Mining Models (Analysis Services - Data Mining)
Logical Architecture (Analysis Services - Data Mining)
Related Projects for Data Mining Solutions
11/27/2018 • 9 minutes to read • Edit Online
Full-Text Search
Full-Text Search in SQL Server lets applications and users run full-text queries against character-based data in
SQL Server tables. When full-text search is enabled, you can perform searches against text data that are enhanced
by language-specific rules about the multiple forms of a word or phrase. You can also configure search conditions,
such as the distance between multiple terms, and use functions to constrain the results that are returned in order
of likelihood.
Because full-text queries are a feature provided by the SQL Server engine, you can create parameterized queries,
generate custom data sets or term vectors by using full-text search features on a text data source, and use these
sources in data mining.
For more information about how full-text queries interact with the full-text index, see Query with Full-Text Search.
An advantage of using the full-text search features of SQL Server is that you can leverage the linguistic
intelligence that is contained in the word breakers and stemmers shipped for all SQL Server languages. By using
the supplied word breakers and stemmers, you can ensure that words are separated using the characters
appropriate for each language, and that synonyms based on diacritics or orthographic variations (such as the
multiple number formats in Japanese) are not overlooked.
In addition to linguistic intelligence that governs word boundaries, the stemmers for each language can reduce
variants of a word to a single term, based on knowledge of the rules for conjugation and orthographic variation in
that language. The rules for linguistic analysis differ for each language and are developed based on extensive
research on real-life corpora.
For more information, see Configure and Manage Word Breakers and Stemmers for Search.
The version of a word that is stored after full-text indexing is a token in compressed form. Subsequent queries to
the full-text index generate multiple inflectional forms of a particular word based on the rules of that language, to
ensure that all probable matches are made. For example, although the token that is stored might be "run", the
query engine also looks for the terms "running", "ran", and "runner," because these are regularly derived
morphological variations of the root word "run".
You can also create and build a user thesaurus to store synonyms and enable better search results, or
categorization of terms. By developing a thesaurus tailored to your full-text data, you can effectively broaden the
scope of full-text queries on that data. For more information, see Configure and Manage Thesaurus Files for Full-
Text Search.
Requirements for using full-text search include the following:
The database administrator must create a full-text index on the table.
Only one full-text index is allowed per table.
Each column that you index must have a unique key.
Full-text indexing is supported only for columns with these data types: char, varchar, nchar, nvarchar, text,
ntext, image, xml, varbinary, and varbinary(max). If the column is varbinary, varbinary(max), image, or xml,
you must specify the file extension of the indexable document (.doc, .pdf, .xls, and so forth), in a separate
type column.
Semantic Indexing
Semantic search builds upon the existing full-text search features in SQL Server, but uses additional capabilities
and statistics to enable scenarios such as automatic keyword extraction and discovery of related documents. For
example, you might use semantic search to build a base taxonomy for an organization, or classify a corpus of
documents. Or, you could use the combination of extracted terms and document similarity scores in clustering or
decision tree models.
After you have enabled semantic search successfully, and indexed your data columns, you can use the functions
that are provided natively with semantic indexing to do the following:
Return single-word key phrases with their score.
Return documents that contain a specified key phrase.
Return similarity scores, and the terms that contribute to the score.
For more information, see Find Key Phrases in Documents with Semantic Search and Find Similar and Related
Documents with Semantic Search.
For more information about the database objects that support semantic indexing, see Enable Semantic Search on
Tables and Columns.
Requirements for using semantic search include the following:
Full-text search also be enabled.
Installation of the semantic search components also creates a special system database, which cannot be
renamed, altered, or replaced.
Documents that you index using the service must be stored in SQL Server, in any of the database objects
that are supported for full-text indexing, including tables and indexed views.
Not all of the full-text languages support semantic indexing. For a list of supported languages, see
sys.fulltext_semantic_languages (Transact-SQL ).
See Also
Multidimensional Model Solutions
Tabular Model Solutions
Deployment of Data Mining Solutions
5/16/2018 • 3 minutes to read • Edit Online
In This Section
Deploy a Data Mining Solution to Previous Versions of SQL Server
Export and Import Data Mining Objects
Related Resources
Moving Data Mining Objects
If your model is based on relational data only, exporting and importing objects using DMX is the easiest way to
move models.
Move an Analysis Services Database
When models use a cube as a data source, refer to this topic for more information about how to move models and
their supporting cube data.
Deploy Analysis Services Projects (SSDT)
Provides general information about deployment of Analysis Services projects, and describes the properties that
you can set as part of the project configuration.
See Also
Processing a multidimensional model (Analysis Services)
Data Mining Query Tools
Processing Requirements and Considerations (Data Mining)
Deploy a Data Mining Solution to Previous Versions
of SQL Server
5/16/2018 • 3 minutes to read • Edit Online
See Also
Analysis Services Backward Compatibility
Export and Import Data Mining Objects
5/16/2018 • 2 minutes to read • Edit Online
NOTE
You must be a database or server administrator to export or import objects from a Microsoft SQL Server Analysis Services
database.
See Also
Management of Data Mining Solutions and Objects
Data Mining Architecture
5/16/2018 • 2 minutes to read • Edit Online
In This Section
Logical Architecture (Analysis Services - Data Mining)
Physical Architecture (Analysis Services - Data Mining)
Data Mining Services and Data Sources
Management of Data Mining Solutions and Objects
Security Overview (Data Mining)
See Also
Multidimensional Model Programming
Data Mining Programming
Logical Architecture (Analysis Services - Data Mining)
10/26/2018 • 5 minutes to read • Edit Online
Mining Structures
A data mining structure is a logical data container that defines the data domain from which mining models are
built. A single mining structure can support multiple mining models.
When you need to use the data in the data mining solution, Analysis Services reads the data from the source and
generates a cache of aggregates and other information. By default this cache is persisted so that training data can
be reused to support additional models. If you need to delete the cache, change the CacheMode property on the
mining structure object to the value, ClearAfterProcessing. For more information, see AMO Data Mining
Classes.
Analysis Services also provides the ability to separate your data into training and testing data sets, so that you can
test your mining models on a representative, randomly selected set of data. The data is not actually stored
separately; rather, case data in the structure cache is marked with a property that indicates whether that particular
case is used for training or for testing. If the cache is deleted, that information cannot be retrieved.
For more information, see Mining Structures (Analysis Services - Data Mining).
A data mining structure can contain nested tables. A nested table provides additional detail about the case that is
modeled in the primary data table. For more information, see Nested Tables (Analysis Services - Data Mining)
Mining Models
Before processing, a data mining model is only a combination of metadata properties. These properties specify a
mining structure, specify a data mining algorithm, and a define collection of parameter and filter settings that
affect how the data is processed. For more information, see Mining Models (Analysis Services - Data Mining).
When you process the model, the training data that was stored in the mining structure cache is used to generate
patterns, based both on statistical properties of the data and on heuristics defined by the algorithm and its
parameters. This is known as training the model.
The result of training is a set of summary data, contained within the model content, which describes the patterns
that were found and provides rules by which to generate predictions. For more information, see Mining Model
Content (Analysis Services - Data Mining).
In limited cases, the logical structure of the model can also be exported into a file that represents model formulas
and data bindings according to a standard format, the Predictive Modeling Markup Language (PMML ). This
logical structure can be imported into other systems that utilize PMML and the model so described can then be
used for prediction. For more information, see Understanding the DMX Select Statement.
See Also
Processing a multidimensional model (Analysis Services)
Data Mining Extensions (DMX) Reference
Physical Architecture (Analysis Services - Data
Mining)
5/16/2018 • 2 minutes to read • Edit Online
Architectural Diagram
An Analysis Services instance runs as a stand-alone service and communication with the service occurs through
XML for Analysis (XMLA), by using either HTTP or TCP.
AMO is a layer between the user application and the Analysis Services instance that provides access to Analysis
Services administrative objects. AMO is a class library that takes commands from a client application and converts
those commands into XMLA messages for the Analysis Services instance. AMO presents Analysis Services
instance objects as classes to the end user application, with method members that run commands and property
members that hold the data for the Analysis Services objects.
The following illustration shows the Analysis Services components architecture, including services within the
Analysis Services instance and user components that interact with the instance.
The illustration shows that the only way to access the instance is by using the XML for Analysis (XMLA) Listener,
either by using HTTP or TCP.
WARNING
DSO has been deprecated. You should not use DSO to develop solutions.
Server Configuration
One server instance can support multiple Analysis Services databases, each with its own instance of the Analysis
Services service that responds to client requests and processes objects.
Separate instances must be installed if you want to work with both tabular models and data mining and/or
multidimensional models. Analysis Services supports side-by-side installation of instances running in tabular
mode (which uses the xVelocity in-memory analytics engine (VertiPaq) storage engine) and instances running in
one of the conventional OLAP, MOLAP, or ROLAP configurations. For more information, see Determine the
Server Mode of an Analysis Services Instance.
All communications between a client and the Analysis Services server use XMLA, which is a platform-independent
and language-independent protocol. When a request is received from a client, Analysis Services determines
whether the request relates to OLAP or data mining, and routes the request appropriately. For more information,
see OLAP Engine Server Components.
See Also
Logical Architecture (Analysis Services - Data Mining)
Data Mining Services and Data Sources
10/26/2018 • 7 minutes to read • Edit Online
PORT DESCRIPTION
Dynamically assigned at server startup Named instance of SQL Server Analysis Services.
For more information about controlling the ports used by this service, see Configure the Windows Firewall to
Allow Analysis Services Access.
Connecting to Data Sources
Whenever you create or update a data mining structure or model, you use data that is defined by a data source.
The data source does not contain the data, which might include Excel workbooks, text files, and SQL Server
databases; it only defines the connection information. A data source view (DSV ) serves as an abstraction layer on
top of that source, modifying or mapping the data that is obtained from the source.
It is beyond the scope of this topic to describe the connection requirements for each of these sources. For more
information, see the documentation for the provider. However, in general, you should be aware of the following
requirements of Analysis Services, when interacting with providers:
Because data mining is a service provided by a server, the Analysis Services instance must be given access
to the data source. There are two aspects to access: location and identity.
Location means that, if you build a model using data that is stored only on your computer and then deploy
the model to a server, the model would fail to process because the data source cannot be found. To resolve
this problem, you might need to transfer data into the same SQL Server instance where Analysis Services is
running, or move files to a shared location.
Identity means that the services on Analysis Services must be able to open the data file or data source with
the appropriate credentials. For example, when you built the model, you might have had unlimited
permissions to view the data, but the user who is processing and updating the models on the server might
have limited or no access to the data, which can cause failure to process or affect the contents of a model. At
minimum, the account used for connecting to the remote data source must have read permissions to the
data.
When you move a model, the same requirements apply: you must set up appropriate access to the location
of the old data source, copy the data sources, or configure a new data source. Also, you must transfer logins
and roles, or set up permissions to allow data mining objects to be processed and updated in the new
location.
IMPORTANT
To improve security, we recommend that you set this property to false. The default value is false. However, even if
this property is set to false, users can continue to create singleton queries, and can use OPENQUERY on permitted
data sources.
AllowedProvidersInOpenRowset Specifies the provider, if ad hoc access is enabled. You can specify
multiple providers, by entering a comma-separated list of ProgIDs.
MaxConcurrentPredictionQueries Controls the load on the server caused by predictions. The default
value of 0 allows unlimited queries for SQL Server Enterprise, and a maximum of five concurrent queries
for SQL Server Standard. Queries above the limit are serialized and may time out.
The server provides additional properties that control which data mining algorithms are available, including any
restrictions on the algorithms, and the defaults for all data mining services. However, there are no settings that
allow you to control access to data mining stored procedures specifically. For more information, see Data Mining
Properties.
You can also set properties that let you tune the server and control security for client usage. For more information,
see Feature Properties.
NOTE
For more information about Support for plug-in algorithms by the editions of SQL Server, see Features Supported by the
Editions of SQL Server 2012 (http://go.microsoft.com/fwlink/?linkid=232473).
NOTE
Stored procedures cannot be used to change security on data server objects. When you execute a stored procedure, the
user's current context is used to determine access to all server objects. Therefore, users must have appropriate permissions
on any database objects that they access.
See Also
Physical Architecture (Analysis Services - Multidimensional Data)
Physical Architecture (Analysis Services - Data Mining)
Management of Data Mining Solutions and Objects
Management of Data Mining Solutions and Objects
10/26/2018 • 4 minutes to read • Edit Online
In this Section
Moving Data Mining Objects
Processing Requirements and Considerations (Data Mining)
Using SQL Server Profiler to Monitor Data Mining (Analysis Services - Data Mining)
NOTE
Some clients, such as the Data Mining Add-ins for Microsoft Excel 2007, also let you create session mining models and
mining structures, which use a connection to an instance but store the mining structure and models on the server only for
the duration of the session. You can still manage these models through the client, the same as you would structures and
models stored in an Analysis Services database, but the objects are not persisted after you disconnect from the instance of
Analysis Services.
WARNING
All changes to a mining structure or mining model, including changes to metadata such as a name or description, require
that the structure or model be reprocessed.
If you do not have the solution file that was used to create the data mining project or objects, you can import the
existing project from the server using the Analysis Services Import wizard, make modifications to the objects, and
then redeploy using the Incremental option. For more information, see Import a Data Mining Project using the
Analysis Services Import Wizard.
See Also
Analysis Services Developer Documentation
Moving Data Mining Objects
5/16/2018 • 2 minutes to read • Edit Online
NOTE
You cannot export and import OLAP models by using DMX. If your mining model is based on an OLAP cube, you must use
the functionality provided by Analysis Services for backing up and restoring an entire database, or redeploy the cube and its
models.
See Also
Management of Data Mining Solutions and Objects
Processing Requirements and Considerations (Data
Mining)
5/16/2018 • 4 minutes to read • Edit Online
See Also
Mining Structures (Analysis Services - Data Mining)
Mining Structures (Analysis Services - Data Mining)
Processing a multidimensional model (Analysis Services)
Using SQL Server Profiler to Monitor Data Mining
(Analysis Services - Data Mining)
11/16/2018 • 2 minutes to read • Edit Online
By viewing the command statements in the trace log, you can also see the syntax of complex statements sent by
the client to the Analysis Services server, including calls to system stored procedures. This information can be
useful for debugging, or you can use valid statements as a template for creating new prediction queries or models.
For some examples of stored procedure calls that you can capture via a trace, see Clustering Model Query
Examples.
See Also
Monitor Analysis Services with SQL Server Extended Events
Security Overview (Data Mining)
5/16/2018 • 3 minutes to read • Edit Online
Security Architecture
See the following resources to learn about the basic security architecture of an instance of Analysis Services,
including how Analysis Services uses Microsoft Windows Authentication to authenticate user access.
Security Roles (Analysis Services - Multidimensional Data)
Security Properties
Configure Service Accounts (Analysis Services)
Authorizing access to objects and operations (Analysis Services)
See Also
Roles and Permissions (Analysis Services)
Data Mining Tools
5/16/2018 • 3 minutes to read • Edit Online
See Also
Data Mining Extensions (DMX) Reference
Mining Model Tasks and How -tos
Mining Model Viewer Tasks and How -tos
Data Mining Solutions
Data Mining Wizard (Analysis Services - Data
Mining)
11/28/2018 • 7 minutes to read • Edit Online
NOTE
You do not need to have a cube or an OLAP database to do data mining. Unless your data is already stored in a cube, or
you want to mine OLAP dimensions or the results of OLAP aggregations or calculations, we recommend that you use a
relational table or data source for data mining.
Choosing an Algorithm
Next, you must decide on which algorithm to use in processing your data. This decision can be difficult to make.
Each algorithm provided in Analysis Services has different features and produces different results, so you can
experiment and try several different models before determining which is most appropriate for your data and your
business problem. See the following topic for an explanation of the tasks to which each algorithm is best suited:
Data Mining Algorithms (Analysis Services - Data Mining)
Again, you can create multiple models using different algorithms, or change parameters for the algorithms to
create different models. You are not locked into your choice of algorithm, and it is good practice to create several
different models on the same data.
Define the Data Used for Modeling
In addition to choosing the data from a source, you must specify which of the table in the data source view
contains the case data. The case table will be used to train the data mining model, and as such should contain the
entities that you want to analyze: for example, customers and their demographic information. Each case must be
unique, and must be identifiable by a case key.
In addition to specifying the case table, you can include nested tables in your data. A nested table usually contains
additional information about the entities in the case table, such as transactions conducted by the customer, or
attributes that have a many-to-one relationship with the entity. For example, a nested table joined to the
Customers case table might include a list of products purchased by each customer. In a model that analyzes traffic
to a Web site, the nested table might include the sequences of pages that the user visited. For more information,
see Nested Tables (Analysis Services - Data Mining)
Additional Features
To assist you in choosing the right data, and configuring the data sources correctly, the Data Mining Wizard
provides these additional features:
Auto -detection of data types: The wizard will examine the uniqueness and distribution of column values
and then recommend the best data type, and suggest a usage type for the data. You can override these
suggestions by selecting values from a list.
Suggestions for variables: You can click on a dialog box and start an analyzer that calculates correlations
across the columns included in the model, and determines whether any columns are likely predictors of the
outcome attribute, given the configuration of the model so far. You can override these suggestions by
typing different values.
Feature selection: Most algorithms will automatically detect columns that are good predictors and use
those preferentially. In columns that contain too many values, feature selection will be applied, to reduce the
cardinality of the data and improve the chances for finding a meaningful pattern. You can affect feature
selection behavior by using model parameters.
Automatic cube slicing: If your mining model is based on an OLAP data source, the ability to slice the
model by using cube attributes is automatically provided. This is handy for crating models based on subsets
of cube data.
Completing the Wizard
The last step in the wizard is to name the mining structure and the associated mining model. Depending on the
type of model you created, you might also have the following important options:
If you select Allow drill through, the ability to drill through is enabled in the model. With drillthrough,
users who have the appropriate permissions can explore the source data that is used to build the model.
If you are building an OLAP model, you can select the options, Create a new data mining cube, or
Create a data mining dimension. Both these options make it easier to browse the completed model and
drill through to the underlying data.
After you complete the Data Mining Wizard, you use Data Mining Designer to modify the mining structure and
models, to view the accuracy of the model, view characteristics of the structure and models, or make predictions
by using the models.
Back to Top
Related Content
To learn more about the decisions you need to make when creating a data mining model, see the following links:
Data Mining Algorithms (Analysis Services - Data Mining)
Content Types (Data Mining)
Data Types (Data Mining)
Feature Selection (Data Mining)
Missing Values (Analysis Services - Data Mining)
Drillthrough on Mining Models
See Also
Data Mining Tools
Data Mining Solutions
Create a Relational Mining Structure
11/28/2018 • 9 minutes to read • Edit Online
Requirements
First, you must have an existing data source. You can use the Data Source designer to set up a data source, if one
does not already exist. For more information, see Create a Data Source (SSAS Multidimensional).
Next, use the Data Source View Wizard to assemble required data into a single data source view. For more
information about how you can select, transform, filter, or manage data with data source views, see Data Source
Views in Multidimensional Models.
Overview of Process
Start the Data Mining Wizard, by right-clicking the Mining Structures node in Solution Explorer, and selecting
Add New Mining Structure. The wizard guides you through the following steps to create the structure for a
new relational mining model:
1. Select the Definition Method: Here you select a data source type, and choose From relational
database or data warehouse.
2. Create the Data Mining Structure: Determine whether you will build just a structure, or a structure with
a mining model.
You also choose an appropriate algorithm for your initial model. For guidance on which algorithm is best
for certain tasks, see Data Mining Algorithms (Analysis Services - Data Mining).
3. Select Data Source View: Choose a data sources view to use in training your model. The data source
view can also contain data used for testing, or unrelated data. You get to pick and choose which data is
actually used in the structure and in the model. You can also apply filters to the data later on.
4. Specify Table Types: Select the table that contains the cases used for analysis. For some data sets,
especially ones used for building market basket models, you might also include a related table, to use as a
nested table.
For each table, you must specify the key, so that the algorithm knows how to identify a unique record, and
related records if you have added a nested table.
For more information, see Mining Structure Columns.
5. Specify the Training Data: On this page, you choose as the case table, which is the table that contains
the most important data for analysis.
For some data sets, especially ones used for building market basket models, you might also include a
related table. The values in that nested table will be handled as multiple values that are all related to a
single row (or case) in the main table.
6. Specify Columns Content and Data Types: For each column that you use in the structure, you must
choose both a data type and a content type.
The wizard will automatically detect possible data types, but you don't need to use the data type
recommended by the wizard. For example, even if your data contains numbers, they might be
representative of categorical data. Columns that you specify as keys are automatically assigned the correct
data type for that particular model type. For more information, see Mining Model Columns and Data
Types (Data Mining).
The content type that you choose for each column that you use in the model tells the algorithm how the
data should be processed.
For example, you might decide to discretize numbers, rather than use continuous values. You can also ask
the algorithm to automatically detect the best content type for the column. For more information, see
Content Types (Data Mining).
7. Create Testing Set: On this page, you can tell the wizard how much data should be set aside for use in
testing the model. If your data will support multiple models, it is a good idea to create a holdout data set,
so that all models can be tested on the same data.
For more information, see Testing and Validation (Data Mining).
8. Completing the Wizard: On this page, you give a name to the new mining structure and the associated
mining model, and save the structure and model.
You also can set some important options, depending on the model type. For example, you can enable
drillthrough on the structure.
At this point the mining structure and its model are just metadata; you will need to process them both to
get results.
Why and How to Split Data into Training and Testing Sets
Near the end of the wizard, you must decide whether to partition your data into training and testing sets. The
ability to provision a randomly sampled portion of the data for testing is very convenient, as it ensures that a
consistent set of test data is available for use with all mining models associated with the new mining structure.
WARNING
Note that this option is not available for all model types. For example, if you create a forecasting model, you won't be able
to use holdout, because the time series algorithm requires that there be no gaps in data. For a list of the model types that
support holdout data sets, see Training and Testing Data Sets.
To create this holdout data set, you specify the percentage of the data you want to use for testing. All remaining
data will be used for training. Optionally, you can set a maximum number of cases to use for testing, or set a seed
value to use in starting the random selection process.
The definition of the holdout test set is stored with the mining structure, so that whenever you create a new
model based on the structure, the testing data set will be available for assessing the accuracy of the model. If you
delete the cache of the mining structure, the information about which cases were used for training and which
were used for testing will be deleted as well.
Why and How to Enable Drillthrough
Almost at the very end of the wizard, you have the option to enable drillthrough. It is easy to miss this option, but
it's an important one. Drillthrough lets you view source data in the mining structure by querying the mining
model.
Why is this useful? Suppose you are viewing the results of a clustering model, and want to see the customers
who were put into a specific cluster. By using drillthrough, you can view details such as contact information.
WARNING
To use drillthrough, you must enable it when you create the mining structure. You can enable drillthrough on models later,
by setting a property on the model, but mining structures require that this option be set at the beginning. For more
information, see Drillthrough Queries (Data Mining).
See Also
Data Mining Designer
Data Mining Wizard (Analysis Services - Data Mining)
Mining Model Properties
Properties for Mining Structure and Structure Columns
Mining Structure Tasks and How -tos
Create an OLAP Mining Structure
11/27/2018 • 11 minutes to read • Edit Online
NOTE
The OLAP cube that you use as a source must exist within the same database as the mining structure, as described
above. Also, you cannot use a cube created by the Power Pivot for Excel add-in as a source for data mining.
2. Create the Data Mining Structure: Determine whether you will build just a structure, or a structure with
a mining model.
You must also choose an appropriate algorithm for analyzing your data. For guidance on which algorithm is
best for certain tasks, see HYPERLINK "ms-help://SQL111033/as_1devconc/html/ed1fc83b-b98c-437e-
bf53-4ff001b92d64.htm" Data Mining Algorithms (Analysis Services - Data Mining).
3. Select the Source Cube Dimension: This step is the same as selecting a data source. You need to choose
the single dimension that contains the most important data used for in training your model. You can add
data from other dimensions later, or filter the dimension.
4. Select the Case Key: Within the dimension that you just selected, choose an attribute (column) to serve as
the unique identifier for your case data.
Typically a column will be pre-selected for you, but you can change the column if in fact there are multiple
keys.
5. Selecting Case Level Columns: Here you choose the attributes from the selected dimension, and the
related measures, that are relevant to your analysis. This step is equivalent to selecting columns from a
table.
The wizard automatically includes for your review and selection any measures that were created using
attributes from the selected dimension.
For example, if your cube contains a measure that calculates freight cost based on the customer's
geographical location, and you chose the Customer dimension as your main data source for modeling, the
measure will be proposed as a candidate for adding to the model. Beware of adding too many measures
that are already directly based on attributes, as there is already one implicit relationship between the
columns, as defined in the measure formula, and the strength of this (expected) correlation can obscure
other relationships that you might otherwise discover.
6. Specify Mining Model Column Usage: For each attribute or measure that you added to the structure,
you must specify whether the attribute should be used for prediction, or used as input. If you do not select
either of these options, the data will be processed but will not be used for analysis; however, it will be
available as background data in case you later enable drillthrough.
7. Add nested tables: Click to add related tables. In the Select a Measure Group Dimension dialog box,
you can choose a single dimension from among the dimensions that are related to the current dimension.
Next, you use the Select a Nested Table Key dialog box to define how the new dimension is related to the
dimension that contains the case data.
Use the Select Nested Table Columns dialog box to choose the attributes and measures from the new
dimension that you want to use in analysis. You must also specify whether the nested attribute will be used
for prediction.
After you have added all the nested attributes you might need, return to the page, Specify Mining Model
Column Usage, and click Next.
8. Specify Columns Content and Data Type: By this point, you have added all the data that will be used for
analysis, and must specify the data type and content type for each attribute.
In an OLAP model, you do not have the option to automatically detect data types, because the data type is
already defined by the multidimensional solution and cannot be changed. Keys are also automatically
identified. For more information, see Data Types (Data Mining).
The content type that you choose for each column that you use in the model tells the algorithm how the
data should be processed. For more information, see Content Types (Data Mining).
9. Slicing the source cube: Here you can define filters in a cube to select just a subset of data and train
models that are more targeted.
You filter a cube by choosing the dimension to filter on, selecting the level of the hierarchy that contains the
criteria you want to use, and then typing a condition to use as the filter.
10. Create Testing Set: On this page, you can tell the wizard how much data should be set aside for use in
testing the model. If your data will support multiple models, it is a good idea to create a holdout data set, so
that all models can be tested on the same data.
For more information, see Testing and Validation (Data Mining).
11. Completing the Wizard: On this page, you give a name to the new mining structure and the associated
mining model, and save the structure and model.
On this page, you can also can set the following options:
Allow drillthrough
Create mining model dimension
Create cube using mining model dimension
To learn more about these options, see the section later in this topic, Understanding Data Mining
Dimensions and Drillthrough.
At this point the mining structure and its model are just metadata; you will need to process them both to get
results.
Group members into clusters Segment a customer dimension based Microsoft Clustering Algorithm
on customer member properties, the
products that the customers buy, and
the amount of money that the
customers spend.
Find interesting or abnormal members Identify interesting or abnormal stores Microsoft Decision Trees Algorithm
in a store dimension based on sales,
profit, store location, and store size.
Find interesting or abnormal cells Identify store sales that go against Microsoft Time Series Algorithm
typical trends over time.
Find correlations Identify factors that are related to Microsoft Naïve Bayes algorithm
server downtime, including region,
machine type, OS, or purchase date.
WARNING
Note that the interface for designing and browsing cubes has been changed in SQL Server 2017. For more information, see
Browse data and metadata in Cube.
You can add as many filters on the cube as are required to return the data that you need for the mining model. You
can also define slices on individual cube slices. For example, if your structure contains two nested tables that are
based on products, you could slice one table on March 2004 and the other table on April 2004. The resulting
model could then be used to predict purchases made in April based on the purchases that were made in March.
WARNING
Only these model types support the creation of data mining dimensions: models based on the Microsoft Clustering
algorithm, the Microsoft Decision Trees algorithm, or the Microsoft Association algorithm.
See Also
Data Mining Algorithms (Analysis Services - Data Mining)
Mining Structure Columns
Mining Model Columns
Mining Model Properties
Properties for Mining Structure and Structure Columns
Add Mining Models to a Structure (Analysis Services
- Data Mining)
11/28/2018 • 5 minutes to read • Edit Online
NOTE
In DMX, the CREATE MINING MODEL statement begins with the mining model. That is, you define your choice of mining
model, and Analysis Services automatically generates the underlying structure. Later you can continue to add new mining
models to that structure, by using the ALTER STRUCTURE... ADD MODEL statement.
Choosing an Algorithm
When you add a new model to an existing structure, the first thing you should do is select a data mining algorithm
to use in that model. Choosing the algorithm is important because each algorithm performs a different type of
analysis and has different requirements.
When you select an algorithm that is incompatible with your data, you will get a warning. In some cases, you
might need to ignore columns that cannot be processed by the algorithm. In other cases, the algorithm will
automatically make the adjustments for you. For example, if your structure contains numeric data, and the
algorithm can only work with discrete values, it will group the numeric values into discrete ranges for you. In some
cases, you might need to manually fix the data first, by choosing a key or choosing a predictable attribute.
You do not need to change the algorithm when you create a new model. Often you can get very different results
by using the same algorithm, but filtering the data, or changing a parameter such as the clustering method or the
minimum itemset size. We recommend that you experiment with multiple models to see which parameters
produce the best results.
Note that all new models need to be processed before you can use them.
See Also
Mining Structures (Analysis Services - Data Mining)
Create a Relational Mining Structure
Mining Model Properties
Mining Model Columns
Customize Mining Models and Structure
11/27/2018 • 6 minutes to read • Edit Online
The graphic shows related models that have multiple copies of a mining structure column, all related to Income.
Each copy of the structure column has been discretized in a different way. The models in the diagram each use a
different column from the mining structure; however, for convenience in comparing the columns across the
models, the column in each model has been renamed to [Income].
Adding Filters
You can add a filter to a mining model. A filter is a set of WHERE conditions that restrict the data in the model
cases to some subset. The filter is used when training the model, and can optionally be used when you test the
model or create accuracy charts.
By adding filters, you can reuse mining structures but create models based on very different subsets of the data.
Or, you can simply use filters to eliminate certain rows and improve the quality of analysis.
For more information, see Filters for Mining Models (Analysis Services - Data Mining).
See Also
Data Mining Algorithms (Analysis Services - Data Mining)
Physical Architecture (Analysis Services - Data Mining)
Data Mining Designer
5/16/2018 • 2 minutes to read • Edit Online
See Also
Data Mining Solutions
Data Mining Model Viewers
5/16/2018 • 3 minutes to read • Edit Online
In This Section
The following topics describe in more detail each of the viewers, and how to interpret the information in them.
Browse a Model Using the Microsoft Tree Viewer
Describes the Microsoft Tree Viewer. This viewer displays mining models that are built with the Microsoft
Decision Trees algorithm and the Microsoft Linear Regression algorithm.
Browse a Model Using the Microsoft Cluster Viewer
Describes the Microsoft Cluster Viewer. This viewer displays mining models that are built with the Microsoft
Clustering algorithm.
Browse a Model Using the Microsoft Time Series Viewer
Describes the Microsoft Time Series Viewer. This viewer displays mining models that are built with the
Microsoft Time Series algorithm.
Browse a Model Using the Microsoft Naive Bayes Viewer
Describes the Microsoft Naive Bayes viewer. This viewer displays mining models that are built with the
Microsoft Naive Bayes algorithm.
Browse a Model Using the Microsoft Sequence Cluster Viewer
Describes the Microsoft Sequence Cluster Viewer. This viewer displays mining models that are built with the
Microsoft Sequence Clustering algorithm.
Browse a Model Using the Microsoft Association Rules Viewer
Describes the Microsoft Association Rules Viewer. This viewer displays mining models that are built with the
Microsoft Association algorithm.
Browse a Model Using the Microsoft Neural Network Viewer
Describes the Microsoft Neural Network Viewer. This viewer displays mining models that are built with the
Microsoft Neural Network algorithm, including models that use the Microsoft Logistic Regression algorithm.
Browse a Model Using the Microsoft Generic Content Tree Viewer
Describes the detailed information that is available in the generic viewer for all data mining models and
provides examples of how to interpret the information for each algorithm.
See Also
Data Mining Algorithms (Analysis Services - Data Mining)
Data Mining Designer
Browse a Model Using the Microsoft Tree Viewer
5/16/2018 • 5 minutes to read • Edit Online
NOTE
To view detailed information about the equations used in the model and the patterns that were discovered, use the
Microsoft Generic Content Tree viewer. For more information, see Browse a Model Using the Microsoft Generic Content
Tree Viewer or Microsoft Generic Content Tree Viewer (Data Mining).
Viewer Tabs
When you browse a mining model in Analysis Services, the model is displayed on the Mining Model Viewer
tab of Data Mining Designer in the appropriate viewer for the model. The Microsoft Tree Viewer includes the
following tabs and panes:
Decision Tree
Dependency Network
Mining Legend
Decision Tree
When you build a decision tree model, Analysis Services builds a separate tree for each predictable attribute. You
can view an individual tree by selecting it from the Tree list on the Decision Tree tab of the viewer.
A decision tree is composed of a series of splits, with the most important split, as determined by the algorithm, at
the left of the viewer in the All node. Additional splits occur to the right. The split in the All node is most
important because it contains the strongest split-causing conditional in the dataset, and therefore it caused the
first split.
You can expand or collapse individual nodes in the tree to show or hide the splits that occur after each node. You
can also use the options on the Decision Tree tab to affect how the tree is displayed. Use the Show Level slider
to adjust the number of levels that are shown in the tree. Use Default Expansion to set the default number of
levels that are displayed for all trees in the model.
Predicting Discrete Attributes
When a tree is built with a discrete predictable attribute, the viewer displays the following on each node in the
tree:
The condition that caused the split.
A histogram that represents the distribution of the states of the predictable attribute, ordered by
popularity.
You can use the Histogram option to change the number of states that appear in the histograms in the tree. This
is useful if the predictable attribute has many states. The states appear in a histogram in order of popularity from
left to right; if the number of states that you choose to display is fewer than the total number of states in the
attribute, the least popular states are displayed collectively in gray. To see the exact count for each state for a node,
pause the pointer over the node to view an InfoTip, or select the node to view its details in the Mining Legend.
The background color of each node represents the concentration of cases of the particular attribute state that you
select by using the Background option. You can use this option to highlight nodes that contain a particular target
in which you are interested.
Predicting Continuous Attributes
When a tree is built with a continuous predictable attribute, the viewer displays a diamond chart, instead of a
histogram, for each node in the tree. The diamond chart has a line that represents the range of the attribute. The
diamond is located at the mean for the node, and the width of the diamond represents the variance of the
attribute at that node. A thinner diamond indicates that the node can create a more accurate prediction. The
viewer also displays the regression equation, which is used to determine the split in the node.
Additional Decision Tree Display Options
When drill through is enabled for a decision tree model, you can access the training cases that support a node by
right-clicking the node in the tree and selecting Drill Through. You can enable drill through within the Data
Mining Wizard, or by adjusting the drill through property on the mining model in the Mining Models tab.
You can use the zoom options on the Decision Tree tab to zoom in or out of a tree, or use Size to Fit to fit the
whole model in the viewer screen. If a tree is too large to be sized to fit the screen, you can use the
Navigationoption to navigate through the tree. Clicking Navigation opens a separate navigation window that
you can use to select sections of the model to display.
You can also copy the tree view image to the Clipboard, so that you can paste it into documents or into image
manipulation software. Use Copy Graph View to copy only the section of the tree that is visible in the viewer, or
use Copy Entire Graph to copy all the expanded nodes in the tree.
Back to Top
Dependency Network
The Dependency Network displays the dependencies between the input attributes and the predictable
attributes in the model. The slider at the left of the viewer acts as a filter that is tied to the strengths of the
dependencies. If you lower the slider, only the strongest links are shown in the viewer.
When you select a node, the viewer highlights the dependencies that are specific to the node. For example, if you
choose a predictable node, the viewer also highlights each node that helps predict the predictable node.
If the viewer contains numerous nodes, you can search for specific nodes by using the Find Node button.
Clicking Find Node opens the Find Node dialog box, in which you can use a filter to search for and select
specific nodes.
The legend at the bottom of the viewer links color codes to the type of dependency in the graph. For example,
when you select a predictable node, the predictable node is shaded turquoise, and the nodes that predict the
selected node are shaded orange.
Back to Top
Mining Legend
The Mining Legend displays the following information when you select a node in the decision tree model:
The number of cases in the node, broken down by the states of the predictable attribute.
The probability of each case of the predictable attribute for the node.
A histogram that includes a count for each state of the predictable attribute.
The conditions that are required to reach a specific node, also known as the node path.
For linear regression models, the regression formula.
You can dock and work with the Mining Legend in a similar manner as with Solution Explorer.
Back to Top
See Also
Microsoft Decision Trees Algorithm
Mining Model Viewers (Data Mining Model Designer)
Mining Model Viewer Tasks and How -tos
Data Mining Tools
Data Mining Model Viewers
Browse a Model Using the Microsoft Cluster Viewer
5/16/2018 • 3 minutes to read • Edit Online
NOTE
To view detailed information about the equations used in the model and the patterns that were discovered, use the
Microsoft Generic Content Tree viewer. For more information, see Browse a Model Using the Microsoft Generic Content Tree
Viewer or Microsoft Generic Content Tree Viewer (Data Mining).
Viewer Tabs
When you browse a mining model in Analysis Services, the model is displayed on the Mining Model Viewer tab
of Data Mining Designer in the appropriate viewer for the model. The Microsoft Cluster Viewer provides the
following tabs for use in exploring clustering mining models:
Cluster Diagram
Cluster Profiles
Cluster Characteristics
Cluster Discrimination
Cluster Diagram
The Cluster Diagram tab of the Microsoft Cluster Viewer displays all the clusters that are in a mining model. The
shading of the line that connects one cluster to another represents the strength of the similarity of the clusters. If
the shading is light or nonexistent, the clusters are not very similar. As the line becomes darker, the similarity of
the links becomes stronger. You can adjust how many lines the viewer shows by adjusting the slider to the right of
the clusters. Lowering the slider shows only the strongest links.
By default, the shade represents the population of the cluster. By using the Shading****Variable and State
options, you can select which attribute and state pair the shading represents. The darker the shading, the greater
the attribute distribution is for a specific state. The distribution decreases as the shading gets lighter.
To rename a cluster, right-click its node and select Rename Cluster. The new name is persisted to the server.
To copy the visible section of the diagram to the Clipboard, click Copy Graph View. To copy the complete
diagram, click Copy Entire Graph. You can also zoom in and out by using Zoom In and Zoom Out, or you can
fit the diagram to the screen by using Scale Diagram to Fit in Window.
Back to Top
Cluster Profiles
The Cluster Profiles tab provides an overall view of the clusters that the algorithm in your model creates. This
view displays each attribute, together with the distribution of the attribute in each cluster. An InfoTip for each cell
displays the distribution statistics, and an InfoTip for each column heading displays the cluster population.
Discrete attributes are shown as colored bars, and continuous attributes are shown as a diamond chart that
represents the mean and standard deviation in each cluster. The Histogram bars option controls the number of
bars that are visible in the histogram. If more bars exist than you choose to display, the bars of highest importance
are retained, and the remaining bars are grouped together into a gray bucket.
You can change the default names of the clusters, to make the names more descriptive. Rename a cluster by right-
clicking its column heading and selecting Rename cluster. You can also hide clusters by selecting Hide column.
To open a window that provides a larger, more detailed view of the clusters, double-click either a cell in the States
column or a histogram in the viewer.
Click a column heading to sort the attributes in order of importance for that cluster. You can also drag columns to
reorder them in the viewer.
Back to Top
Cluster Characteristics
To use the Cluster Characteristics tab, select a cluster from the Cluster list. After you select a cluster, you can
examine the characteristics that make up that specific cluster. The attributes that the cluster contains are listed in
the Variables columns, and the state of the listed attribute is listed in the Values column. Attribute states are
listed in order of importance, described by the probability that they will appear in the cluster. The probability is
shown in the Probability column.
Back to Top
Cluster Discrimination
You can use the Cluster Discrimination tab to compare attributes between two clusters. Use the Cluster 1 and
Cluster 2 lists to select the clusters to compare. The viewer determines the most important differences between
the clusters, and displays the attribute states that are associated with the differences, in order of importance. A bar
to the right of the attribute shows which cluster the state favors, and the size of the bar shows how strongly the
state favors the cluster.
Back to Top
See Also
Microsoft Clustering Algorithm
Mining Model Viewer Tasks and How -tos
Mining Model Viewer Tasks and How -tos
Data Mining Tools
Data Mining Model Viewers
Browse a Model Using the Microsoft Time Series
Viewer
5/16/2018 • 6 minutes to read • Edit Online
NOTE
To view detailed information about the equations used in the model and the patterns that were discovered, use the
Microsoft Generic Content Tree viewer. For more information, see Browse a Model Using the Microsoft Generic Content
Tree Viewer or Microsoft Generic Content Tree Viewer (Data Mining).
Viewer Tabs
When you browse a mining model in Analysis Services, the model is displayed on the Mining Model Viewer
tab of Data Mining Designer in the appropriate viewer for the model. The Microsoft Time Series Viewer provides
the following tabs:
Model
Charts
Note The information shown for the model content and in the Mining Legend depends on the algorithm that the
model uses. However, the Model and Charts tabs are the same regardless of the algorithm mix.
Model
When you build a time series model, Analysis Services presents the completed model as a tree. If your data
contains multiple case series, Analysis Services builds a separate tree for each series. For example, you are
predicting sales for the Pacific, North America, and Europe regions. The predictions for each of these regions are
case series. Analysis Services builds a separate tree for each of these series. To view a particular series, select the
series from the Tree list.
For each tree, the time series model contains an All node, and then splits into a series of nodes that represent
periodic structures discovered by the algorithm. You can click each node to display statistics such as the number
of cases and the equation.
If you created the model using ARTxp only, the Mining Legend for the root node contains only the total number
of cases. For each non-root node, the Mining Legend contains more detailed information about the tree split:
for example, it might show the equation for the node and the number of cases. The rule in the legend contains
information that identifies the series, and the time slice to which the rule applies. For example, the legend text
M200 Europe Amount -2 indicates that the node represents the model for the M200 Europe series, at a period two
time slices ago.
If you created the model using ARIMA only, the Model tab contains a single node with the caption, All. The
Mining Legend for the root node contains the ARIMA equation.
If you created a mixed model, the root node contains the number of cases and the ARIMA equation only. After
the root node, the tree splits into separate nodes for each periodic structure. For each non-root node, the Mining
Legend contains both the ARTxp and ARIMA algorithms, the equation for the node, and the number of cases in
the node. The ARTxp equation is listed first, and is labeled as the tree node equation. This is followed by the
ARIMA equation. For more information about how to interpret this information, see Microsoft Time Series
Algorithm Technical Reference.
In general, the decision tree graph shows the most important split, the All node, at the left of the viewer. In
decision trees, the split after the All node is the most important because it contains the condition that most
strongly separates the cases in the training data. In a time series model, the main branching indicates the most
likely seasonal cycle. Splits after the All node appear to the right of the branch.
You can expand or collapse individual nodes in the tree to show or hide the splits that occur after each node. You
can also use the options on the Decision Tree tab to affect how the tree is displayed. Use the Show Level slider
to adjust the number of levels that are shown in the tree. Use Default Expansion to set the default number of
levels that are displayed for all trees in the model.
The shading of the background color for each node signifies the number of cases that are in the node. To find the
exact number of cases in a node, pause the pointer over the node to view an InfoTip for the node.
Back to Top
Charts
The Charts tab displays a graph that shows the behavior of the predicted attribute over time, together with five
predicted future values. The vertical axis of the chart represents the value of the series, and the horizontal axis
represents time.
NOTE
The time slices used on the time axis depend on the units used in your data: they could represent days, months, or even
seconds.
Use the Abs button to toggle between absolute and relative curves. If your chart contains multiple models, the
scale of the data for each model might be very different. If you use an absolute curve, one model might appear
as a flat line, whereas another model shows significant changes. This occurs because the scale of one model is
greater than the scale of the other model. By switching to a relative curve, you change the scale to show the
percentage of change instead of absolute values. This makes it easier to compare models that are based on
different scales.
If the mining model contains multiple time series, you can select one or multiple series to display in the chart.
Just click the list at the right of the viewer and select the series you want from the list. If the chart becomes too
complex, you can filter the series that are displayed by selecting or clearing the series check boxes in the legend.
The chart displays both historical and future data. Future data appears shaded, to differentiate it from historical
data. The data values appear as solid lines for historical data and as dotted lines for predictions. You can change
the color of the lines that are used for each series by setting properties in SQL Server Data Tools (SSDT) or SQL
Server Management Studio. For more information, see Change the Colors Used in the Data Mining Viewer.
You can adjust the range of time that is displayed by using the zoom options. You can also view a specific time
range by clicking the chart, dragging a time selection across the chart, and then clicking again to zoom in on the
selected range.
You can select how many future time steps that you want to see in the model by using Prediction Steps. If you
select the Show Deviations check box, the viewer provides error bars so that you can see how accurate the
predicted value is.
Back to Top
See Also
Mining Model Viewer Tasks and How -tos
Microsoft Time Series Algorithm
Time Series Model Query Examples
Data Mining Model Viewers
Browse a Model Using the Microsoft Naive Bayes
Viewer
5/16/2018 • 3 minutes to read • Edit Online
NOTE
If you want to view detailed information about the equations used in the model and the patterns that were discovered, you
can switch to the Microsoft Generic Content Tree viewer. For more information, see Browse a Model Using the Microsoft
Generic Content Tree Viewer or Microsoft Generic Content Tree Viewer (Data Mining).
Viewer Tabs
When you browse a mining model in Analysis Services, the model is displayed on the Mining Model Viewer tab
of Data Mining Designer in the appropriate viewer for the model. The Microsoft Naive Bayes Viewer provides the
following tabs for exploring data:
Dependency Network
Attribute Profiles
Attribute Characteristics
Attribute Discrimination
Dependency Network
The Dependency Network tab displays the dependencies between the input attributes and the predictable
attributes in a model. The slider at the left of the viewer acts as a filter that is tied to the strengths of the
dependencies. Lowering the slider shows only the strongest links.
When you select a node, the viewer highlights the dependencies that are specific to the node. For example, if you
choose a predictable node, the viewer also highlights each node that helps predict the predictable node.
The legend at the bottom of the viewer links color codes to the type of dependency in the graph. For example,
when you select a predictable node, the predictable node is shaded turquoise, and the nodes that predict the
selected node are shaded orange.
Back to Top
Attribute Profiles
The Attribute Profiles tab displays histograms in a grid. You can use this grid to compare the predictable
attribute that you select in the Predictable box to all other attributes that are in the model. Each column in the tab
represents a state of the predictable attribute. If the predictable attribute has many states, you can change the
number of states that appear in the histogram by adjusting the Histogram bars. If the number you choose is less
than the total number of states in the attribute, the states are listed in order of support, with the remaining states
collected into a single gray bucket.
To display a Mining Legend that relates the colors of the histogram to the states of an attribute, click the Show
Legend check box. The Mining Legend also displays the distribution of cases for each attribute-value pair that
you select.
To copy the contents of the grid to the Clipboard as an HTML table, right-click the Attribute Profiles tab and
select Copy.
Back to Top
Attribute Characteristics
To use the Attribute Characteristics tab, select a predictable attribute from the Attribute list and select a state of
the selected attribute from the Value list. When you set these variables, the Attribute Characteristics tab
displays the states of the attributes that are associated with the selected case of the selected attribute. The
attributes are sorted by importance.
Back to Top
Attribute Discrimination
To use the Attribute Discrimination tab, select a predictable attribute and two of its states from the Attribute,
Value 1, and Value 2 lists. The grid on the Attribute Discrimination tab then displays the following information
in columns:
Attribute
Lists other attributes in the dataset that contain a state that highly favors one state of the predictable attribute.
Values
Shows the value of the attribute in the Attribute column.
Favors <value 1>
Shows a colored bar that indicates how strongly the attribute value favors the predictable attribute value shown in
Value 1.
Favors <value 2>
Shows a colored bar that indicates how strongly the attribute value favors the predictable attribute value shown in
Value 2.
Back to Top
See Also
Microsoft Naive Bayes Algorithm
Mining Model Viewer Tasks and How -tos
Data Mining Tools
Data Mining Model Viewers
Browse a Model Using the Microsoft Sequence
Cluster Viewer
5/16/2018 • 4 minutes to read • Edit Online
NOTE
To view detailed information about the equations used in the model and the patterns that were discovered, use the
Microsoft Generic Content Tree viewer. For more information, see Browse a Model Using the Microsoft Generic Content Tree
Viewer or Microsoft Generic Content Tree Viewer (Data Mining).
NOTE
The Microsoft Sequence Cluster Viewer provides functionality and options that are similar to the Microsoft Cluster Viewer.
For more information, see Browse a Model Using the Microsoft Cluster Viewer.
Viewer Tabs
When you browse a mining model in Analysis Services, the model is displayed on the Mining Model Viewer tab
of Data Mining Designer in the appropriate viewer for the model. The Microsoft Sequence Cluster Viewer
provides the following tabs for use in exploring sequence clustering mining models:
Cluster Diagram
Cluster Profiles
Cluster Characteristics
Cluster Discrimination
Cluster Transitions
Cluster Diagram
The Cluster Diagram tab of the Microsoft Sequence Cluster Viewer displays all the clusters that are in a mining
model. The shading of the line that connects one cluster to another represents the strength of the similarity of the
clusters. If the shading is light or nonexistent, the clusters are not very similar. As the line becomes darker, the
similarity of the links becomes stronger. You can adjust how many lines the viewer shows by adjusting the slider to
the right of the clusters. Lowering the slider shows only the strongest links.
By default, the shade represents the population of the cluster. By using the Shading****Variable and State
options, you can select which attribute and state pair the shading represents. The darker the shading, the greater
the attribute distribution is for a specific state. The distribution decreases as the shading gets lighter.
To rename a cluster, right-click its node and select Rename Cluster. The new name is persisted to the server.
To copy the visible section of the diagram to the Clipboard, click Copy Graph View. To copy the complete
diagram, click Copy Entire Graph. You can also zoom in and out by using Zoom In and Zoom Out, or you can
fit the diagram to the screen by using Scale Diagram to Fit in Window.
Back to Top
Cluster Profiles
The Cluster Profile tab provides an overall view of the clusters that the algorithm in your model creates. Each
column that follows the Population column in the grid represents a cluster that the model discovered. The
<attribute>.samples row represents different sequences of data that exist in the cluster, and the <attribute> row
describes all the items that the cluster contains and their overall distribution.
The Histogram bars option controls the number of bars that are visible in the histogram. If more bars exist than
you choose to display, the bars of highest importance are retained, and the remaining bars are grouped together
into a gray bucket.
You can change the default names of the clusters, to make the names more descriptive. Rename a cluster by right-
clicking its column heading and selecting Rename cluster. You can hide clusters by selecting Hide column, and
you can also drag columns to reorder them in the viewer.
To open a window that provides a larger, more detailed view of the clusters, double-click either a cell in the States
column or a histogram in the viewer.
Back to Top
Cluster Characteristics
To use the Cluster Characteristics tab, select a cluster from the Cluster list. After you select a cluster, you can
examine the characteristics that make up that specific cluster. The attributes that the cluster contains are listed in
the Variables columns, and the state of the listed attribute is listed in the Values column. Attribute states are
listed in order of importance, described by the probability that they will appear in the cluster. The probability is
shown in the Probability column.
Back to Top
Cluster Discrimination
You can use the Cluster Discrimination tab to compare attributes between two clusters, to determine how items
in a sequence favor one cluster over another. Use the Cluster 1 and Cluster 2 lists to select the clusters to
compare. The viewer determines the most important differences between the clusters, and displays the attribute
states that are associated with the differences, in order of importance. A bar to the right of the attribute shows
which cluster the state favors, and the size of the bar shows how strongly the state favors the cluster.
Back to Top
Cluster Transitions
By selecting a cluster on the Cluster Transitions tab, you can browse the transitions between sequence states in
the selected cluster. Each node in the viewer represents a state of the sequence column. An arrow represents a
transition between two states and the probability that is associated with the transition. If a transition returns back
to the originating node, an arrow can point back to the originating node.
An arrow that originates from a dot represents the probability that the node is the start of a sequence. An ending
edge that leads to a null represents the probability that the node is the end of the sequence.
You can filter the edge of the nodes by using the slider at the left of the tab.
Back to Top
See Also
Mining Model Viewer Tasks and How -tos
Mining Model Viewer Tasks and How -tos
Microsoft Sequence Clustering Algorithm
Data Mining Tools
Data Mining Model Viewers
Browse a Model Using the Microsoft Cluster Viewer
Browse a Model Using the Microsoft Association
Rules Viewer
11/28/2018 • 3 minutes to read • Edit Online
NOTE
To view detailed information about the equations used in the model and the patterns that were discovered, use the
Microsoft Generic Content Tree viewer. For more information, see Browse a Model Using the Microsoft Generic Content Tree
Viewer or Microsoft Generic Content Tree Viewer (Data Mining).
For a walkthrough of how to create, explore, and use an association mining model, see Lesson 3: Building a
Market Basket Scenario (Intermediate Data Mining Tutorial).
Viewer Tabs
When you browse a mining model in Analysis Services, the model is displayed on the Mining Model Viewer tab
of Data Mining Designer in the appropriate viewer for the model. The Microsoft Association Rules Viewer
includes the following tabs:
Itemsets
Rules
Dependency Net
Each tab contains the Show long name check box, which you can use to show or hide the table from which the
itemset originates in the rule or itemset.
Itemsets
The Itemsets tab displays the list of itemsets that the model identified as frequently found together. The tab
displays a grid with the following columns: Support, Size, and Itemset. For more information about support, see
Microsoft Association Algorithm. The Size column displays the number of items in the itemset. The Itemset
column displays the actual itemset that the model discovered. You can control the format of the itemset by using
the Show list, which you can set to the following options:
Show attribute name and value
Show attribute value only
Show attribute name only
You can filter the number of itemsets that are displayed in the tab by using Minimum support and Minimum
itemset size. You can limit the number of displayed itemsets even more by using Filter Itemset and entering an
itemset characteristic that must exist. For example, if you type "Water Bottle = existing", you can limit the itemsets
to only those that contain a water bottle. The Filter Itemset option also displays a list of the filters that you have
used previously.
You can sort the rows in the grid by clicking a column heading.
Back to Top
Rules
The Rules tab displays the rules that the association algorithm discovered. The Rules tab includes a grid that
contains the following columns: Probability, Importance, and Rule. The probability describes how likely the
result of a rule is to occur. The importance is designed to measure the usefulness of a rule. Although the
probability that a rule will occur may be high, the usefulness of the rule may in itself be unimportant. The
importance column addresses this. For example, if every itemset contains a specific state of an attribute, a rule that
predicts state is trivial, even though the probability is very high. The greater the importance, the more important
the rule is.
You can use Minimum probability and Minimum importance to filter the rules, similar to the filtering you can
do on the Itemsets tab. You can also use Filter Rule to filter a rule based on the states of the attributes that it
contains.
You can sort the rows in the grid by clicking a column heading.
Back to Top
Dependency Net
The Dependency Net tab includes a dependency network viewer. Each node in the viewer represents an item,
such as "state = WA". The arrow between nodes represents the association between items. The direction of the
arrow dictates the association between the items according to the rules that the algorithm discovered. For
example, if the viewer contains three items, A, B, and C, and C is predicted by A and B, if you select node C, two
arrows point toward node C - A to C and B to C.
The slider at the left of the viewer acts as a filter that is tied to the probability of the rules. Lowering the slider
shows only the strongest links.
Back to Top
See Also
Microsoft Association Algorithm
Mining Model Viewer Tasks and How -tos
Mining Model Viewer Tasks and How -tos
Data Mining Tools
Data Mining Model Viewers
Browse a Model Using the Microsoft Neural Network
Viewer
5/16/2018 • 3 minutes to read • Edit Online
Viewer Tabs
When you browse a mining model in Analysis Services, the model is displayed on the Mining Model Viewer
tab of Data Mining Designer in the appropriate viewer for the model. The Microsoft Neural Network Viewer
provides the following tabs for use in exploring neural network mining models:
Inputs
Outputs
Variables
Inputs
Use the Inputs tab to choose the attributes and values that the model used as inputs. By default, the viewer opens
with all attributes included. In this default view, the model chooses which attribute values are the most important
to display.
To select an input attribute, click inside the Attribute column of the Input grid, and select an attribute from the
drop-down list. (Only attributes that are included in the model are included in the list.)
The first distinct value appears under the Value column. Clicking the default value reveals a list that contains all
the possible states of the associated attribute. You can select the state that you want to investigate. You can select
as many attributes as you want.
Back to Top
Outputs
Use the Outputs tab to choose the outcome attribute to investigate. You can choose any two outcome states to
compare, assuming the columns were defined as predictable attributes when the model was created.
Use the OutputAttribute list to select an attribute. You can then select two states that are associated with the
attribute from the Value 1 and Value 2 lists. These two states of the output attribute will be compared in the
Variables pane.
Back to Top
Variables
The grid in the Variables tab contains the following columns: Attribute, Value, Favors [value 1], and Favors
[value 2]. By default, the columns are sorted by the strength of Favors [value 1]. Clicking a column heading
changes the sort order to the selected column.
A bar to the right of the attribute shows which state of the output attribute the specified input attribute state
favors. The size of the bar shows how strongly the output state favors the input state.
Back to Top
See Also
Microsoft Neural Network Algorithm
Mining Model Viewer Tasks and How -tos
Mining Model Viewer Tasks and How -tos
Data Mining Tools
Data Mining Model Viewers
Browse a Model Using the Microsoft Generic
Content Tree Viewer
5/16/2018 • 2 minutes to read • Edit Online
See Also
Microsoft Generic Content Tree Viewer (Data Mining)
Data Mining Algorithms (Analysis Services - Data Mining)
Mining Model Viewer Tasks and How-tos
5/16/2018 • 2 minutes to read • Edit Online
In This Section
Select a Mining Model and a Data Mining Viewer
Copy a View of a Mining Model
Find a Specific Node in a Dependency Network
Filter a Rule in an Association Rules Model
Filter an Itemset in an Association Rules Model
Drill Through to Case Data from a Mining Model
View the Formula for a Time Series Model (Data Mining)
Change the Colors Used in the Data Mining Viewer
See Also
Basic Data Mining Tutorial
Mining Model Viewers (Data Mining Model Designer)
Select a Mining Model and a Data Mining Viewer
5/16/2018 • 2 minutes to read • Edit Online
See Also
Mining Model Viewer Tasks and How -tos
Copy a View of a Mining Model
5/16/2018 • 2 minutes to read • Edit Online
WARNING
When you copy a model using the viewer, it does not create a new model object. To create a new model, you must use
either the wizard, or the Data Mining Designer,. For more information, see Make a Copy of a Mining Model.
See Also
Mining Model Viewer Tasks and How -tos
Filter a Rule in an Association Rules Model
5/16/2018 • 2 minutes to read • Edit Online
NOTE
This option is available only for mining models that have been created by using the Microsoft Association Algorithm.
See Also
Mining Model Viewer Tasks and How -tos
Browse a Model Using the Microsoft Association Rules Viewer
Lesson 3: Building a Market Basket Scenario (Intermediate Data Mining Tutorial)
Filter an Itemset in an Association Rules Model
5/16/2018 • 2 minutes to read • Edit Online
See Also
Mining Model Viewer Tasks and How -tos
Use Drillthrough from the Model Viewers
5/16/2018 • 3 minutes to read • Edit Online
See Also
Mining Model Viewer Tasks and How -tos
Drillthrough on Mining Models
Drillthrough on Mining Structures
View the Formula for a Time Series Model (Data
Mining)
5/16/2018 • 2 minutes to read • Edit Online
NOTE
A model will always have multiple trees if you have more than one data series. However, you will not see as many
trees in the Time Series viewer as you will see in the Microsoft Generic Content Tree Viewer. That is because the
Time Series viewer combines the ARIMA and ARTXP information for each data series into a single representation.
NOTE
The model will always have multiple trees if you include more than one data series.
NOTE
If you browse the content of a mixed model that uses both the ARIMA and ARTXP models, the two models are in
separate trees, joined at the root node representing the model. Even though the ARIMA and ARTXP models are
presented in one viewer for convenience, the structures are very different, as are the equations, which cannot be
combined or compared. The ARTXP tree is more like a decision tree, whereas the ARIMA tree represents a series of
moving averages.
See Also
Mining Model Viewer Tasks and How -tos
Browse a Model Using the Microsoft Time Series Viewer
Change the Colors Used in the Data Mining Viewer
5/16/2018 • 2 minutes to read • Edit Online
NOTE
If you use a custom color, the color is represented by a color icon and the RBG values of the color. If you use a
System color or Web color, the color is represented by a color icon and the name of the color.
SQL Server Data Mining Add-Ins for Office
11/28/2018 • 2 minutes to read • Edit Online
SQL Server 2012 (11.x) Data Mining Add-ins for Office is a lightweight set of tools for predictive analytics that lets
you use data in Excel to build analytical models for prediction, recommendation, or exploration.
IMPORTANT
The data mining add-in for Office is not supported in Office 2016 or later.
The wizards and data management tools in the add-ins provide step-by-step instruction for these common data
mining tasks:
Organize and clean your data prior to modeling. Use data stored in Excel or any Excel data source. You
can create and save connections to re-use data sources, repeat experiments, or re-train models.
Profile, sample, and prepare. Many experienced data miners say that as much as 70-90 percent of a data
mining project is spent on data preparation. The add-ins can make this task go faster, by providing
visualizations in Excel and wizards that help you with these common tasks:
Profile data and understand its distribution and characteristics.
Create training and testing sets through random sampling or oversampling.
Find outliers and remove or replace them.
Re-label data to improve the quality of analysis.
Analyze patterns through supervised or unsupervised learning. Click through friendly wizards to
perform some of the most popular data mining tasks, including clustering analysis, market basket analysis,
and forecasting.
Among the well-known machine learning algorithms included in the add-ins are Naïve Bayes, logistic
regression, clustering, time series, and neural networks.
If you are new to data mining, get help building prediction queries from the Query wizard.
Advanced users can build custom DMX queries with the drag-and-drop Advanced Query Editor, or
automate predictions using Excel VBA.
Document and manage. After you've created a data set and built some models, document your work and
your insights by generating a statistical summary of the data and model parameters.
Explore and visualize. Data mining is not an activity that can be fully automated - you need to explore and
understand your results to take meaningful action. The add-ins help you with exploration by providing
interactive viewers in Excel, Visio templates that let you customize model diagrams, and the ability to export
charts and tables to Excel for additional filtering or modification.
Deploy and integrate. When you've created a useful model, put your model into production, by using the
management tools to export the model from your experimental server to another instance of Analysis
Services.
You can also leave the model on the server where you created it, but refresh the training data and run
predictions using Integration Services or DMX scripts.
Power users will appreciate the Trace functionality, that lets you see the XMLA and DMX statements sent to
the server.
Getting Started
For more information, see What's Included in the Data Mining Add-Ins for Office
WARNING
Be sure to download the version of the add-ins that matches your version of Excel.
The Data Mining Add-ins requires a connection to one of the following editions of SQL Server Analysis Services:
Enterprise
Business Intelligence
Standard
Depending on the edition of SQL Server Analysis Services that you connect to, some of the advanced algorithms
might not be available. For information, see Features Supported by the Editions of SQL Server 2016.
For additional help with installation, see this page on the Download Center:
http://www.microsoft.com/download/details.aspx?id=29061
Data Mining Stored Procedures (Analysis Services -
Data Mining)
5/16/2018 • 2 minutes to read • Edit Online
NOTE
When you query mining models, especially when you test new data mining solutions, you might find it convenient to call
the system stored procedures that are used internally by the data mining engine. You can view the names of these system
stored procedures by using SQL Server Profiler to create a trace on the Analysis Services server, and then creating, browsing,
and querying the data mining models. However, Microsoft does not guarantee the compatibility of system stored
procedures between versions, and you should never use calls to the system stored procedures in a production system.
Instead, for compatibility, you should create your own queries by using DMX or XML/A.
In This Section
SystemGetCrossValidationResults (Analysis Services - Data Mining)
SystemGetClusterCrossValidationResults (Analysis Services - Data Mining)
SystemGetAccuracyResults (Analysis Services - Data Mining)
SystemGetClusterAccuracyResults (Analysis Services - Data Mining)
See Also
Cross-Validation (Analysis Services - Data Mining)
Cross-Validation Tab (Mining Accuracy Chart View )
Calling a Stored Procedure
SystemGetCrossValidationResults (Analysis Services -
Data Mining)
5/16/2018 • 6 minutes to read • Edit Online
NOTE
This stored procedure cannot be used to cross-validate clustering models, or models that are built by using the Microsoft
Time Series algorithm or the Microsoft Sequence Clustering algorithm. To cross-validate clustering models, you can use the
separate stored procedure, SystemGetClusterCrossValidationResults (Analysis Services - Data Mining).
Syntax
SystemGetCrossValidationResults(
<mining structure>
[, <mining model list>]
,<fold count>
,<max cases>
,<target attribute>
[,<target state>]
[,<target threshold>]
[,<test list>])
Arguments
mining structure
Name of a mining structure in the current database.
(required)
mining model list
Comma-separated list of mining models to validate.
If a model name contains any characters that are not valid in the name of an identifier, the name must be enclosed
in brackets.
If a list of mining models is not specified, cross-validation is performed against all models that are associated with
the specified structure and that contain a predictable attribute.
NOTE
To cross-validate clustering models, you must use a separate stored procedure, SystemGetClusterCrossValidationResults
(Analysis Services - Data Mining).
(optional)
fold count
Integer that specifies the number of partitions into which to separate the data set. The minimum value is 2. The
maximum number of folds is maximum integer or the number of cases, whichever is lower.
Each partition will contain roughly this number of cases: max cases/fold count.
There is no default value.
NOTE
The number of folds greatly affects the time that is required to perform cross-validation. If you select a number that is too
high, the query might run for a very long time, and in some cases the server can become unresponsive or time out.
(required)
max cases
Integer that specifies the maximum number of cases that can be tested across all folds.
A value of 0 indicates that all the cases in the data source will be used.
If you specify a value that is greater than the actual number of cases in the data set, all cases in the data source
will be used.
There is no default value.
(required)
target attribute
String that contains the name of the predictable attribute. A predictable attribute can be a column, nested table
column, or nested table key column of a mining model.
NOTE
The existence of the target attribute is validated only at run time.
(required)
target state
Formula that specifies the value to predict. If a target value is specified, metrics are collected for the specified
value only.
If a value is not specified or is null, the metrics are computed for the most probable state for each prediction.
The default is null.
An error is raised during validation if the specified value is not valid for the specified attribute, or if the formula is
not the correct type for the specified attribute.
(optional)
target threshold
Double greater than 0 and less than 1. Indicates the minimum probability score that must be obtained for the
prediction of the specified target state to be counted as correct.
A prediction that has a probability less than or equal to this value is considered incorrect.
If no value is specified or is null, the most probable state is used, regardless of its probability score.
The default is null.
NOTE
Analysis Services will not raise an error if you set state threshold to 0.0, but you should never use this value. In effect, a
threshold of 0.0 means that predictions with a 0 percent probability are counted as correct.
(optional)
test list
A string that specifies testing options.
Note This parameter is reserved for future use.
(optional)
Return Type
The rowset that is returned contains scores for each partition in each model.
The following table describes the columns in the rowset.
Measure The name of the measure returned by the test. Measures for
each model depend on the type of the predictable value. For
a definition of each measure, see Cross-Validation (Analysis
Services - Data Mining).
Remarks
To return accuracy metrics for the complete data set, use SystemGetAccuracyResults (Analysis Services - Data
Mining).
If the mining model has already been partitioned into folds, you can bypass processing and return only the results
of cross-validation by using SystemGetAccuracyResults (Analysis Services - Data Mining).
Examples
The following example demonstrates how to partition a mining structure for cross-validation into two folds, and
then test two mining models that are associated with the mining structure, [v Target Mail] .
Line three of the code lists the mining models that you want to test. If you do not specify the list, all non-
clustering models associated with the structure are used. Line four of the code specifies the number of partitions.
Because no value is specified for max cases, all cases in the mining structure are used and distributed evenly
across the partitions.
Line five specifies the predictable attribute, Bike Buyer, and line six specifies the value to predict, 1 (meaning "yes,
will buy").
The NULL value in line seven indicates that there is no minimum probability bar that must be met. Therefore, the
first prediction that has a non-zero probability will be used in assessing accuracy.
CALL SystemGetCrossValidationResults(
[v Target Mail],
[Target Mail DT], [Target Mail NB],
2,
'Bike Buyer',
1,
NULL
)
Sample results:
Requirements
Cross-validation is available only in SQL Server Enterprise beginning with SQL Server 2008.
See Also
SystemGetCrossValidationResults
SystemGetAccuracyResults (Analysis Services - Data Mining)
SystemGetClusterCrossValidationResults (Analysis Services - Data Mining)
SystemGetClusterAccuracyResults (Analysis Services - Data Mining)
SystemGetClusterCrossValidationResults (Analysis
Services - Data Mining)
5/16/2018 • 3 minutes to read • Edit Online
Syntax
SystemGetClusterCrossValidationResults(
<structure name>,
[,<mining model list>]
,<fold count>}
,<max cases>
<test list>])
Arguments
mining structure
Name of a mining structure in the current database.
(required)
mining model list
Comma-separated list of mining models to validate.
If a list of mining models is not specified, cross-validation is performed against all clustering models that are
associated with the specified structure.
NOTE
To cross-validate models that are not clustering models, you must use a separate stored procedure,
SystemGetCrossValidationResults (Analysis Services - Data Mining).
(optional)
fold count
Integer that specifies the number of partitions into which to separate the data set. The minimum value is 2. The
maximum number of folds is maximum integer or the number of cases, whichever is lower.
Each partition will contain roughly this number of cases: max cases/fold count.
There is no default value.
NOTE
The number of folds greatly affects the time required to perform cross-validation. If you select a number that is too high,
the query may run for a very long time, and in some cases the server may become unresponsive or time out.
(required)
max cases
Integer that specifies the maximum number of cases that can be tested.
A value of 0 indicates that all the cases in the data source will be used.
If you specify a number that is higher than the actual number of cases in the data set, all cases in the data source
will be used.
(required)
test list
A string that specifies testing options.
Note This parameter is reserved for future use.
(optional)
Return Type
The Return Type table contains scores for each individual partition and aggregates for all models.
The following table describes the columns returned.
Measure The name of the measure returned by the test. Measures for
each model depend on the type of the predictable value. For
a definition of each measure, see Cross-Validation (Analysis
Services - Data Mining).
Examples
The following example demonstrates how to partition a mining structure into three folds, and then test two
clustering models that are associated with the mining structure.
Line three of the code lists the specific mining models that you want to test. If you do not specify the list, all
clustering models associated with the structure are used.
Line four of the code specifies the number of folds, and line five specifies the maximum number of cases to use.
Because these are clustering models, you do not need to specify a predictable attribute or value.
CALL SystemGetClusterCrossValidationResults(
[v Target Mail],
[Cluster 1], [Cluster 2],
3,
10000
)
Sample results:
Requirements
Cross-validation is available only in SQL Server Enterprise beginning in SQL Server 2008.
See Also
SystemGetCrossValidationResults (Analysis Services - Data Mining)
SystemGetAccuracyResults (Analysis Services - Data Mining)
SystemGetClusterCrossValidationResults
SystemGetClusterAccuracyResults (Analysis Services - Data Mining)
SystemGetAccuracyResults (Analysis Services - Data
Mining)
5/16/2018 • 4 minutes to read • Edit Online
NOTE
This stored procedure is not supported for models that are built by using the Microsoft Time Series algorithm or the
Microsoft Sequence Clustering algorithm. Also, for clustering models, use the separate stored procedure,
SystemGetClusterAccuracyResults (Analysis Services - Data Mining).
Syntax
SystemGetAccuracyResults(<mining structure>,
[,<mining model list>]
,<data set>
,<target attribute>
[,<target state>]
[,<target threshold>]
[,<test list>])
Arguments
mining structure
Name of a mining structure in the current database.
(Required)
model list
Comma-separated list of models to validate.
The default is null. This means that all applicable models are used. When the default is used, clustering models
are automatically excluded from the list of candidates for processing.
(Optional)
data set
A integer value that indicates which partition in the mining structure is used for testing. The value is derived from
a bitmask that represents the sum of the following values, where any single value is optional:
Training cases 0x0001
For a complete list of possible values, see the Remarks section of this topic.
(required)
target attribute
String that contains the name of a predictable object. A predictable object can be a column, nested table column,
or nested table key column of a mining model.
(required)
target state
String that contains a specific value to predict.
If a value is specified, the metrics are collected for that specific state.
If no value is specified, or if null is specified, the metrics are computed for the most probable state for each
prediction.
The default is null.
(optional)
target threshold
Number between 0.0 and 1 that specifies the minimum probability in which the prediction value is counted as
correct.
The default is null, which means that all predictions are counted as correct.
(optional)
test list
A string that specifies testing options. This parameter is reserved for future use.
(optional)
Return Type
The rowset that is returned contains scores for each partition and aggregates for all models.
The following table lists the columns returned by GetValidationResults.
Model The name of the model that was tested. All indicates that the
result is an aggregate for all models.
PartitionCases An integer that indicates the number of rows in the case set,
based on the <data set> parameter.
Measure The name of the measure returned by the test. Measures for
each model depend on the model type, and the type of the
predictable value.
Remarks
The following table provides examples of the values that you can use to specify the data in the mining structure
that is used for cross-validation. If you want to use test cases for cross-validation, the mining structure must
already contain a testing data set. For information about how to define a testing data set when you create a
mining structure, see Training and Testing Data Sets.
4 Invalid combination.
5 Only training cases are used, and the model filter is applied.
6 Only test cases are used, and the model filter is applied.
7 Both the training and testing cases are used, and the model
filter is applied.
For more information about the scenarios in which you would use cross-validation, see Testing and Validation
(Data Mining).
Examples
This example returns accuracy measures for a single decision tree model, v Target Mail DT , that is associated
with the vTargetMail mining structure. The code on line four indicates that the results should be based on the
testing cases, filtered for each model by the filter specific to that model. [Bike Buyer] specifies the column that is
to be predicted, and the 1 on the following line indicates that the model is to be evaluated only for the specific
value 1, meaning "Yes, will buy".
The final line of the code specifies that the state threshold value is 0.5. This means that predictions that have a
probability greater than 50 percent should be counted as "good" predictions when calculating accuracy.
CALL SystemGetAccuracyResults (
[vTargetMail],
[vTargetMail DT],
6,
'Bike Buyer',
1,
0.5
)
Sample Results:
Requirements
Cross-validation is available only in SQL Server Enterprise beginning with SQL Server 2008.
See Also
SystemGetCrossValidationResults (Analysis Services - Data Mining)
SystemGetAccuracyResults
SystemGetClusterCrossValidationResults (Analysis Services - Data Mining)
SystemGetClusterAccuracyResults (Analysis Services - Data Mining)
SystemGetClusterAccuracyResults (Analysis Services
- Data Mining)
5/16/2018 • 3 minutes to read • Edit Online
NOTE
This stored procedure works only for clustering models. For non-clustering models, use SystemGetAccuracyResults
(Analysis Services - Data Mining).
Syntax
SystemGetClusterAccuracyResults(
<mining structure>
[,<mining model list>]
,<data set>
,<test list>])
Arguments
mining structure
Name of a mining structure in the current database.
(Required)
mining model list
Comma-separated list of models to validate.
The default is null, meaning that all applicable models are used. When the default is used, non-clustering models
are automatically excluded from the list of candidates for processing.
(Optional)
data set
An integer value that indicates which partition in the mining structure is to be used for testing. The value is
derived from a bitmask that represents the sum of the following values, where any single value is optional:
For a complete list of possible values, see the Remarks section of this topic.
(Required)
test list
A string that specifies testing options. This parameter is reserved for future use.
(optional)
Return Type
A table that contains scores for each individual partition and aggregates for all models.
The following table lists the columns returned by SystemGetClusterAccuracyResults. To learn more about
how to interpret the information returned by the stored procedure, see Measures in the Cross-Validation Report.
ModelName The name of the model that was tested. All indicates that the
result is an aggregate for all models.
PartitionCases An integer that indicates how many cases have been tested.
Measure The name of the measure returned by the test. Measures for
each model depend on the model type, and the type of the
predictable value.
Remarks
The following table provides examples of the values that you can use to specify the data in the mining structure
that is used for cross-validation. If you want to use test cases for cross-validation, the mining structure must
already contain a testing data set. For information about how to define a testing data set when you create a
mining structure, see Training and Testing Data Sets.
INTEGER VALUE DESCRIPTION
4 Invalid combination.
5 Only training cases are used, and the model filter is applied.
6 Only test cases are used, and the model filter is applied.
7 Both the training and testing cases are used, and the model
filter is applied.
For more information about the scenarios in which you would use cross-validation, see Testing and Validation
(Data Mining).
Examples
This example returns accuracy measures for two clustering models, named Cluster 1 and Cluster 2 , that are
associated with the vTargetMail mining structure. The code on line four indicates that the results should be based
on the testing cases alone, without using any filters that might be associated with each model.
CALL SystemGetClusterAccuracyResults (
[vTargetMail],
[Cluster 1], [Cluster 2],
2
)
Sample Results:
Requirements
Cross-validation is available only in SQL Server Enterprise beginning in SQL Server 2008.
See Also
SystemGetCrossValidationResults (Analysis Services - Data Mining)
SystemGetAccuracyResults (Analysis Services - Data Mining)
SystemGetClusterCrossValidationResults (Analysis Services - Data Mining)
SystemClusterGetAccuracyResults
Power Pivot for SharePoint (SSAS)
8/13/2018 • 2 minutes to read • Edit Online
In This Section
Power Pivot Server Administration and Configuration in Central Administration
Power Pivot Configuration using Windows PowerShell
Power Pivot Configuration Tools
Power Pivot Authentication and Authorization
Configure Power Pivot Health Rules
Power Pivot Management Dashboard and Usage Data
Power Pivot Gallery
Power Pivot Data Access
Power Pivot Data Refresh
Power Pivot Data Feeds
Power Pivot BI Semantic Model Connection (.bism)
In other sections
Additional topics
Upgrade Power Pivot for SharePoint
Install Analysis Services in Power Pivot Mode
PowerShell Reference for Power Pivot for SharePoint
Example License Topologies and Costs for SQL Server 2016 Business Intelligence
See Also
Power Pivot Planning and Deployment
Disaster Recovery for Power Pivot for SharePoint
Power Pivot Server Administration and
Configuration in Central Administration
7/11/2018 • 3 minutes to read • Edit Online
IMPORTANT
For SharePoint 2010, SharePoint 2010 Service Pack 1 (SP1) must be installed before you can configure either Power Pivot
for SharePoint, or a SharePoint farm that uses a SQL Server 2012 (11.x) database server. If you have not yet installed the
service pack, do so now before you begin configuring the server.
Related Content
Power Pivot Configuration using Windows PowerShell
Power Pivot Configuration Tools
Related Tasks
LINK TYPE TASK DESCRIPTION
Deploy Power Pivot Solutions to Required This step installs the solution files that
SharePoint add program files and application
pages to the farm and to site
collections.
Create and Configure a Power Pivot Required This step provisions the Power Pivot
Service Application in Central System Service.
Administration
Activate Power Pivot Feature Required This step turns on Power Pivot features
Integration for Site Collections in at the site collection level.
Central Administration
Add MSOLAP.5 as a Trusted Data Required This step adds the Analysis Services
Provider in Excel Services OLE DB provider as a trusted provider
in Excel Services.
Power Pivot Data Refresh with Recommended Data refresh is optional but
SharePoint 2010 recommended. It allows you to
schedule unattended updates to the
Power Pivot data in published Excel
workbooks.
Configure the Power Pivot Unattended Recommended This step provisions a special-purpose
Data Refresh Account (Power Pivot for account that can be used to run data
SharePoint) refresh jobs on the server.
Configure Usage Data Collection for Optional Usage data collection is configured by
(Power Pivot for SharePoint default. You can use these steps to
modify the default settings.
Create a trusted location for Power Optional Explains how to add the Power Pivot
Pivot sites in Central Administration Gallery as a trusted location.
Configure and View SharePoint Log Optional Event logging is configured by default.
Files and Diagnostic Logging (Power You can use these steps to modify the
Pivot for SharePoint) default settings.
Configure Power Pivot Health Rules Optional Server health rules are configured by
default. You can use these steps to
modify some of the default settings.
LINK TYPE TASK DESCRIPTION
Create and Customize Power Pivot Optional For installations that you are
Gallery configuring manually, this procedure
explains how to create a Power Pivot
Gallery library that shows image
thumbnails of the Power Pivot
workbooks it contains.
See Also
Power Pivot for SharePoint 2010 Installation
Configuration Setting Reference (Power Pivot for SharePoint)
Disaster Recovery for Power Pivot for SharePoint
Deploy Power Pivot Solutions to SharePoint
11/28/2018 • 5 minutes to read • Edit Online
The return value should be false. If it is true, you cannot access Power Pivot data with this web application.
The cmdlet returns the name of the solution, its solution ID, and Deployed=False. In the next step, you will
deploy the solution.
3. Run the next cmdlet to deploy the farm solution:
The cmdlet returns the name of the solution, its solution ID, and Deployed=False. In the next step, you will
deploy the solution.
4. Run the next cmdlet to install the web application solution to Central Administration.
Now that the web application solution is deployed to Central Administration, you can use Central Administration
to complete all remaining configuration steps.
SOLUTION DESCRIPTION
SOLUTION DESCRIPTION
Adds library templates for Power Pivot Gallery and Data Feed
libraries.
See Also
Upgrade Power Pivot for SharePoint
Power Pivot Server Administration and Configuration in Central Administration
Power Pivot Configuration using Windows PowerShell
Create and Configure Power Pivot Service
Application in CA
7/11/2018 • 11 minutes to read • Edit Online
See Also
Power Pivot Server Administration and Configuration in Central Administration
Connect Power Pivot Service App to SharePoint Web
App in CA
10/25/2018 • 2 minutes to read • Edit Online
IMPORTANT
You must have one Power Pivot service application in the default group to ensure that Power Pivot Management Dashboard
works properly. Do not add more than one Power Pivot service application to the default group. Adding multiple entries of
the same service application type is not a supported configuration and might cause errors. If you are creating additional
service applications, add them to custom lists.
See Also
Create and Configure a Power Pivot Service Application in Central Administration
Initial Configuration (Power Pivot for SharePoint)
Activate Power Pivot Integration for Site Collections
in CA
10/25/2018 • 2 minutes to read • Edit Online
Prerequisites
You must be a site collection administrator.
See Also
Power Pivot Server Administration and Configuration in Central Administration
Initial Configuration (Power Pivot for SharePoint)
Power Pivot for SharePoint 2010 Installation
Add MSOLAP.5 as a Trusted Data Provider in Excel
Services
7/11/2018 • 2 minutes to read • Edit Online
Prerequisites
You must be a farm or service administrator to designate a URL as a trusted location.
You must know the URL address of the SharePoint site that contains the Power Pivot Gallery or other library that
stores your workbooks. To get the address, open the site that contains the library, right-click Power Pivot
Gallery, select Properties, and then copy the first part of the Address (URL ) that contains the server name and
site path.
Overview
An initial installation of Excel Services specifies 'http://' as its trusted location, which means that workbooks from
any site in the farm can be opened on the server. If you require tighter control over which locations are
considered trustworthy, you can create new trusted locations that map to specific sites in your farm, and then
vary the settings and permissions for each one.
Creating a new trusted location for sites that host Power Pivot workbooks is especially useful if you want to
preserve default values for the rest of the farm, while applying different settings that work best for Power Pivot
data access. For example, a trusted location that is optimized for Power Pivot workbooks could have a maximum
workbook size of 50 MB, while the rest of the farm uses the default value of 10MB.
Creating a trusted location is recommended if you are using Power Pivot Gallery libraries to preview published
workbooks and you encounter data refresh warnings instead of the preview image you expect. Power Pivot
Gallery renders thumbnail images of reports and workbooks using data and presentation information within the
document. If Warn on Data Refresh is enabled for a trusted location, Power Pivot Gallery might not have
sufficient permissions to perform the refresh, causing an error to appear instead of the thumbnail image. Adding
a site that contains Power Pivot Gallery as a new trusted location can eliminate this problem.
IMPORTANT
UNC and HTTP location types are not supported for Power Pivot data access.
7. Accept all of the default settings for properties in Session Management, Workbook Properties, and
Calculation Behavior.
8. In Workbook Properties, set Maximum Workbook Size to 50. This aligns the upper limit for workbook
file size to the upper limit for file uploads to the parent web application. If your workbooks are larger than
50 megabytes, you must further increase the file size limit. For more information, see Configure Maximum
File Upload Size (Power Pivot for SharePoint).
9. In External Data, verify that Allow External Data is set to Trusted data connection libraries and
embedded. This setting is required for Power Pivot data access in a workbook.
10. Also in External Data, for Warn on Refresh, clear the checkbox for Refresh warning enabled. Clearing the
checkbox allows Power Pivot Gallery to bypass routine warning messages and show preview images of a
workbook instead.
11. Click OK.
See Also
Power Pivot Gallery
Create and Customize Power Pivot Gallery
Use Power Pivot Gallery
Configure Power Pivot Service Accounts
11/28/2018 • 9 minutes to read • Edit Online
REQUIREMENT DESCRIPTION
Provisioning requirement This account must be specified during SQL Server Setup using
the Analysis Services - Configuration page in the
installation wizard (or the ASSVCACCOUNT installation
parameter in a command line setup).
Domain user account requirement This account must be a Windows domain user account. Built-
in machine accounts (such as Network Service or Local
Service) are prohibited. SQL Server Setup enforces the domain
user account requirement by blocking installation whenever a
machine account is specified.
Scale-out requirements If you install multiple Power Pivot for SharePoint server
instances in a farm, all of the Analysis Services server
instances must run under the same domain user account. For
example, if you configure the first Analysis Services service
instance to run as Contoso\ssas-srv01, then all additional
Analysis Services service instances that you deploy thereafter
in the same farm must also run as Contoso\ssas-srv01 (or
whatever the current account happens to be).
Provisioning requirement Power Pivot System Service is a shared resource on the farm
that becomes available when you create a service application.
The service application pool must be specified when the
service application is created. It can be specified two ways:
using the Power Pivot Configuration Tool, or through
PowerShell commands.
Domain user account requirement The application pool identity must be a Windows domain user
account. Built-in machine accounts (such as Network Service
or Local Service) are prohibited.
Permission requirements This account does not need local system Administrator
permissions on the computer. However, this account must
have Analysis Services system administrator permissions on
the local Analysis Services service that is installed on the same
computer. These permissions are granted automatically by
SQL Server Setup or when you set or change the application
pool identity in Central Administration.
See Also
Start or Stop a Power Pivot for SharePoint Server
Configure the Power Pivot Unattended Data Refresh Account (Power Pivot for SharePoint)
Configure and View SharePoint and Diagnostic
Logging
11/27/2018 • 5 minutes to read • Edit Online
The LOGS folder contains log files ( .log ), data files ( .txt ), and usage files ( .usage ). The file naming convention
for a SharePoint trace log is the server name followed by a date and time stamp. SharePoint trace logs are created
at regular intervals and whenever there is an IISRESET. It is common to have many trace logs within a 24 hour
period.
w3wp.exe Power Pivot Web front end Verbose Starting to locate When it receives
Service an application a connection
server for data request, the
source=<path> Power Pivot
service identifies
an available
Analysis Services
service to handle
the request. If
there is only one
server in the
farm, the local
server accepts
the request in all
cases.
w3wp.exe Power Pivot Web front end Verbose Locating the The request was
Service application server allocated to a
succeeded. Power Pivot
service
application.
w3wp.exe Power Pivot Web front end Verbose Redirecting The request was
Service request for the forwarded to the
<PowerPivotdat Analysis Services
a source> to the service.
Analysis Services
service.
PROCESS AREA CATEGORY LEVEL MESSAGE DETAILS
See Also
Power Pivot Usage Data Collection
View and Read SQL Server Setup Log Files
Configure Usage Data Collection for (Power Pivot for SharePoint
Configure Disk Space Usage (Power Pivot for
SharePoint)
11/27/2018 • 7 minutes to read • Edit Online
To check how much total disk space is used by the cache, you have to check the size of the Backup folder. There is
no property in Central Administration that reports on current cache size.
The Backup folder provides common cache storage for any Power Pivot database that is loaded in memory on the
local computer. If you have multiple Power Pivot service applications defined in your farm, any one of them can
use the local server to load and subsequently cache Power Pivot data. Both data loading and caching are Analysis
Services server operations. As such, total disk space usage is managed at the Analysis Services instance level, on
the Backup folder. Configuration settings that limit disk space usage are therefore set on the single SQL Server
Analysis Services instance that runs on a SharePoint application server.
The cache contains only Power Pivot databases. Power Pivot databases are stored in multiple files under a single
parent folder (the Backup folder). Because Power Pivot databases are meant to be used as internal data to an Excel
workbook, database names are GUID based rather than descriptive. A GUID folder under
<serviceApplicationName> is the parent folder of a Power Pivot database. As Power Pivot databases are
loaded on the server, additional folders are created for each one.
Because Power Pivot data might be loaded on any Analysis Services instance in a farm, the same data might also
be cached on multiple computers in the farm. This practice favors performance over disk space utilization, but the
tradeoff is that users get faster access to data if it is already available on disk.
To immediately reduce disk space consumption, you can shut down the service and then delete a Power Pivot
database from the Backup folder. Manually deleting files is a temporary measure, as a newer copy of the database
will be cached again the next time the Power Pivot data is queried. Permanent solutions include limiting disk space
used by the cache.
At the system level, you can create email alerts that notify you when disk space is low. Microsoft System Center
includes an email alert feature. You can also use File Server Resource Manager, Task Scheduler, or PowerShell
script to set up alerts. The following links provide useful information for setting up notifications about low disk
space:
What's New in File Server Resource Manager (http://technet.microsoft.com/library/hh831746.aspx).
File Server Resource Manager Step-by-Step Guide for Windows Server 2008 R2
(http://go.microsoft.com/fwlink/?LinkID=204875).
Setting low disk space alerts on Windows Server 2008 ( http://go.microsoft.com/fwlink/?LinkID=204870).
How to limit the amount of disk space used for storing cached files
1. In Central Administration, in Application Management, click Manage Services on Server.
2. Click SQL Server Analysis Services.
Notice that limits are set on the Analysis Services instance that runs on the physical server, and not at the
service application level. All service applications that use the local Analysis Services instance are subject to
the single maximum disk space limit that is set for that instance.
3. In Disk Usage, set a value (in gigabytes) for Total disk space to set an upper limit on the amount of space
used for caching purposes. The default is 0, which allows Analysis Services to use all available disk space.
4. In Disk Usage, in the Delete cached databases in last 'n' hours setting, specify last-used criteria for
emptying the cache when disk space is at the maximum limit.
The default is 4 hours, meaning that all databases that have been inactive for 4 hours or more are deleted
from the file system. Databases that are inactive but still in memory are unloaded and then deleted from the
file system.
Next Steps
A Power Pivot for SharePoint installation provides health rules so that you can take corrective action when
problems are detected in server health, configuration, or availability. Some of these rules use configuration
settings to determine the conditions under which health rules are triggered. If you are actively tuning server
performance, you might also want to review these settings to ensure the defaults are the best choice for your
system. For more information, see Configure Power Pivot Health Rules.
See Also
Power Pivot Server Administration and Configuration in Central Administration
Configure Maximum File Upload Size (Power Pivot
for SharePoint)
5/16/2018 • 2 minutes to read • Edit Online
NOTE
Perform the following steps only if you increased the Maximum Workbook Size in Excel Services.
Data Load Timeout 1800 (in seconds) 1 to 3600 Specifies the amount of time
a Power Pivot service
application will wait for a
response from a specific
Analysis Services server
instance.
Connection Pools
The Power Pivot service application creates and manages connection pools to enable connection reuse. There are
two types of connection pools: one for data connections to read-only data, and a second for server connections.
Data connection pools contain cached connections for Power Pivot data source. Each connection pool is based on
the context that was set when the database was loaded. This context includes the identity of the physical service
instance, the database ID, and the identity of the SharePoint user who is requesting data. A separate connection
pool is created for each combination. For example, requests from different users of the same database running on
the same server will consume connections from different pools.
The purpose of a connection pool is to use cached connections for read-only requests for the same Analysis
Services database by the same SharePoint user. The Power Pivot service instance is the server that has the data
loaded in memory. The database ID is an internal identifier for the in-memory data structures of the data model (a
model is instantiated as an Analysis Services cube database). Version information is implicitly incorporated in the
identifier.
Server connection pools contain cached connections from a Power Pivot service application instance to an
Analysis Services server instance, where the service application is connecting with Analysis Services Sysadmin
permissions on the Analysis Services server. These connections are used to issue a load database request and
monitor system health.
Each type of connection pool has upper limits that you can set to ensure best use of system memory for
connection management.
Connection Pool Timeout 1800 (in seconds) 1 to 3600. This setting applies to data
connection pools.
Maximum User Connection 1000 -1, 0, or 1 to 10000. This setting applies to the
Pool Size number of idle connections
-1 specifies an unlimited in all data connection pools
number of idle connections. created for a specific Power
Pivot service application
0 means no idle connections instance.
are kept. New connections
to a Power Pivot data source Individual connection pools
must be created each time. are created for unique
combinations of a
SharePoint user, Power Pivot
data, and service instance. If
you have many users
accessing a variety of Power
Pivot data sources, server
performance might benefit
from an increase in
connection pool size.
Load Balancing
One of the functions that the Power Pivot service performs is to determine where Analysis Services data will be
loaded among the available Power Pivot service instances. The AllocationMethod setting specifies the criteria
against which a service instance is selected.
NAME DEFAULT VALID VALUES DESCRIPTION
Data Refresh
Specify the range of hours that defines a normal or typical business day for your organization. These configuration
settings determine when after-hours data processing occurs for data refresh operations. After-hours processing
can begin at the end time of the business day. After-hours processing is a schedule option for document owners
who want to refresh a Power Pivot data source with transactional data that was generated during normal business
hours.
Start time 04:00 a.m. 1 to 12 hours, where the Sets the lower limit of a
value is a valid integer within business hour range.
that range.
Type is Time.
End time 08:00 p.m. 1 to 12 hours, where the Sets the upper limit of a
value is a valid integer within business hour range.
that range.
Type is Time.
NAME DEFAULT VALID VALUES DESCRIPTION
Power Pivot Unattended None A target application ID This account is used to run
Data Refresh Account data refresh jobs on behalf
of a schedule owner.
Query Reporting Interval 300 (in seconds) 1 to n seconds, where n is To ensure that usage data
any valid integer. collection does not consume
too much of the data
transfer capacity of the farm,
query statistics are collected
on each connection and
reported as a single event.
The Query Reporting
Interval determines how
often an event is reported.
By default, query statistics
are reported every 5
minutes.
Trivial Response Upper Limit 500 (in milliseconds) 1 to n milliseconds, where n By default, the threshold for
is any valid integer. trivial requests is half a
second.
Quick Response Upper Limit 1000 (in milliseconds) 1 to n milliseconds, where n By default, the threshold for
is any valid integer. quick requests is one
second.
Expected Response Upper 3000 (in milliseconds) 1 to n milliseconds, where n By default, the threshold for
Limit is any valid integer. expected requests is three
seconds.
Long Response Upper Limit 10000 (in milliseconds) 1 to n milliseconds, where n By default, the threshold for
is any valid integer. long requests is ten seconds.
See Also
Create and Configure a Power Pivot Service Application in Central Administration
Power Pivot Data Refresh with SharePoint 2010
Configure Usage Data Collection for (Power Pivot for SharePoint
Configure Power Pivot Service Accounts
Power Pivot Management Dashboard and Usage Data
Start or Stop a Power Pivot for SharePoint Server
5/16/2018 • 3 minutes to read • Edit Online
Service Dependencies
The Power Pivot System Service has a dependency on the local Analysis Services server instance that is installed
with it on the same physical server. If you stop the Power Pivot System Service, you must also manually stop the
local Analysis Services server instance. If one service is running without the other, you will encounter request
allocation errors for Power Pivot data processing.
The Analysis Services server should only be run by itself if you are diagnosing or troubleshooting a problem. In all
other cases, the server requires the Power Pivot System Service that runs locally on the same server.
EFFECT ON DESCRIPTION
Existing queries Queries that are in progress on an Analysis Services server will
stop immediately. The user will get a data not found or data
source connection not found error.
Existing data refresh jobs that are currently processing Jobs that are in progress on the current Analysis Services
server will stop immediately. Data refresh will fail and an error
will be logged to data refresh history.
You can view the status of current jobs before you stop the
service by using the Check job status page in SharePoint
Central Administration.
Existing data refresh requests in the queue Scheduled data refresh requests will remain in the processing
queue for a complete cycle of the schedule (that is, it stays in
the queue until the next start time). If the Power Pivot System
Service is not restarted by then, the data refresh request will
be dropped and an error will be logged.
New requests for queries or data refresh If you are stopping the only Power Pivot for SharePoint server
in the farm, new requests for Power Pivot data will not be
handled and a request for data will result in a data not found
error.
Usage data Usage data will not be collected while the services are
stopped.
See Also
Configure Power Pivot Service Accounts
Power Pivot Configuration using Windows
PowerShell
11/28/2018 • 2 minutes to read • Edit Online
IMPORTANT
For a SharePoint 2010 farm, SharePoint 2010 SP1 must be installed before you can configure either Power Pivot for
SharePoint, or a SharePoint farm that uses a SQL Server 2012 (11.x) database server. If you have not yet installed the
service pack, install it before you begin configuring the server.
Get-help *powerpivot*
You should see a list of cmdlets that include Power Pivot in the cmdlet name. For example
Get-PowerPivotServiceApplication . The number of cmdlets available depends on the version of Analysis
Services you are using.
10 cmdlets with SQL Server 2012 SP1 Analysis Services server configured in SharePoint mode, and
SharePoint 2013. The 2012 SP1 version utilizes a new architecture that allows the Analysis Server
to run outside the SharePoint farm and requires fewer management Windows PowerShell cmdlets.
17 cmdlets with SQL Server 2012 Analysis Services server configured in SharePoint mode, and
SharePoint 2010.
If no commands are returned in the list or you see an error message similar to "
get-help could not find *powerpivot* in a help file in this session. ", see the next section in this topic
for instructions on how to enable the Power Pivot cmdlets on the server.
All cmdlets have online help. The following example shows how to view the online help for the New-
PowerPivotServiceApplication cmdlet:
The cmdlet returns the name of the solution, its solution ID, and Deployed=False. In the next step, you
deploy the solution.
3. Run the second cmdlet to deploy the solution:
4. Close the window. Reopen it, again using the Run as Administrator option.
Related Content
Power Pivot Server Administration and Configuration in Central Administration
Power Pivot Configuration Tools
PowerShell Reference for Power Pivot for SharePoint
Power Pivot Configuration Tools
12/10/2018 • 6 minutes to read • Edit Online
Power Pivot for SharePoint 2013 SharePoint 2013 Configure or Repair Power Pivot for
Configuration SharePoint 2013 (Power Pivot
Configuration Tool)
NAME SUPPORTED VERSION OF SHAREPOINT DETAILED CONFIGURATION
Power Pivot Configuration Tool SharePoint 2010 with SharePoint 2010 Configure or Repair Power Pivot for
SharePoint 2010 (Power Pivot
Configuration Tool)
POWER PIVOT FOR SHAREPOINT 2013 CONFIGURATION POWER PIVOT CONFIGURATION TOOL
The main page has a new option for Power Pivot Server
for Excel Services. The option supports the new
architecture with Analysis Services running outside of the
SharePoint farm. You configure Excel Services to use one or
more Analysis Services servers that are running in
SharePoint mode.
The 2013 tool has a new page Register Power Pivot addin
as Excel Services Usage Tracker. SharePoint 2010 Excel
Services does not track usage data for Power Pivot.
NOTE
The tool does not configure Reporting Services. If you are adding Reporting Services to your SharePoint environment, you
need to install and configure Reporting Services separately. For more information, see the following:
Install The First Report Server in SharePoint Mode.
Install Reporting Services SharePoint Mode for SharePoint 2010.
Each task is composed of individual actions that address some aspect of server configuration. For example, the
configuration task includes actions for deploying solutions, creating a Power Pivot service application, activating
features, and configuring data refresh. The list of actions will vary based on the current state of your installation.
If an action is not needed, the tool excludes it from the task list.
When you click Run , the tool processes all actions in batch mode. Although each action appears as a separate
item in the task list, all actions that are included in the task process together. Only actions that pass a validation
check are processed. You might need to add or change some of the input values to pass the validation check.
Related Content
Upgrade Power Pivot for SharePoint Describes the workflow that upgrades an existing installation that is
already in a farm.
Uninstall Power Pivot for SharePoint Describes the workflow that removes Power Pivot for SharePoint services,
solutions, and application pages from a farm.
Power Pivot Configuration using Windows PowerShell
Power Pivot Server Administration and Configuration in Central Administration
Configure or Repair Power Pivot for SharePoint 2013
12/10/2018 • 15 minutes to read • Edit Online
TIP
If the configuration tool scans the computer and returns a blank task list in the left pane, then no features or settings were
detected that need configuration. To modify the SharePoint or Power Pivot configuration, use Windows PowerShell or the
management pages in SharePoint Central Administration. For more information, see Power Pivot Server Administration and
Configuration in Central Administration.
Values for service accounts are used for multiple services. For example, the configuration tool uses the default
account on the first page to set all application pool identities. You can change these accounts later by modifying the
service application properties in Central Administration.
The tool provides a tabbed interface that includes parameter inputs, Windows PowerShell script, and status
messages.
The tool uses Windows PowerShell to configure the server. You can click the Script tab to review the Windows
PowerShell script that the tool uses to configure the server.
DESCRIPTION
(7) The Run button is enabled after you validate the actions.
Configuration steps
The link to the configuration tool is only visible when Power Pivot for SharePoint 2013 is installed on the local
server.
1. On the Start menu, point to All Programs, click Microsoft SQL Server 2017, click Configuration Tools,
and then click Power Pivot for SharePoint 2013 Configuration.
2. Click Configure or Repair Power Pivot for SharePoint.
3. Expand the window to full size. You should see a button bar at the bottom of the window that includes
Validate, Run, and Exit commands.
4. Default Account: On the Parameters tab, type a domain user account for the Default Account
Username. This account is used to provision essential services, including the Power Pivot service
application pool. Do not specify a built-in account such as Network Service or Local System. The tool blocks
configurations that specify built-in accounts.
Passphrase: type a passphrase. If the SharePoint farm is new, the passphrase is used whenever new servers
or applications are added to the SharePoint farm. If the farm exists, enter the passphrase that allows you to
add a server application to the farm.
5. Port: Optionally, type a port number to connect to the Central Administration web application or use the
provided randomly generated number. The configuration tool checks that the number is available before
offering it as an option.
6. On the main page, type the name of a SQL Server 2017Power Pivot Server running in SharePoint mode.
7. Optionally, review the remaining input values used to complete each action. For more information about
each one, see Input values used to configure the server in this topic.
8. Optionally, remove any actions that you do not want to process. For example, if you want to configure
Secure Store Service later, click Configure Secure Store Service, and then clear the checkbox Include
this action in the task list.
9. Click Validate to check whether the tool has sufficient information to process the actions in the list.
10. Click Run to process all of the actions in the task list. The Run button becomes available after you validate
the actions. If Run is not enabled, click Validate first.
If you see an error message similar to the following, verify that the SQL Server database instance is started.
-
Power Pivot service
application
-Excel Services
Note: It is recommended
you replace the default value
unless you are configuring a
server for evaluation and
non-production purposes.
-
Power Pivot unattended
data refresh account, using
the Create Unattended
Account for Data Refresh
page in this tool.
Database Server is a
required parameter. It can be
any version or edition of
SQL Server that is supported
for SharePoint farms.
Power Pivot for Excel User input The Power Pivot server is
Services ([ServerName]\ required for Excel Services to
Power Pivot) Enable the core Power Pivot
capabilities. The server name
you type on this page is also
added to the list on the
Configure Power Pivot
Servers page.
Configure New Farm Database Server Default, if needed The settings default to what
you entered on the main
Farm Account page.
PassPhrase
SharePoint Central
Administration port
PAGE INPUT VALUE SOURCE DESCRIPTION
Create Power Pivot Service Application Name Default Power Pivot Service
Service Application Application Name The
default name is Default
Power Pivot Service
Application. You can
substitute a different value
in the tool.
Create Default Web Web Application Name Default, if needed If no web applications exist,
Application the tool creates one. The
web application is configured
for classic mode
authentication, and listens
on port 80. The maximum
file upload size is set to
2047, the maximum allowed
by SharePoint. The larger file
upload size is to
accommodate the large
Power Pivot files that will be
uploaded to the server.
Deploy Web Application URL Default, if needed The Default URL is from the
Solution default web application.
Maximum File Size (in MB) Default, if needed Default setting is 2047.
SharePoint document
libraries also have a
maximum size and the
Power Pivot setting should
not exceed the document
library setting. For more
information, see Configure
Maximum File Upload Size
(Power Pivot for SharePoint).
Create Site Collection Site Administrator Default, if needed The tool uses the default
account. You can override it
in the Create Site
Collection page.
Activate Power Pivot Site URL URL of the site collection for
Feature in a Site which you are activating
Collection Power Pivot features.
Create Secure Store Service Application Name Default, if needed Type the name for the
Service Application Secure Store service
application.
Create Secure Store Service Application Name Default, if needed Type the name for the
Service Application Proxy Secure Store service
application you typed in the
previous page.
Service Application Proxy Default, if needed Type the name for the
Secure Store service
application proxy. The name
will appear in the default
connection group that
associates applications with
SharePoint content web
applications.
Update Secure Store Service Application Proxy Default, if needed Type the name of the Secure
Service Master Key Store service application
proxy you typed in the
previous page.
Site URL Default, if needed Type the site URL of the site
collection associated wit the
target application. To
associate with additional site
collections, use SharePoint
Central administration.
Create Excel Services Service Application Name Default, if needed Type a service application
Service Application name. A service application
database with the same
name is created on the
SharePoint farm's database
server.
Configure Power Pivot Service Application Name Default, if needed Service application name you
Servers typed on the previous page.
Register Power Pivot Service Application Name Service application name you
Add-in as Excel Services typed on the previous page.
Usage Tracker
If the Power Pivot for SharePoint 2013 Configuration tool creates the farm, it creates the required databases on
the database server, using the same file naming conventions as SharePoint. You cannot change the farm database
name.
If the tool creates a site collection, it creates a content database on the database server, using the same file naming
conventions as SharePoint. You cannot change the content database name.
NOTE
For SQL Server 2017Power Pivot for SharePoint 2013, the data providers are installed when you run the spPowerPivot.msi
installer and Power Pivot for SharePoint 2013 Configuration tool. For more information, see Install or Uninstall the Power
Pivot for SharePoint Add-in (SharePoint 2013).
Additional Resources
Submit feedback and contact information through SQL Server Feedback.
See Also
Install or Uninstall the Power Pivot for SharePoint Add-in (SharePoint 2013)
Power Pivot Configuration Tools
Power Pivot Server Administration and Configuration in Central Administration
Upgrade Workbooks and Scheduled Data Refresh (SharePoint 2013)
Power Pivot Availability and Disaster Recovery
12/6/2018 • 5 minutes to read • Edit Online
In this topic:
Example SharePoint 2013 topology for Power Pivot high availability
Example SharePoint 2010 topology for Power Pivot high availability
PowerPivot service application database and SQL Server availability and recovery technologies
Links to more information
(1) The Web front-end servers. Install the data providers on each server. For more information, see Install
the Analysis Services OLE DB Provider on SharePoint Servers.
(2) The two Power Pivot shared services and (4) the Windows Service SQL Server Analysis Services
(Power Pivot) are installed on the SharePoint application servers.
The Power Pivot System Service runs on each application server and allows the service application to run
across application servers. If a single application server goes offline, the Power Pivot for SharePoint service
application will still be available.
To increase Power Pivot capacity in a SharePoint 2010, deploy more SharePoint application servers running
the Power Pivot System Service.
(3) Excel Calculation Services runs on each application server and allows the service application to run
across application servers. Therefore if a single application server goes offline, Excel Calculation Services
will still be available.
(5) The SQL Server databases used for content, configuration, and application databases. This includes the
Power Pivot service application database. Your DR plan should include the database layer.
(6) Some form of SQL Server database backup or redundancy.
COMMENTS
SQL Server 2008 R2 and SQL Server 2012 (11.x) synchronous Supported but not recommended. The recommendation is to
mirroring in a farm for availability. use Always On in Synchronous - commit mode.
Verification
For guidance and scripts to help you verify a Power Pivot for SharePoint deployment before and after a disaster
recovery cycle, see CheckList: Use PowerShell to Verify Power Pivot for SharePoint.
Farm or service administrator Install, enable, and configure services and applications.
Full control Activate Power Pivot feature integration at the site collection
level.
NOTE
Most security-related settings apply to trusted locations. If you want to preserve default values or use different values for
different sites, you can create an additional trusted location for sites that contain Power Pivot data, and then configure the
following settings for just that site. For more information, see Create a trusted location for Power Pivot sites in Central
Administration.
Web application Windows authentication provider Power Pivot converts a claims token
that it gets from Excel Services to a
Windows user identity. Any web
application that uses Excel Services as a
resource must be configured to use the
Windows authentication provider.
Trusted data connection libraries Optional. You can use Office Data Connection
(.odc) files in Power Pivot workbooks. If
you use .odc files to provide connection
information to local Power Pivot
workbooks, you can add the same .odc
files to this library.
User defined function assembly Not applicable. Power Pivot for SharePoint ignores
user-defined function assemblies that
you build deploy for Excel Services. If
you rely on user-defined assemblies for
a specific behavior, be aware that Power
Pivot query processing will not use the
user-defined functions you created.
See Also
Configure Power Pivot Service Accounts
Configure the Power Pivot Unattended Data Refresh Account (Power Pivot for SharePoint)
Create a trusted location for Power Pivot sites in Central Administration
Power Pivot Securtiy Architecture
Configure Power Pivot Health Rules
11/27/2018 • 7 minutes to read • Edit Online
Note: Health rule settings are configured separately for the SQL Server Analysis Services instance and the
Power Pivot service application. Use the instructions in this topic to configure health rules for each service. For a
SharePoint 2013 deployment, Power Pivot for SharePoint only uses the service application. Therefore Power
Pivot for SharePoint installs different sets of health rules for different versions of SharePoint. See the "version"
column in the topic Health Rules Reference (Power Pivot for SharePoint), or you can run the following Windows
PowerShell command to see the installed rules.
Get-SPHealthAnalysisRule | select name, enabled, summary | where {$_.summary -like "*power*"} | format-table
-property * -autosize | out-default
In this topic:
View Power Pivot health rules
Configure health rules used to evaluate server stability (SQL Server Analysis Services)
Configure health rules used to evaluate application stability (Power Pivot Service Application)
Prerequisites
You must be a service application administrator to change configuration properties of the Analysis Services
instance and of the Power Pivot service application.
See Also
Configure Disk Space Usage (Power Pivot for SharePoint)
Power Pivot Management Dashboard and Usage Data
Health Rules Reference (Power Pivot for SharePoint)
11/27/2018 • 12 minutes to read • Edit Online
Note: Power Pivot for SharePoint installs different sets of health rules for different versions of SharePoint. See the
"version" column in the table below, or you can run the following Windows PowerShell command to see the
installed rules.
Get-SPHealthAnalysisRule | select name, enabled, summary | where {$_.summary -like "*power*"} | format-table
-property * -autosize | out-default
By default, insufficient
memory warnings
occur when available
memory is down to
5%. You can change
this value to be
higher or lower by
adjusting settings on
the Analysis Services
instance. For more
information, see
Configure Power
Pivot Health Rules.
The 5% of unused
memory is calculated
as a percentage of
memory allocated to
Analysis Services. For
example, if you have
200 GB of total
memory, and Analysis
Services is allocated
80% of that (or 160
GB), then the 5% of
unused memory is
5% of 160 GB (or 8
GB).
RULE CONFIGURABLE AUTO REPAIR VERSION DESCRIPTION
Power Pivot: The high Yes No SharePoint 2010 By default, this health
number of rule is triggered when
connections indicates the number of distinct
that more servers user connections
should be deployed exceeds 100. This
to handle the current default value is
load. arbitrary (it is not
based on the
hardware
specifications of your
server or on user
activity) so you might
raise or lower the
value depending on
the server capacity
and user activity in
your environment.
For more information,
see Configure Power
Pivot Health Rules.
Power Pivot: The ratio Yes No SharePoint 2013 By default, this health
of load events to rule is triggered when
connections is too SharePoint 2010 the percentage of
high. load events to
connection events
exceeds 50% over the
entire data collection
period (by default, 4
hours). A ratio this
high indicates a very
high number of
connections to unique
workbooks, or cache
reduction settings
that are too
aggressive (where
workbooks are quickly
unloaded and
removed from the
system, while
requests for that data
are still active). To
avoid counting false
positives, there must
be at least 20
connections per 4
hour period before
the ratio can be
calculated. You can
base this health rule
on a different ratio.
For more information,
see Configure Power
Pivot Health Rules.
For more information
about configuring the
cache, see Configure
Disk Space Usage
(Power Pivot for
SharePoint).
RULE CONFIGURABLE AUTO REPAIR VERSION DESCRIPTION
1) In Central
Administration, click
Manage web
applications.
To check service
configuration, use the
Services console
application to find
Secondary Logon and
change its Startup
Type to Manual. If
you cannot enable
the service, your
organization might
have a group policy
that disables it. Check
with an administrator
to determine whether
this is the case.
On topologies that
include Central
Administration
running on a
standalone web front
end server, you must
install ADOMD.NET
manually if you want
to view these reports
in the management
dashboard. For more
information, see
Install ADOMD.NET
on Web Front-End
Servers Running
Central
Administration.
Power Pivot Management Dashboard and Usage
Data
1/28/2019 • 6 minutes to read • Edit Online
Prerequisites
You must be a service administrator to open Power Pivot Management Dashboard for a Power Pivot service
application that you manage.
DASHBOARD DESCRIPTION
Infrastructure - Server Health Shows trends in CPU usage, memory consumption, and
query response times over time so that you can assess
whether system resources are nearing maximum capacity or
are under utilized.
Workbook Activity - Chart Reports on frequency of data access. You can learn how often
connections to Power Pivot data sources occur on a daily or
weekly basis.
Workbook Activity - Lists Reports on frequency of data access. You can learn how often
connections to Power Pivot data sources occur on a daily or
weekly basis.
Data Refresh - Recent Activity Reports on the status of data refresh jobs, including jobs that
failed to run. This report provides a composite view into data
refresh operations at the application level. Administrators can
see at a glance the number of data refresh jobs that are
defined for the entire Power Pivot service application.
Data Refresh - Recent Failures Lists the Power Pivot workbooks that did not complete data
refresh successfully.
NOTE
Edit the file to avoid the following error when attempting to use the .odc file in Excel: "Initialization of the data source
failed". The auto-generated .odc file includes a parameter that are not supported by the MSOLAP OLE DB provider. The
following instructions provide the workaround for removing the parameters.
You must be a farm or service administrator to build reports that are based on the Power Pivot workbook in
Central Administration.
1. Open the Power Pivot Management Dashboard.
2. Scroll to the Reports section at the bottom of the page.
3. Click Power Pivot Management Data.
4. Save the .odc file to a local folder.
5. Open the .odc file in a text editor.
6. In the <odc:ConnectionString> element, scroll to the end of the line and remove Embedded
Data=False, and then remove Edit Mode=0. If the last character in the string is a semicolon, remove it
now.
7. Save the File. The remaining steps depend on which version of Power Pivot and Excel you are using.
8. a. Start Excel 2013
b. In the Power Pivot ribbon, click Manage.
c. Click Get External Data and then click Existing connections.
d. Click the .ODC file if you see it. If you do not see the .ODC file, click Browse for More and then in
the file path, specify the .odc file.
e. Click Open
f. Click Test Connection to verify the connection succeeds.
g. Click type a name for the connection and then click Next.
h. In Specify MDX Query, click Design to open the MDX query designer to assemble the data you
want to work with If you see the error message "The Edit Mode property name is not formatted
correctly.", verify you edits the .ODC file.
i. Click OK and then click Finish.
j. Create PivotTable or PivotChart reports to visualize the data in Excel.
9. a. Start Excel 2010.
b. On the Power Pivot ribbon, click Launch Power Pivot Window.
c. On the Design ribbon in the Power Pivot window, click Existing Connections.
d. Click Browse for More.
e. In the file path, specify the .odc file.
f. Click Open. The Table Import Wizard starts, using the connection string to the Power Pivot
workbook that contains usage data.
g. Click Test Connection to verify that you have access.
h. Enter a friendly name for the connection, and then click Next.
i. In Specify MDX Query, click Design to open the MDX query designer to assemble the data you
want to work with, and then create PivotTable or PivotChart reports to visualize the data in Excel.
See Also
Power Pivot Data Refresh with SharePoint 2010
Configure Usage Data Collection for (Power Pivot for SharePoint
Power Pivot Usage Data Collection
5/16/2018 • 7 minutes to read • Edit Online
PHASE DESCRIPTION
PHASE DESCRIPTION
Connections Server connections made on behalf of a You can enable and disable Configure
user who is querying Power Pivot data Usage Data Collection for (Power Pivot
in an Excel workbook. Connection for SharePoint.
events identify who opened a
connection to a Power Pivot workbook.
In reports, this information is used to
identify the most frequent users, the
Power Pivot data sources that are
accessed by the same users, and trends
in connections over time.
Query response times Query response statistics that You can enable and disable Configure
categorize queries based on how long Usage Data Collection for (Power Pivot
they take to complete. Query response for SharePoint.
statistics show patterns in how long it
takes the server to respond to query
requests.
Data load Data load operations by the Analysis You can enable and disable Configure
Services service. Data load events Usage Data Collection for (Power Pivot
identify which data sources are used for SharePoint.
most often.
Data unload Data unload operations by Power Pivot You can enable and disable Configure
service applications. An Analysis Usage Data Collection for (Power Pivot
Services service unloads inactive Power for SharePoint.
Pivot data sources if it is not being
used, or when the server is under
memory pressure or needs additional
memory to run data refresh jobs.
Server health Server operations that indicate server No. Usage data is always collected for
health, measured in CPU and memory this event.
utilization. This data is historical. It does
not provide real time information about
the current processing load on the
server.
Data refresh Data refresh operations initiated by the No. Data refresh usage data is always
Power Pivot service for scheduled data collected if you enable data refresh for
updates. Usage history for data refresh the Power Pivot service application.
is collected at the application level for
operational reports, and is reflected in
the Manage Data Refresh pages for
individual workbooks.
Microsoft SharePoint Foundation Every 30 minutes in SharePoint 2010. This timer job is configured globally at
Usage Data Import Every 5 minutes in SharePoint 2013. the farm level. It moves usage data
from local usage log files to the central
usage data collection database. You can
run this timer job manually to force a
data import operation.
Microsoft SharePoint Foundation Daily at 3:00 A.M. Starting with SQL Server 2012 Power
Usage Data Processing timer job Pivot for SharePoint, this Time job is
supported for upgrade or migration
scenarios where you may have older
usage data still in the SharePoint usage
databases. Starting with SQL Server
2012 Power Pivot for SharePoint, the
SharePoint usage database is not used
for Power Pivot usage collection and
Management dashboard workflow. The
time job can be manually run to move
any remaining Power Pivot related data
in the SharePoint usage database to
the Power Pivot service application
databases.
Power Pivot Management Dashboard Daily at 3:00 A.M. This timer job updates the internal
Processing timer job Power Pivot workbook that provides
administrative data to the Power Pivot
Management Dashboard. It gets
updated information that is managed
by SharePoint, including server names,
user names, application names, and file
names that appear in dashboard
reports or web parts.
Reporting on Usage Data
To view usage data on Power Pivot data, you can view built-in reports in the Power Pivot Management
Dashboard. The built-in reports consolidate usage data that is retrieved from reporting data structures in the
service application database. Because the underlying report data is updated on a daily basis, the built-in usage
reports will show updated information only after the Microsoft SharePoint Foundation Usage Data Processing
timer job copies data to a Power Pivot service application database. By default, this occurs once a day.
For more information about how to view reports, see Power Pivot Management Dashboard and Usage Data.
See Also
Power Pivot Management Dashboard and Usage Data
Configuration Setting Reference (Power Pivot for SharePoint)
Configure Usage Data Collection for (Power Pivot for SharePoint
Configure Usage Data Collection for (Power Pivot
for SharePoint
11/27/2018 • 10 minutes to read • Edit Online
IMPORTANT
Usage data provides insight into how users are accessing data and resources, but it does not guarantee reliable,
persistent data about server operations and user access. For example, if there is a server restart, event usage data will be
lost and will not be recoverable. Similarly, if the temporary log files reach maximum size, no new data will be added until
the files are cleared. If you require audit capability, consider using the workflow and content type features that
SharePoint provides to build out an auditing subsystem for your farm. For more information, look for product and
community documentation on the web.
Enable usage data collection and choose events that trigger data
collection
Configure usage data collection in SharePoint Central Administration.
1. In Central Administration, click Monitoring.
2. In the Reporting section, click Configure usage and health data collection.
3. Select the Enable usage data collection.
4. In the Events to log section, select or clear the checkboxes to either enable or disable the following
Analysis Services events:
EVENT DESCRIPTION
Power Pivot Connections Power Pivot Connection event is used to monitor Power
Pivot server connections that are made on behalf of a
user.
Power Pivot Load Data Usage Power Pivot Load Data Usage is used to monitor
requests that load Power Pivot data into server
memory. A load event is generated for Power Pivot data
files loaded from a content database or from cache.
Power Pivot Unload Data Usage Power Pivot Unload Data Usage is used to monitor
requests for unloading a Power Pivot data source after a
period of inactivity. Caching a Power Pivot data source
to disk will be reported as an unload event.
Power Pivot Query Usage Power Pivot Query Usage is used to monitor query
processing times for data that is loaded in an Analysis
Services service instance.
NOTE
Server health and data refresh operations also generate usage data, but there is no event associated with these
processes.
5. You can also update the log file location. For more information, see the next section.
6. Click OK to save your changes.
7. Optionally, you can specify whether all messages or just errors are logged. For more information on
how to throttle event messages, see Configure and View SharePoint Log Files and Diagnostic Logging
(Power Pivot for SharePoint).
To view or change these properties, use the Usage and health data collection page.
1. On the Home page in Central Administration, click Monitoring.
2. In the Monitoring section, click Configure usage and health data collection.
3. In Usage Data Collection Settings, view or modify the file location, name, or maximum file size. If you
specify a file size that is too low, the file size will reach the maximum limit and no new entries will be
added to it until its contents are moved to the central usage data collection database.
Specify how often query statistics are reported to the usage data
collection system
The time-to-report interval specifies how often query statistics are reported to the usage data collection
system. Query statistics accumulate in a process and are reported as a single event at regular intervals. You can
adjust the interval to write to the log file more or less often.
1. Open the Power Pivot Service Application Page.
2. In the Usage Data Collection section, in Query Reporting Interval, enter the number of seconds
after which the server will report the query statistics for all categories (trivial, quick, expected, long
running, and exceed) as a single event to the usage data collection system.
The range is 1 to any positive integer.
The default is 300 seconds (or 5 minutes). This value is recommended for dynamic farm
environments that run a variety of applications and services.
If you raise this value to a much larger number, you might lose statistical data before it can be reported.
For example, a service restart will cause query statistics to be lost. Conversely, if your built-in activity
reports show insufficient data, consider decreasing the interval to get time-to-report events more
frequently.
3. Click OK.
Query Reporting interval 300 (in seconds) Integer 1 to any positive integer.
The default is 5 minutes.
Usage data history 365 (in days) Integer 0 specifies unlimited, but
you can also set an upper
limit to expire historical
data and have it deleted
automatically. Valid values
for a limited retention
period are 1 to 5000 (in
days).
Trivial Response Upper 500 (in milliseconds) Integer Sets an upper boundary
Limit that defines a trivial
request-response exchange.
Any request that completes
between 0 to 500
milliseconds is a trivial
request, and ignored for
reporting purposes.
SETTING DEFAULT VALUE TYPE VALID RANGE
Quick Response Upper 1000 (in milliseconds) Integer Sets an upper boundary
Limit that defines a quick
request-response exchange.
Expected Response Upper 3000 (in milliseconds) Integer Sets an upper boundary
Limit that defines an expected
request-response exchange.
Long Running Response 10000 (in milliseconds) Integer Sets an upper boundary
Upper Limit that defines a long running
request-response exchange.
Any requests that exceed
this upper limit fall into the
Exceeded category, which
has no upper threshold.
See Also
Configuration Setting Reference (Power Pivot for SharePoint)
Power Pivot Usage Data Collection
Create and Customize Power Pivot Gallery
11/27/2018 • 8 minutes to read • Edit Online
In this topic
Prerequisites
Overview
Create the Power Pivot Gallery
Customize a Power Pivot Gallery Library
Disable or Hide the Refresh Button
Switch to Theater View or Gallery View
Prerequisites
You must have Silverlight. Silverlight can be downloaded and installed through Microsoft Update. If you
view a Power Pivot Gallery library using a browser that does not have Silverlight, click the link on the page
to install it. You must close and reopen the browser after you install it.
NOTE
The Power Pivot Gallery requires Microsoft Silverlight. The Microsoft Edge browser does not support Silverlight.
To view the library contents in Edge, click the Library tab in Power Pivot gallery, and then change the document
library view to All Documents.
To change the default view , click the Library tab and then click Modify View. Click "Make this the default view" and
then click OK to save the default view.
For more information on what Edge supports, see the Windows blog, A break from the past, part 2: Saying goodbye
to ActiveX, VBScript...
Workbook owners or authors must have Contribute permission to schedule data refresh on a workbook. Users
with Contribute permissions can open and edit the workbook's data refresh configuration page to specify the
credentials and schedule information used to refresh the data.
So, users that only have View or Read permission levels, will not be able to access the refresh button. The refresh
button is visible but disabled. For more information, see User permissions and permission levels in SharePoint
2013.
The following table describes the different layouts for presenting thumbnail sketches of each previewed page:
VIEW DESCRIPTION
Gallery View (default) Gallery is the default view for a Power Pivot Gallery. The
preview appears to the left. Smaller thumbnails of each
worksheet appear next to it in a sequential left-to-right order.
All Documents This is the standard layout for document libraries. You can
choose this view to manage individual documents or view
library contents in a list format.
Theatre View and Carousel View These are specialized views that work best if you are
showcasing a small number of related documents. The full
rotation of thumbnails includes all pages in all documents in
the library. If you have a large number of documents, these
views might be impractical for users who want to find or open
a specific Power Pivot workbook.
NOTE
Depending on how your server is configured, you might see warning or error messages in the preview area for specific
documents. Messages can appear when an Excel workbook is set to automatically refresh its data whenever it is opened.
Data refresh warning messages will appear as the preview image if Excel Services is configured to show Warn on data refresh
error messages. Farm or service administrators can modify configuration settings to allow a preview of the actual worksheet
to appear. For more information, see Create a trusted location for Power Pivot sites in Central Administration.
In this topic
Prerequisites
Icons in Power Pivot Gallery
Save an Excel Workbook to Power Pivot Gallery
Create new reports or workbooks based on a published Power Pivot workbook
Open a workbook or report in full page mode
Schedule data refresh for Power Pivot workbooks in Power Pivot Gallery
Delete a workbook or report in Power Pivot Gallery
Refresh a thumbnail image
Known Issues
Prerequisites
NOTE
The Power Pivot Gallery requires Microsoft Silverlight. The Microsoft Edge browser does not support Silverlight.
To view the library contents in Edge, click the Library tab in Power Pivot gallery, and then change the document library view
to All Documents.
To change the default view , click the Library tab and then click Modify View. Click "Make this the default view" and then
click OK to save the default view.
For more information on what Edge supports, see the Windows blog, A break from the past, part 2: Saying goodbye to
ActiveX, VBScript...
For a complete list of prerequisites, see Create and Customize Power Pivot Gallery.
4. Using the Save As dialog box, select Power Pivot Gallery on your site.
5. Click Open to open the library.
6. Click Save to publish the workbook to the library.
In a browser window, verify that the document appears in Power Pivot Gallery. Newly published documents will
appear in the list. Library settings determine where the document appears (for example, sorted in ascending order
by date, or alphabetically by name). You might need to refresh the browser window to view the most recent
additions.
Upload a workbook into Power Pivot Gallery
You can also upload a workbook if you want to start from SharePoint and select from your computer which file to
publish.
1. In a SharePoint site, open Power Pivot Gallery.
2. In Library ribbon, click Documents.
3. In Upload Document, select an upload option and then enter the name and location of the file you want
to upload. Library settings determine where the document appears. You might need to refresh the browser
window to view the latest addition.
Known Issues
Document Type is Not Supported
The Power Pivot Gallery Document content type is not supported. If you enable the Power Pivot Gallery
Document content type for a document library, and attempt to create a new document of that type, you will see
an error message similar to one of the following:
'New Document' requires a Microsoft Sharepoint Foundation-compatible application and web browser. To
add a document to this document library, click the 'Upload Document' button.
"The Internet address 'http://[server name]/testSite/PowerPivot
Gallery/ReportGallery/Forms/Template.xlsx' is not valid.""Microsoft Excel cannot access the file
'http://[server name]/testSite/PowerPivot Gallery/ReportGallery/Forms/Template.xlsx'. There are several
possible reasons:
The Power Pivot Gallery Document content type is not automatically added to document libraries, You will not
encounter this issue unless you manually enable the unsupported content type.
See Also
Create a trusted location for Power Pivot sites in Central Administration
Delete Power Pivot Gallery
Create and Customize Power Pivot Gallery
Schedule a Data Refresh (Power Pivot for SharePoint)
Delete Power Pivot Gallery
5/16/2018 • 2 minutes to read • Edit Online
NOTE
This topic provides instructions on how to delete a SharePoint library. For instructions on how to delete individual
documents in the library, see Use Power Pivot Gallery.
See Also
Power Pivot Gallery
Power Pivot Data Access
12/6/2018 • 2 minutes to read • Edit Online
See Also
Connect to Analysis Services
Power Pivot Data Refresh
12/10/2018 • 2 minutes to read • Edit Online
NOTE
SQL Server 2017 and SharePoint Server 2013 Excel Services use a different architecture for data refresh of Power Pivot data
models. The SharePoint 2013 supported architecture utilizes Excel Services as the primary component to load Power Pivot
data models. The previous data refresh architecture used relied on a server running Power Pivot System Service and Analysis
Services in SharePoint mode to load data models. For more information, see the following:
Power Pivot Data Refresh with SharePoint 2013
Upgrade Workbooks and Scheduled Data Refresh (SharePoint 2013)
View Data Refresh History (Power Pivot for
SharePoint)
10/25/2018 • 3 minutes to read • Edit Online
Prerequisites
You must have Contribute permissions or greater to view the data refresh history.
You must have enabled and scheduled data refresh on a workbook that contains Power Pivot data. If you have not
scheduled data refresh, you will see the schedule definition page instead of history information.
Name Specifies the file name of the Excel workbook that contains
Power Pivot data.
Failed indicates that the last data refresh operation did not
succeed. The refreshed data was not saved. The workbook
contains the same data it had before data refresh began.
Last successful refresh Specifies the date on which the last data refresh completed
successfully.
Next schedule refresh Specifies the date on which the next data refresh is scheduled
to occur.
Started Within the history details section, Started indicates the actual
processing time. The actual processing time might be different
from what you scheduled. Processing will begin when
sufficient memory is available on the server. If the server is
very busy, the processing might begin several hours after the
start time you specified.
Time Provides the cumulative time from when data refresh started
to when it was completed.
Background
SharePoint Server 2013 Excel Services manages data refresh for Excel 2013 workbooks and triggers the data
model processing on a SQL Server 2017 Analysis Services server that is running in SharePoint mode. For Excel
2010 workbooks, Excel Services also manages the loading and saving of workbooks and data models. However,
Excel Services relies on the Power Pivot System Service to send the processing commands to the data model. The
following table summarizes the components that send processing commands for data refresh depending on the
version of the workbook. The assumed environment is a SharePoint 2013 farm configured to use a SQL Server
2017 Analysis Server running in SharePoint mode.
Trigger Data Refresh Interactive: Authenticated User Power Pivot System Service
Load Workbook from Content SharePoint 2013 Excel Services SharePoint 2013 Excel Services
Databases
Load Data model on Analysis Services SharePoint 2013 Excel Services SharePoint 2013 Excel Services
instance
Send Processing Commands to Analysis SharePoint 2013 Excel Services Power Pivot System Service
Services instance
Update Workbook Data SharePoint 2013 Excel Services SharePoint 2013 Excel Services
Save Workbook and Data model to Interactive: N/A SharePoint 2013 Excel Services
Content Database
Scheduled: SharePoint 2013 Excel
Services
The following table summarizes the supported refresh features in a SharePoint 2013 farm configured to use a
SQL Server 2017 Analysis Server running in SharePoint mode:
2008 R2 Power Pivot for Excel Not supported. Upgrade the workbook Not supported. Upgrade the workbook
(*) (*)
2012 Power Pivot for Excel Supported Not supported. Upgrade the workbook
(*)
(*) For more information on workbook upgrades, see Upgrade Workbooks and Scheduled Data Refresh
(SharePoint 2013).
NOTE
Interactive data refresh is only available for workbooks that created in Excel 2013. If you try to refresh an Excel 2010
workbook, Excel Services displays an error message similar to " Power Pivot Operation Failed: The Workbook was created in
an older version of Excel and Power Pivot cannot be refreshed until the file is upgraded". For more information on upgrading
workbooks, see Upgrade Workbooks and Scheduled Data Refresh (SharePoint 2013).
Windows Authentication with Workbook Data Connections and Interactive Data Refresh
Excel Services sends the Analysis Services server a process command that instructs the server to impersonate a
user account. To obtain system rights sufficient to perform the user impersonation-delegation process, the
Analysis Services service account, requires Act as part of the operating system privilege on the local server. The
Analysis Services server also needs to be able to delegate the user's credentials to data sources. The query result is
sent to Excel Services.
Typical user experience: When a customer selects "Refresh All Connections" in an Excel 2013 workbook that
contains a Power Pivot model, they see an error message similar to the following:
External Data Refresh Failed: An error occurred while working on the Data Model in the workbook. Please
try again. We are unable to refresh one or more data connections in this workbook.
Depending on the data provider you are using, you see messages similar to the following in the ULS log.
With the SQL Native Client:
Failed to create an external connection or execute a query. Provider message: Out of line object 'DataSource',
referring to ID (s) '20102481-39c8-4d21-bf63-68f583ad22bb', has been specified but has not been used. OLE
DB or ODBC error: A network-related or instance-specific error has occurred while establishing a connection to
SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is
configured to allow remote connections. For more information see SQL Server Books Online.; 08001; SSL
Provider: The requested security package does not exist ; 08001; Client unable to establish connection; 08001;
Encryption not supported on the client.; 08001. , ConnectionName: ThisWorkbookDataModel, Workbook:
book1.xlsx.
With the Microsoft OLE DB Provider for SQL Server:
Failed to create an external connection or execute a query. Provider message: Out of line object 'DataSource',
referring to ID (s) '6e711bfa-b62f-4879-a177-c5dd61d9c242', has been specified but has not been used. OLE
DB or ODBC error. , ConnectionName: ThisWorkbookDataModel, Workbook: OLEDB Provider.xlsx.
With the .NET Framework Data Provider for SQL Server:
Failed to create an external connection or execute a query. Provider message: Out of line object 'DataSource',
referring to ID (s) 'f5fb916c-3eac-4d07-a542-531524c0d44a', has been specified but has not been used. Errors
in the high-level relational engine. The following exception occurred while the managed IDbConnection
interface was being used: Could not load file or assembly 'System.Transactions, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. Either a required
impersonation level was not provided, or the provided impersonation level is invalid. (Exception from
HRESULT: 0x80070542). , ConnectionName: ThisWorkbookDataModel, Workbook: NETProvider.xlsx.
Summary of Configuration Steps To configure Act as part of the operating system privilege on the local
server:
1. On the Analysis Services Server running in SharePoint mode, Add the Analysis Services service account to
the "Act as part of the operating system" privilege:
a. Run " secpol.msc "
b. Click Local Security Policy, then click Local policies, and then click User rights assignment.
c. Add the service account.
2. Restart Excel Services and reboot the Analysis Services server.
3. Delegation from the Excel Services service account or from Claims to Windows token service (C2WTS ) to
the Analysis services instance is not required. Therefore no configuration for KCD from Excel Services or
C2WTS to Power Pivot AS service is necessary. If the backend data source is on the same server as the
Analysis Services instance, Kerberos Constrained Delegation is not required. However, the Analysis
Services service account requires the right to Act As Part Of The Operating System.
TIP
For information on refreshing workbooks from SharePoint online, see Refreshing Excel workbooks with embedded Power
Pivot models from SharePoint Online (white paper) (http://technet.microsoft.com/library/jj992650.aspx).
(3) Power Pivot System Service The service is installed when you deploy
the Power Pivot for SharePoint add-in.
(6) Power Pivot data refresh timer Job Instructs the Power Pivot system
service to connect with Excel Services
for refreshing data models.
Analysis Services requires appropriate data providers and client libraries so that the Analysis Services server in
SharePoint mode can access data sources.
NOTE
Because the Power Pivot system service no longer loads or saves Power Pivot models, most of the settings for caching
models on an application server do not apply to a SharePoint 2013 farm.
For more information on data refresh authentication and usage of credentials, see the blog post Refreshing Power
Pivot Data in SharePoint 2013.
More Information
Troubleshooting Power Pivot Data Refresh.
Excel Services in SharePoint 2013 (http://msdn.microsoft.com/library/sharepoint/jj164076(v=office.15).
See Also
Install Analysis Services in Power Pivot Mode
Schedule Data Refresh and Data Sources - No
Windows Authentication
11/27/2018 • 4 minutes to read • Edit Online
Overview: Create two Secure Store Target Applications. Configure the first target application
(PowerPivotDataRefresh) to use Windows credentials. Configure the second target application with the credentials
for a data source that does not support windows authentication, for example, an Oracle database. The second
target application also uses the first target application for the unattended data refresh account.
(1) PowerPivotDatarefresh: A Secure Store Target Application ID that is set with windows authentication.
(2) OracleAuthentication: A Secure Store Target Application ID that is set with Oracle credentials.
(3) The Power Pivot Service application is configure to use the target application "PowerPivotDataRefresh"
for the Unattended Data Refresh Account.
(4) PowerePivot Workbook uses Oracle data. The workbook refresh settings specify the data source
connection to use the target application (2) for credentials.
Prerequisites
A Power Pivot Service Application exists.
A Secure Store Service Application exists.
An Excel workbook with a Power Pivot data model exists.
More Information
Configure the Secure Store Service in SharePoint 2013.
See the "Scheduled Data Refresh" section of Power Pivot Data Refresh with SharePoint 2013 and SQL
Server 2012 SP1 (Analysis Services).
Power Pivot Data Feeds
5/16/2018 • 2 minutes to read • Edit Online
Related Tasks
Create or Customize a Data Feed Library (Power Pivot for SharePoint)
Delete a Power Pivot Data Feed Library
Use Data Feeds (Power Pivot for SharePoint)
Share Data Feeds Using a Data Feed Library (Power Pivot for SharePoint)
Create or Customize a Data Feed Library (Power
Pivot for SharePoint)
11/28/2018 • 3 minutes to read • Edit Online
Prerequisites
Power Pivot feature integration must be activated for the sites for which you are creating the data feed library. If
the data feed library template type is not available, the most likely cause is that this prerequisite has not been met.
For more information, see Activate Power Pivot Feature Integration for Site Collections in Central Administration.
You must be a site owner to create the library.
See Also
Use Data Feeds (Power Pivot for SharePoint)
Delete a Power Pivot Data Feed Library
Power Pivot Server Administration and Configuration in Central Administration
Power Pivot Data Feeds
Use Data Feeds (Power Pivot for SharePoint)
7/11/2018 • 5 minutes to read • Edit Online
Prerequisites
You must have the Power Pivot for Excel to import a data feed into Excel 2010.
You must have a Web service or a data service that provides data in the Atom 1.0 format. Both SQL Server 2008
R2 Reporting Services and SharePoint 2010 can provide data in this format.
Before you can export a SharePoint list as a data feed, you must install ADO.NET Data Services on the SharePoint
server. For more information, see Install ADO.NET Data Services to support data feed exports of SharePoint lists .
4. Click Open if Power Pivot for Excel is installed locally, or click Save to save the .atomsvc document to your
hard drive for import operations at a later time.
5. If you chose Open, use the Table Import Wizard to import the data feed to a worksheet. The data feed will
be added as a new table in the Power Pivot window.
An error will occur if ADO.NET Data Services 3.5.1 is not installed on the SharePoint server. For more information
about the error and how to resolve it, see Install ADO.NET Data Services to support data feed exports of
SharePoint lists.
NOTE
To set up a recurring data refresh schedule that re-imports report data into a Power Pivot workbook that is published to a
SharePoint library, the report server must be configured for SharePoint integration. For more information about using
Power Pivot for SharePoint and Reporting Services together, see Configuration and Administration of a Report Server
(Reporting Services SharePoint Mode).
See Also
Activate Power Pivot Feature Integration for Site Collections in Central Administration
Share Data Feeds Using a Data Feed Library (Power Pivot for SharePoint)
Delete a Power Pivot Data Feed Library
5/16/2018 • 2 minutes to read • Edit Online
See Also
Power Pivot Data Feeds
Share Data Feeds Using a Data Feed Library (Power
Pivot for SharePoint)
5/16/2018 • 7 minutes to read • Edit Online
NOTE
Although data feeds are used to add Web data to a Power Pivot data source that you create in a Power Pivot for Excel, any
client application that can read an Atom feed can process a data service document.
Prerequisites
You must have a deployment of SQL Server 2008 R2 Power Pivot for SharePoint that adds Power Pivot query
processing to a SharePoint farm. Data Feed support is deployed through the Power Pivot solution package.
You must have a SharePoint library that supports the data service document content type. A default Data Feed
library is recommended for this purpose, but you can manually add the content type to any library. For more
information, see Create or Customize a Data Feed Library (Power Pivot for SharePoint).
You must have a data service or online data source that provides XML tabular data in the Atom 1.0 format.
You must have Contribute permissions on a SharePoint site to create or manage a data service document in a
SharePoint library.
Import data feeds to a Power Pivot-enabled workbook. View permissions to the data service document in a library.
In the Power Pivot client application, refresh data that was Not applicable. The Power Pivot client application uses
previously retrieved via a feed. embedded HTTP connection information to connect directly
to the data services and applications that provide the feed.
The Power Pivot client application does not use the data
service document.
In a SharePoint farm, refresh data as a scheduled task, with no Not applicable. The Power Pivot service uses embedded HTTP
user input required. connection information to connect directly to the data
services and applications that provide the feed. The Power
Pivot service does not use the data service document.
IMPORTANT
Although the data service document is read only once, data services that provide the actual data can be accessed at regular
intervals to get newer feeds. For more information about how to refresh data, see Power Pivot Data Refresh.
See Also
Power Pivot Data Feeds
Power Pivot BI Semantic Model Connection (.bism)
5/16/2018 • 5 minutes to read • Edit Online
Supported databases
A BI semantic model connection points to tabular model data. There are three sources for this data:
A tabular model database running on a standalone Analysis Services instance in tabular server mode. A
deployment of a standalone Analysis Services instance is external to the farm. Accessing data sources off
the farm requires additional permissions, which you can read about in this topic: Create a BI Semantic
Model Connection to a Tabular Model Database.
Power Pivot workbooks saved to SharePoint. Embedded Power Pivot databases inside Excel workbooks are
equivalent to tabular model databases that run on a standalone Analysis Services tabular mode server. If
you already use Power Pivot for Excel and Power Pivot for SharePoint, you can define a BI semantic model
connection that points to Power Pivot workbooks in a SharePoint library and build Power View reports
using existing Power Pivot data. You can use workbooks created in either SQL Server 2008 R2 or SQL
Server 2012 (11.x) versions of Power Pivot for Excel.
A multidimensional data model on an Analysis Services instance.
For a comparison of the data sources, see the community content Understanding the SQL Server 2012 BI
Semantic Model (BISM ).
Related Tasks
Add a BI Semantic Model Connection Content Type to a Library (Power Pivot for SharePoint)
Create a BI Semantic Model Connection to a Power Pivot Workbook
Create a BI Semantic Model Connection to a Tabular Model Database
Use a BI Semantic Model Connection in Excel or Reporting Services
See Also
Determine the Server Mode of an Analysis Services Instance
Connect to Analysis Services
Add BI Semantic Model Connection Content Type to
Library
5/16/2018 • 2 minutes to read • Edit Online
NOTE
If you already use SharePoint Data Connection Libraries, the BI Semantic Model Connection content type is automatically
added to that library template. You can skip the steps in this section if you use a data connection library that already lets
you create new BI semantic model connection documents.
See Also
Power Pivot BI Semantic Model Connection (.bism)
Use a BI Semantic Model Connection in Excel or Reporting Services
Create a BI Semantic Model Connection to a Power
Pivot Workbook
5/16/2018 • 3 minutes to read • Edit Online
Review Prerequisites
You must have Contribute permissions or above to create a BI semantic model connection file.
You must have a library that supports the BI semantic model connection content type. For more information, see
Add a BI Semantic Model Connection Content Type to a Library (Power Pivot for SharePoint).
You must know the URL of the Power Pivot workbook for which you are setting up a BI semantic model
connection (for example, http://adventure-works/shared documents/myworkbook.xlsx ). The workbook must be in the
same farm.
All computers and users that participate in the connection sequence must be in the same domain or trusted
domain (two-way trust).
Create a Connection
1. In the library that will contain the BI semantic model connection, click Documents on the SharePoint
ribbon. Click the down arrow on New Document, and select BISM Connection File to open the New BI
Semantic Model Connection page.
2. Set the Server property to the SharePoint URL of the Power Pivot workbook (for example,
http://mysharepoint/shared documents/myWorkbook.xlsx . In a Power Pivot for SharePoint deployment, data
can be loaded on any server in the farm. For this reason, data source connections to Power Pivot data
specify just the path to the workbook. The Power Pivot System Service determines which server loads the
data.
Do not use the Database property; it is not used when specifying the location of a Power Pivot workbook.
Your page should look similar to the following illustration.
Optionally, if you have SharePoint permissions to the workbook, an extra validation step is performed,
ensuring that the location is valid. If you do not have permission to access the data, you are given the
option of saving the BI semantic model connection without the validation response.
Next Steps
After you create and secure a BI semantic model connection, you can specify it as a data source. For more
information, see Use a BI Semantic Model Connection in Excel or Reporting Services.
See Also
Power Pivot BI Semantic Model Connection (.bism)
Use a BI Semantic Model Connection in Excel or Reporting Services
Create a BI Semantic Model Connection to a Tabular Model Database
Create a BI Semantic Model Connection to a Tabular
Model Database
5/16/2018 • 7 minutes to read • Edit Online
Review Prerequisites
You must have Contribute permissions or above to create a BI semantic model connection file.
You must have a library that supports the BI semantic model connection content type. For more information, see
Add a BI Semantic Model Connection Content Type to a Library (Power Pivot for SharePoint).
You must know the server and database name for which you are setting up a BI semantic model connection.
Analysis Services must be configured for tabular mode. Databases running on the server must be tabular model
databases. For instructions on how to check for server mode, see Determine the Server Mode of an Analysis
Services Instance.
In certain scenarios, the shared services in a SharePoint environment must have administrative permissions on
the Analysis Services instance. These services include Power Pivot service applications, Reporting Services
service applications, and PerformancePoint service applications. Before you can grant administrative
permissions, you must know the identity of these service applications. You can use Central Administration to
determine the identity.
You must be a SharePoint service administrator to view security information in Central Administration.
You must be an Analysis Services system administrator to grant administrative rights in Management Studio.
Power Pivot for SharePoint must be accessed via web applications that use classic authentication mode. BI
semantic model connections to external data sources have a dependency on classic mode sign-in. For more
information, see Power Pivot Authentication and Authorization.
All computers and users that participate in the connection sequence must be in the same domain or trusted
domain (two-way trust).
Grant Analysis Services Administrative Permissions to Shared Service
Applications
Connections that originate from SharePoint to a tabular model database on an Analysis Services server are
sometimes made by a shared service on behalf of the user requesting the data. The service making the request
might be a Power Pivot service application, a Reporting Services service application, or a PerformancePoint
service application. In order for the connection to succeed, the service must have administrative permissions on
the Analysis Services server. In Analysis Services, only an administrator is allowed to make an impersonated
connection on behalf of another user.
Administrative permissions are necessary when the connection is used under these conditions:
When verifying the connection information during the configuration of a BI semantic model connection
file.
When starting a Power View report using a BI semantic model connection.
When populating a PerformancePoint web part using a BI semantic model connection.
To ensure these behaviors perform as expected, grant to each service identity administrative permissions on the
Analysis Services instance. Use the following instructions to grant the necessary permission.
Add service identities to the Server Administrator role
1. In SQL Server Management Studio, connect to the Analysis Services instance.
2. Right-click the server name and select Properties.
3. Click Security, and then click Add. Enter the Windows user account that is used to run the service
application.
You can use Central Administration to determine the identity. In the Security section, open the Configure
service accounts to view which Windows account is associated with the service application pool used for
each application, then follow the instructions provided in this topic to grant the account administrative
permissions.
Next Steps
After you create and secure a BI semantic model connection, you can specify it as a data source. For more
information, see Use a BI Semantic Model Connection in Excel or Reporting Services.
See Also
Power Pivot BI Semantic Model Connection (.bism)
Create a BI Semantic Model Connection to a Power Pivot Workbook
Use a BI Semantic Model Connection in Excel or
Reporting Services
5/16/2018 • 3 minutes to read • Edit Online
Click Enable when prompted to enable data connections. Excel opens a workbook that contains a PivotTable field
list populated with fields from the underlying data source.
Starting from Excel
1. Start Excel and open a workbook. On the Data tab, in Get External Data, click From Other Sources.
2. Click From Analysis Services and use the Data Connection Wizard to import the data.
3. Enter the SharePoint URL of the BI semantic model connection file (for example,
http://mysharepoint/shared documents/myData.bism ). Accept the default log on credentials option, Use
Windows Authentication. Click Next.
4. On the next page, click Next again. Although you are prompted to select a database, you can only use the
one database that is specified in the BI semantic model connection.
5. On the last page, you can provide a friendly name and description. Click Finish, and then click OK on the
Import Data dialog box to import the data.
For connections to succeed you must have Excel 2010 and the MSOLAP.5.dll installed on the client computer. You
can get the provider by installing the version of Power Pivot for Excel that is current for this release or you can
download just the Analysis Services OLE DB provider from the Feature Pack download page.
To confirm that MSOLAP.5.dll is the current version, check HKEY_CLASSES_ROOT\MSOLAP in the registry.
CurVer should be set to MSOLAP.5.
You must also have Read permissions on the BI semantic model file in SharePoint. Read permissions include
download rights. Excel downloads the BI semantic model connection information from SharePoint and opens a
direct connection to the database via HTTP Get. Connection requests do not flow through SharePoint once BI
semantic model connection information is stored locally.
If you are connecting to a tabular model database that runs on an Analysis Services server, SharePoint
permissions are not sufficient. You must also have database read permissions on the server. This step should have
been performed when you created the BI semantic model connection. For more information, see Create a BI
Semantic Model Connection to a Tabular Model Database.
See Also
Configure Usage Data Collection for (Power Pivot for SharePoint
Configure and View SharePoint Log Files and Diagnostic Logging (Power Pivot for SharePoint)
An error occurred during an attempt to establish a
connection
12/10/2018 • 2 minutes to read • Edit Online
Details
Product Version SQL Server 2008 R2, SQL Server 2012 (11.x), SQL Server 2014
(12.x)
Explanation
Excel Services returns this error when you query Power Pivot data in an Excel workbook that is published to
SharePoint, and the SharePoint environment does not have a Power Pivot for SharePoint server, or the SQL Server
Analysis Services ( Power Pivot) service is stopped.
The error occurs when you slice or filter Power Pivot data when the query engine is not available.
User Action
Install Power Pivot for SharePoint or move the Power Pivot workbook to a SharePoint environment that has Power
Pivot for SharePoint installed. For more information, see Power Pivot for SharePoint 2010 Installation.
If the software is installed, verify that the SQL Server Analysis Services ( Power Pivot) instance is running. Check
Manage services on server in Central Administration. Also check the Services console application in
Administrative Tools.
For Power Pivot workbooks that were created in a SQL Server 2008 R2 version of Power Pivot for Excel, you must
install the SQL Server 2008 R2 version of the Analysis Services OLE DB provider. This error will occur if you
installed the provider, but did not register the Microsoft.AnalysisServices.ChannelTransport.dll file. For more
information about file registration, see Install the Analysis Services OLE DB Provider on SharePoint Servers.
See Also
The data connection uses Windows Authentication and user credentials could not be delegated. The following
connections failed to refresh: Power Pivot Data
Could not load file or assembly Microsoft-Data-
Services
5/16/2018 • 2 minutes to read • Edit Online
Details
Product Version SQL Server 2008 R2, SQL Server 2012 (11.x), SQL Server 2014
(12.x)
Explanation
SharePoint 2010 includes an Export as Data Feed button that you can use to export a SharePoint list as an XML
data feed. In addition, both Reporting Services in SharePoint mode and Power Pivot for SharePoint support data
feed features that require ADO.NET Data Services.
If ADO.NET Data Services is not installed, this error will occur when you request a data feed.
User Action
1. Go to the hardware and software requirements documentation for SharePoint 2010, Determine Hardware
and Software Requirements (SharePoint 2010) (http://go.microsoft.com/fwlink/?LinkId=169734).
2. In Installing software prerequisites, find the link for ADO.NET Data Services 3.5 that corresponds to the
operating system you are using.
3. Click the link and run the setup program that installs the service.
See Also
Deploy Power Pivot Solutions to SharePoint
Could not load
Microsoft.AnalysisServices.SharePoint.Integration
5/16/2018 • 2 minutes to read • Edit Online
Details
Product Version SQL Server 2008 R2, SQL Server 2012 (11.x), SQL Server 2014
(12.x)
Explanation
Power Pivot for SharePoint uses solution packages to deploy its features on a SharePoint server. One of the
solutions is not deployed correctly. As a result, this error appears whenever you try to open Power Pivot Gallery or
other Power Pivot application pages on a SharePoint site.
User Action
Deploy the solution package.
1. In Central Administration, in System Settings, click Manage farm solutions.
2. Click Powerpivotwebapp.
3. Click Deploy Solution.
4. Choose the web application for which this error is occurring. If there is more than one web application,
redeploy the solution for all of hem.
5. Click OK.
See Also
Deploy Power Pivot Solutions to SharePoint
The data connection path is invalid
5/16/2018 • 2 minutes to read • Edit Online
Details
Product Version SQL Server 2008 R2, SQL Server 2012 (11.x), SQL Server 2014
(12.x)
Message Text The data connection path in the workbook points to a file on
the local drive or is an invalid URI. The following connections
failed to refresh: Power Pivot Data
Explanation
Power Pivot workbooks contain embedded data connections. To support workbook interaction through slicers and
filters, Excel Services must be configured to allow external data access through embedded connection information.
External data access is required for retrieving Power Pivot data that is loaded on Power Pivot servers in the farm.
User Action
Change the configuration settings to allow embedded data source connections.
1. In Central Administration, in Application Management, click Manage service applications.
2. Click Excel Services Application.
3. Click Trusted File Location.
4. Click http:// or the location you want to configure.
5. In External Data, in Allow External Data, click Trusted data connection libraries and embedded.
6. Click OK.
Alternatively, you can create a new trusted location for sites that contain Power Pivot workbooks, and then modify
the configuration settings for just that site. For more information, see Create a trusted location for Power Pivot
sites in Central Administration.
The data connection user could not be delegated
5/16/2018 • 2 minutes to read • Edit Online
Details
Product Version SQL Server 2008 R2, SQL Server 2012 (11.x), SQL Server 2014
(12.x)
Message Text The data connection uses Windows Authentication and user
credentials could not be delegated. The following connections
failed to refresh: Power Pivot Data
Explanation
There are multiple causes for this error message. The common factor behind all of them is that Excel Services
cannot get a valid Windows user identity from a claims token in SharePoint. In the case of Excel workbooks that
contain Power Pivot data, this error occurs when any of the following conditions exist:
The Claims to Windows Token Service is not running. You can confirm the cause of this error by viewing the
SharePoint log file. If the SharePoint logs include the message "The pipe endpoint
'net.pipe://localhost/s4u/022694f3-9fbd-422b-b4b2-312e25dae2a2' could not be found on your local
machine", the Claims to Windows Token Service is not running. To start it, use Central Administration and
then verify the service is running in the Services console application.
A domain controller is not available to validate the user identity. The Claims to Windows Token Service does
not use cached credentials. It validates the user identity for each connection. You can confirm the cause of
this error by viewing the SharePoint log file. If the SharePoint logs include the message "Failed to get
WindowsIdentity from IClaimsIdentity", the user identity could not be authenticated.
The computers must be members of the same domain or in domains that have a two-way trust relationship.
You must use Windows domain user accounts. The accounts must have a Universal Principal Name (UPN ).
The Excel Services service account must have Active Directory permissions to query the object.
User Action
Use the following instructions to check the status of the Claims to Windows Token Service.
For all other scenarios, check with your network administrator.
Enable Claims to Windows Token Service
1. In Central Administration, in System Settings, click Manage services on server.
2. Select Claims to Windows Token Service, and then click Start.
3. Verify the service is also running in the Services console:
a. In Administrative Tools, click Services.
b. Start the Claims to Windows Token Service if it is not running.
See Also
Configure Power Pivot Service Accounts
Comments, Shapes, other objects not supported by
Excel Services
5/16/2018 • 2 minutes to read • Edit Online
Details
Product Version SQL Server 2008 R2, SQL Server 2012 (11.x), SQL Server 2014
(12.x)
Cause Excel Web Access cannot render the Shape object used to
control positioning and formatting of Slicers added to a
workbook from the Power Pivot Field List.
Message Text The following features are not supported by Excel Services and
may not display or may display only partially:
Explanation
Excel Web Access shows this error when you open a Power Pivot workbook in a browser and you click the Details
button for the message, Unsupported Features This workbook may not display as intended.
This error occurs because the Power Pivot workbook contains Slicers whose layout is controlled by a hidden Shape
object in Excel. The Shape object controls the formatting and positioning of the Slicers in horizontal and vertical
placements.
Excel Services cannot render a Shape object, but because the object is hidden, the fact that it does not render is not
an issue.
User Action
This error can be ignored. Click OK to close the error message and proceed to use the workbook and Slicers with
no problem.
Trusted location does not allow external data
connections
5/16/2018 • 2 minutes to read • Edit Online
Details
Product Version SQL Server 2008 R2, SQL Server 2012 (11.x), SQL Server 2014
(12.x)
Message Text The trusted location where the workbook is stored does not
allow external data connections. The following connections
failed to refresh: Power Pivot Data
Explanation
Power Pivot workbooks contain embedded data connections. To support workbook interaction through slicers and
filters, Excel Services must be configured to allow external data access through embedded connection information.
External data access is required for retrieving Power Pivot data that is loaded on Power Pivot servers in the farm.
User Action
Change the configuration settings to allow embedded data sources.
1. In Central Administration, in Application Management, click Manage service applications.
2. Click Excel Services Application.
3. Click Trusted File Location.
4. Click http:// or the location you want to configure.
5. In External Data, in Allow External Data, click Trusted data connection libraries and embedded.
6. Click OK.
Alternatively, you can create a new trusted location for sites that contain Power Pivot workbooks, and then modify
the configuration settings for just that site. For more information, see Create a trusted location for Power Pivot
sites in Central Administration.
This workbook contains one or more queries that
refresh external data
5/16/2018 • 2 minutes to read • Edit Online
Details
Product Version SQL Server 2008 R2, SQL Server 2012 (11.x), SQL Server 2014
(12.x)
Message Text This workbook contains one or more queries that refresh
external data. A malicious user can design a query to access
confidential information and distribute it to other users or
perform other harmful actions.
Explanation
Power Pivot workbooks contain embedded data connection strings that are used by Excel to communicate with an
external Power Pivot server that loads and calculates the data. When warn on data refresh is enabled, Excel
Services detects this connection string and warns the user accordingly.
To filter and slice Power Pivot data in the workbook, queries must be enabled. Be sure that you enable queries for
only those Power Pivot workbooks that you trust.
User Action
Click Yes to enable queries.
You can also change the configuration settings so that warn on refresh no longer occurs:
1. In Central Administration, in Application Management, click Manage service applications.
2. Click Excel Services Application.
3. Click Trusted File Location.
4. Click http:// or the location you want to configure.
5. In External Data, clear the checkbox for Warn on data refresh.
6. Click OK.
Alternatively, you can create a new trusted location for sites that contain Power Pivot workbooks, and then modify
the configuration settings for just that site. For more information, see Create a trusted location for Power Pivot
sites in Central Administration.
Unable to refresh data for a data connection in the
workbook
12/10/2018 • 3 minutes to read • Edit Online
Details
Product Version SQL Server 2008 R2, SQL Server 2012 (11.x), SQL Server 2014
(12.x)
Message Text Unable to refresh data for a data connection in the workbook.
Try again or contact your system administrator. The following
connections failed to refresh: Power Pivot Data
Instances
A server instance of Analysis Services is a copy of the msmdsrv.exe executable that runs as an operating system
service. Each instance is fully independent of other instances on the same server, having its own configuration
settings, permissions, ports, startup accounts, file storage, and server mode properties.
Each instance runs as Windows service, Msmdsrv.exe, in the security context of a defined logon account.
The service name of default instance is MSSQLServerOLAPService.
The service name of each named instance of is MSOLAP$InstanceName.
NOTE
If multiple instances are installed, Setup also installs a redirector service, which is integrated with the SQL Server Browser
service. The redirector service is responsible for directing clients to the appropriate named instance of Analysis Services. The
SQL Server Browser service always runs in the security context of the Local Service account, a limited user account used by
Windows for services that do not access resources outside the local computer.
Multi-instance means that you can scale-up by installing multiple server instances on the same hardware. For
Analysis Services in particular, it also means that you can support different server modes by having multiple
instances on the same server, each one configured to run in a specific mode.
Server mode
Server mode is a server property that determines which storage and memory architecture is used for that
instance. A server that runs in Multidimensional mode uses the resource management layer that was built for
multidimensional cube databases and data mining models. In contrast, Tabular server mode uses the VertiPaq in-
memory analytics engine and data compression to aggregate data as it is requested.
Differences in storage and memory architecture mean that a single instance of Analysis Services will run either
tabular databases or multidimensional databases, but not both. The server mode property determines which type
of database runs on the instance.
Server mode is set during installation when you specify the type of database that will run on the server. To support
all available modes, you can install multiple instances of Analysis Services, each deployed in a server mode that
corresponds to the projects you are building.
As a general rule, most of the administrative tasks you must perform do not vary by mode. As an Analysis
Services system administrator, you can use the same procedures and scripts to manage any Analysis Services
instance on your network regardless of how it was installed.
NOTE
The exception is Power Pivot for SharePoint. Server administration of a Power Pivot deployment is always within the context
of a SharePoint farm. Power Pivot differs from other server modes in that it is always single-instance, and always managed
through SharePoint Central Administration or the Power Pivot Configuration Tool. Although it is possible to connect to
Power Pivot for SharePoint in SQL Server Management Studio or SQL Server Data Tools (SSDT), it is not desirable. A
SharePoint farm includes infrastructure that synchronizes server state and oversees server availability. Using other tools can
interfere with these operations. For more information about Power Pivot server administration, see Power Pivot for
SharePoint .
See also
Comparing Tabular and Multidimensional Solutions
Determine the Server Mode of an Analysis Services Instance
High availability and Scalability in Analysis Services
2/26/2019 • 7 minutes to read • Edit Online
Key Points
Because the techniques for availability and scale differ from those of the relational database engine, a short
summary of key points is an effective introduction to techniques used with Analysis Services:
Analysis Services utilizes the high availability and scalability mechanisms built into the Windows server
platform: network load balancing (NLB ), Window Server Failover Clustering (WSFC ), or both.
NOTE
The Always On feature of the relational database engine does not extend to Analysis Services. You cannot configure
an Analysis Services instance to run in an Always On availability group.
Although Analysis Services does not run in Always On Availability Groups, it can both retrieve and process data from
Always On relational databases. For instructions on how to configure a highly available relational database so that it
can be used by Analysis Services, see Analysis Services with Always On Availability Groups.
High availability, as a sole objective, can be achieved via server redundancy in a failover cluster
Replacement nodes are assumed to have identical hardware and software configuration as the active node.
By itself, WSFC gives you high availability, but without scale.
Scalability, with or without availability, is achieved via NLB over read-only databases. Scalability is usually a
concern when query volumes are large or subject to sudden spikes.
Load balancing, coupled with multiple read-only databases, give you both scale and high availability
because all nodes are active, and when a server goes down, requests are automatically redistributed among
the remaining nodes. When you need both scalability and availability, an NLB cluster is the right choice.
For processing, objectives of high availability and scalability are less of a concern because you control the timing
and scope of operations. Processing can be both partial and incremental across portions of a model, although at
some point, you will need to process a model in full on a single server to ensure data consistency across all indexes
and aggregations. A robust scalable architecture relies on hardware that can accommodate full processing at
whatever cadence is required. For large solutions, this work is structured as an independent operation, with its own
hardware resources.
Tabular in-memory (default) where queries are executed as Emphasize RAM and CPUs with fast clock speeds.
table scans of in-memory data structures.
Tabular in DirectQuery mode, where queries are offloaded to Focus on relational database performance, lowering network
backend relational database servers and processing is limited latency, and maximizing throughput. Faster CPUs can also
to constructing metadata in the model. improve performance of the Analysis Services query processor.
Multidimensional models using MOLAP storage Choose a balanced configuration that accommodates disk IO
for loading data quickly and sufficient RAM for cached data.
Multidimensional models using ROLAP storage. Maximize disk IO and minimize network latency.
See Also
Synchronize Analysis Services Databases
Forcing NUMA affinity for Analysis Services Tabular Databases
An Analysis Services Case Study: Using Tabular Models in a Large-scale Commercial Solution
Server Properties in Analysis Services
12/26/2018 • 3 minutes to read • Edit Online
NOTE
In a default SQL Server Analysis Services installation, msmdsrv.ini can be found in the \Program Files\Microsoft SQL
Server\MSAS13.MSSQLSERVER\OLAP\Config folder.
Other properties affecting server configuration include deployment configuration properties in SQL Server Data Tools
(SSDT). For more information about those properties, see Specifying Configuration Settings for Solution Deployment.
TOPIC DESCRIPTION
General Properties The general properties are both basic and advanced
properties, and include properties that define the data
directory, backup directory, and other server behaviors.
Data Mining Properties The data mining properties control which data mining
algorithms are enabled and which are disabled. By default,
all of the algorithms are enabled.
Filestore Properties The file store properties are for advanced use only. They
include advanced memory management settings.
Lock Manager Properties The lock manager properties define server behaviors
pertaining to locking and timeouts. Most of these
properties are for advanced use only.
Log Properties The log properties controls if, where, and how events are
logged on the server. This includes error logging, exception
logging, flight recorder, query logging, and traces.
Memory Properties The memory properties control how the server uses
memory. They are primarily for advanced use.
Security Properties The security section contains both basic and advanced
properties that define access permissions. This includes
settings pertaining to administrators and users.
Thread Pool Properties The thread pool properties control how many threads the
server creates. These are primarily advanced properties.
See Also
Analysis Services Instance Management
Specifying Configuration Settings for Solution Deployment
Data Mining Properties
12/7/2018 • 2 minutes to read • Edit Online
Non-Specific Category
AllowSessionMiningModels
A Boolean property that indicates whether session mining models can be created.
The default value for this property is false, which indicates that session mining models cannot be created.
AllowAdHocOpenRowsetQueries
A Boolean property that indicates whether adhoc open rowset queries are allowed.
The default value for this property is false, which indicates that open rowset queries are not allowed during a
session.
AllowedProvidersInOpenRowset
A string property that identifies which providers are allowed in an open rowset, consisting of a comma/semi-colon
separated list of provider ProgIDs, or else [All].
MaxConcurrentPredictionQueries
A signed 32-bit integer property that defines the maximum number of concurrent prediction queries.
Algorithms Category
Microsoft_Association_Rules\ Enabled
A Boolean property that indicates whether the Microsoft_Association_Rules algorithm is enabled.
Microsoft_Clustering\ Enabled
A Boolean property that indicates whether the Microsoft_Clustering algorithm is enabled.
Microsoft_Decision_Trees\ Enabled
A Boolean property that indicates whether the Microsoft_DecisionTrees algorithm is enabled.
Microsoft_Naive_Bayes\ Enabled
A Boolean property that indicates whether the Microsoft_ Naive_Bayes algorithm is enabled.
Microsoft_Neural_Network\ Enabled
A Boolean property that indicates whether the Microsoft_Neural_Network algorithm is enabled.
Microsoft_Sequence_Clustering\ Enabled
A Boolean property that indicates whether the Microsoft_Sequence_Clustering algorithm is enabled.
Microsoft_Time_Series\ Enabled
A Boolean property that indicates whether the Microsoft_Time_Series algorithm is enabled.
Microsoft_Linear_Regression\ Enabled
A Boolean property that indicates whether the Microsoft_Linear_Regression algorithm is enabled.
Microsoft_Logistic_Regression\ Enabled
A Boolean property that indicates whether the Microsoft_Logistic_Regression algorithm is enabled.
NOTE
In addition to properties that define the data mining services available on the server, there are data mining properties that
define the behavior of specific algorithms. You configure these properties when you create an individual data mining model,
not at the server level. For more information, see Data Mining Algorithms (Analysis Services - Data Mining).
See Also
Physical Architecture (Analysis Services - Data Mining)
Server Properties in Analysis Services
Determine the Server Mode of an Analysis Services Instance
DAX Properties
12/7/2018 • 2 minutes to read • Edit Online
Configuration snippet
<ConfigurationSettings>
. . .
<DAX>
<PredicateCheckSpoolCardinalityThreshold>5000
</PredicateCheckSpoolCardinalityThreshold>
<DQ>
<MaxIntermediateRowsetSize>1000000
</MaxIntermediateRowsetSize>
</DQ>
</DAX>
. . .
Property descriptions
SETTING VALUE DESCRIPTION
For more information about additional server properties and how to set them, see Server Properties in Analysis
Services.
Feature Properties
12/7/2018 • 2 minutes to read • Edit Online
Properties
PROPERTY DEFAULT DESCRIPTION
DISCOVER_OBJECT_ACTIVITY
DISCOVER_COMMAND_OBJECTS
DISCOVER_SESSIONS (for
SESSION_READS, SESSION_WRITES,
SESSION_CPU_TIME_MS)
See Also
Server Properties in Analysis Services
Determine the Server Mode of an Analysis Services Instance
Use Dynamic Management Views (DMVs) to Monitor Analysis Services
Filestore Properties
12/7/2018 • 2 minutes to read • Edit Online
Properties
MemoryLimit
An advanced property that you should not change, except under the guidance of Microsoft support.
MemoryLimitMin
An advanced property that you should not change, except under the guidance of Microsoft support.
PercentScanPerPrice
An advanced property that you should not change, except under the guidance of Microsoft support.
PerformanceTrace
An advanced property that you should not change, except under the guidance of Microsoft support.
RandomFileAccessMode
A Boolean property that indicates whether database files and cached files are accessed in random file access mode.
This property is off by default. By default, the server does not set the random file access flag when opening
partition data files for read access.
On high-end systems, particularly those with large memory resources and multiple NUMA nodes, it can be
advantageous to use random file access. In random access mode, Windows bypasses page-mapping operations
that read data from disk into the system file cache, thereby lowering contention on the cache.
You will need to run comparison tests to determine whether query performance is improved as the result of
changing this property. For best practices on running comparison tests, including clearing the cache and avoiding
common mistakes, see the SQL Server 2008 R2 Analysis Services Operations Guide. For additional information
on the tradeoffs of using this property, see http://support.microsoft.com/kb/2549369.
To view or modify this property in Management Studio, enable the advanced properties list in the server
properties page. You can also change the property in the msmdsrv.ini file. Restarting the server is recommended
after setting this property; otherwise files that are already open will continue to be accessed in the previous mode.
UnbufferedThreshold
An advanced property that you should not change, except under the guidance of Microsoft support.
See Also
Server Properties in Analysis Services
Determine the Server Mode of an Analysis Services Instance
General Properties
12/7/2018 • 7 minutes to read • Edit Online
Non-Specific Category
AdminTimeout
A signed 32-bit integer property that defines the administrator timeout in seconds. This is an advanced property
that you should not change, except under the guidance of Microsoft support.
The default value for this property is zero (0), which indicates there is no timeout.
AllowedBrowsingFolders
A string property that specifies in a delimited list the folders that can be browsed when saving, opening, and
finding files in Analysis Services dialog boxes. The Analysis Services service account must have read and write
permissions to any folders that you add to the list.
BackupDir
A string property that identifies the name of the directory where backup files are stored by default, in the event a
path is not specified as part of the Backup command.
CollationName
A string property that identifies the server collation. For more information, see Languages and Collations (Analysis
Services).
CommitTimeout
An integer property that specifies how long (in milliseconds) the server will wait to acquire a write lock for the
purpose of committing a transaction. A waiting period is often required because the server must wait for other
locks to be released before it can take a write lock that commits the transaction.
The default value for this property is zero (0), which indicates that the server will wait indefinitely. For more
information about lock-related properties, see SQL Server 2008 R2 Analysis Services Operations Guide.
CoordinatorBuildMaxThreads
A signed 32-bit integer property that defines the maximum number of threads allocated to building partition
indexes. Increase this value in order to speed-up partition indexing, at the cost of memory usage. For more
information about this property, see SQL Server 2008 R2 Analysis Services Operations Guide.
CoordinatorCancelCount
A signed 32-bit integer property that defines how frequently the server should check whether a Cancel event
occurred (based on internal iteration count). Decrease this number in order to check for Cancel more frequently, at
the expense of general performance. This property is ignored in tabular server mode.
CoordinatorExecutionMode
A signed 32-bit integer property that defines the maximum number of parallel operations the server will attempt,
including processing and querying operations. Zero (0) indicates that the server will decide, based on an internal
algorithm. A positive number indicates the maximum number of operations in total. A negative number, with the
sign reversed, indicates the maximum number of operations per processor.
The default value for this property is -4, which indicates the server is limited to 4 parallel operations per processor.
For more information about this property, see SQL Server 2008 R2 Analysis Services Operations Guide.
CoordinatorQueryMaxThreads
A signed 32-bit integer property that defines the maximum number of threads per partition segment during query
resolution. The fewer the number of concurrent users, the higher this value can be, at the cost of memory.
Conversely, it may need to be lowered if there are a large number of concurrent users.
CoordinatorShutdownMode
A Boolean property that defines coordinator shutdown mode. This is an advanced property that you should not
change, except under the guidance of Microsoft support.
DataDir
A string property that identifies the name of the directory where data is stored.
DeploymentMode
Determines the operational context of an Analysis Services server instance. This property is referred to as 'server
mode' in dialog boxes, messages, and documentation. This property is configured by SQL Server Setup based on
the server mode you selected when installing Analysis Services. This property should be considered internal only,
always using the value specified by Setup.
Valid values for this property include the following:
VALUE DESCRIPTION
Each mode is exclusive of the other. A server that is configured for tabular mode cannot run Analysis Services
databases that contain cubes and dimensions. If the underlying computer hardware can support it, you can install
multiple instances of Analysis Services on the same computer and configure each instance to use a different
deployment mode. Remember that Analysis Services is a resource intensive application. Deploying multiple
instances on the same system is recommended only for high-end servers.
EnableFast1033Locale
An advanced property that you should not change, except under the guidance of Microsoft support.
ExternalCommandTimeout
An integer property that defines the timeout, in seconds, for commands issued to external servers, including
relational data sources and external Analysis Services servers.
The default value for this property is 3600 (seconds).
ExternalConnectionTimeout
An integer property that defines the timeout, in seconds, for creating connections to external servers, including
relational data sources and external Analysis Services servers. This property is ignored if a connection timeout is
specified on the connection string.
The default value for this property is 60 (seconds).
ForceCommitTimeout
An integer property that specifies how long, in milliseconds, a write commit operation should wait before
canceling other commands that preceded the current command, including queries in progress. This allows the
commit transaction to proceed by canceling lower priority operations, such as queries.
The default value for this property is 30 seconds (30000 milliseconds), which indicates that other commands will
not be forced to timeout until the commit transaction has been waiting for 30 seconds.
NOTE
Queries and processes cancelled by this event will report the following error message: "
Server: The operation has been cancelled "
For more information about this property, see SQL Server 2008 R2 Analysis Services Operations Guide.
IMPORTANT
ForceCommitTimeout applies to cube processing commands and to writeback operations.
IdleConnectionTimeout
An integer property that specifies a timeout, in seconds, for connections that are inactive.
The default value for this property is zero (0), which indicates that idle connections will not be timed out.
IdleOrphanSessionTimeout
An integer property that defines how long, in seconds, orphaned sessions will be retained in server memory. An
orphaned session is one that no longer has an associated connection. The default is 120 seconds.
InstanceVisible
A Boolean property that indicates whether the server instance is visible to discover instance requests from SQL
Server Browser service. The default is True. If you set it to false, the instance is not visible to SQL Server Browser.
Language
A string property that defines the language, including error messages and number formatting. This property
overrides the CollationName property.
The default value for this property is blank, which indicates that the CollationName property defines the language.
LogDir
A string property that identifies the name of the directory that contains server logs. This property only applies
when disk files are used for logging, as opposed to database tables (the default behavior).
MaxIdleSessionTimeout
An integer property that defines the maximum idle session timeout, in seconds. The default is zero (0), indicating
that sessions are never timed out. However, idle sessions will still be removed if the server is under resource
constraints.
MinIdleSessionTimeout
An integer property that defines the minimum time, in seconds, that idle sessions will timeout. The default is 2700
seconds. After this time expires, the server is permitted to end the idle session, but will only do so as memory is
needed.
Port
An integer property that defines the port number on which server will listen for client connections. If not set,
server dynamically finds first unused port.
The default value for this property is zero (0), which in turn defaults to port 2383. For more information about port
configuration, see Configure the Windows Firewall to Allow Analysis Services Access.
ServerTimeout
An integer that defines the timeout, in seconds, for queries. The default is 3600 seconds (or 60 minutes). Zero (0)
specifies that no queries will timeout.
TempDir
A string property that specifies the location for storing temporary files used during processing, restoring, and
other operations. The default value for this property is determined by setup. If not specified, the default is the Data
directory.
RequestPrioritization Category
Enabled
An advanced property that you should not change, except under the guidance of Microsoft support.
StatisticsStoreSize
An advanced property that you should not change, except under the guidance of Microsoft support.
See Also
Server Properties in Analysis Services
Determine the Server Mode of an Analysis Services Instance
Lock Manager Properties
12/7/2018 • 2 minutes to read • Edit Online
Properties
DefaultLockTimeoutMS
A signed 32-bit integer property that defines default lock timeout in milliseconds for internal lock requests.
The default value for this property is -1, which indicates there is no timeout for internal lock requests.
LockWaitGranularityMS
An advanced property that you should not change, except under the guidance of Microsoft support.
DeadlockDetectionGranularityMS
An advanced property that you should not change, except under the guidance of Microsoft support.
See Also
Server Properties in Analysis Services
Determine the Server Mode of an Analysis Services Instance
Log Properties
12/7/2018 • 6 minutes to read • Edit Online
NOTE
Not all properties apply to Azure Analysis Services.
General
File
A string property that identifies the name of the server log file. This property only applies when a disk file is used
for logging, as opposed to a database table (the default behavior).
The default value for this property is msmdsrv.log.
FileBufferSize
An advanced property that you should not change, except under the guidance of Microsoft support.
MessageLogs
An advanced property that you should not change, except under the guidance of Microsoft support.
Error Log
You can set these properties at the server instance level to modify the default values for Error Configuration that
appear in other tools and designers. See Error Configuration for Cube, Partition, and Dimension Processing (SSAS
- Multidimensional) and ErrorConfiguration for more information.
ErrorLog\ErrorLogFileName
A property used as a default during processing operation performed by the server.
ErrorLog\ErrorLogFileSize
A property used as a default during processing operation performed by the server.
ErrorLog\KeyErrorAction
Specifies the action taken by the server when a KeyNotFound error occurs. Valid responses to this error include:
ConvertToUnknown tells the server to allocate the error key value to the unknown member.
DiscardRecord tells the server to exclude the record.
ErrorLog\KeyErrorLogFile
This is a user-defined filename that must have a .log file extension, located in a folder on which the service account
has read-write permissions. This log file will only contain errors generated during processing. Use the Flight
Recorder if you require more detailed information.
ErrorLog\KeyErrorLimit
This is the maximum number of data integrity errors that the server will allow before failing the processing. A
value of -1 indicates that there is no limit. The default is 0, which means processing stops after the first error
occurs. You can also set it to a whole number.
ErrorLog\KeyErrorLimitAction
Specifies the action taken by the server when the number of key errors has reached the upper limit. Valid
responses to this action include:
StopProcessing tells the server to stop processing when the error limit is reached.
StopLogging tells the server to stop logging errors when the error limit is reached, but allow processing to
continue.
ErrorLog\ LogErrorTypes\KeyNotFound
Specifies the action taken by the server when a KeyNotFound error occurs. Valid responses to this error include:
IgnoreError tells the server to continue processing without logging the error or counting it towards the key
error limit. By ignoring the error, you simply allow processing to continue without adding to the error count
or logging it to the screen or log file. The record in question has a data integrity problem and cannot be
added to the database. The record will either be discarded or aggregated to Unknown Member, as
determined by the KeyErrorAction property.
ReportAndContinue tells the server to log the error, count it towards the key error limit, and continue
processing. The record triggering the error is discarded or converted to Unknown Member.
ReportAndStop tells the server to log the error and stop processing immediately, regardless of the key
error limit. The record triggering the error is discarded or converted to Unknown Member.
ErrorLog\ LogErrorTypes\KeyDuplicate
Specifies the action taken by the server when a duplicate key is found. Valid values include IgnoreError to
continue processing as if the error did not occur, ReportAndContinue to log the error and continue processing,
and ReportAndStop to log the error and stop processing immediately, even if the error count is below the error
limit.
ErrorLog\ LogErrorTypes\NullKeyConvertedToUnknown
Specifies the action taken by the server when a null key has been converted to Unknown Member. Valid values
include IgnoreError to continue processing as if the error did not occur, ReportAndContinue to log the error
and continue processing, and ReportAndStop to log the error and stop processing immediately, even if the error
count is below the error limit.
ErrorLog\ LogErrorTypes\NullKeyNotAllowed
Specifies the action taken by the server when NullProcessing is set to Error for a dimension attribute. An error is
generated when a null value is not allowed in a given attribute. This error configuration property informs the next
step, which is to report the error and continue processing until the error limit is reached. Valid values include
IgnoreError to continue processing as if the error did not occur, ReportAndContinue to log the error and
continue processing, and ReportAndStop to log the error and stop processing immediately, even if the error
count is below the error limit.
ErrorLog\ LogErrorTypes\CalculationError
A property used as a default during processing operation performed by the server.
ErrorLog\IgnoreDataTruncation
A property used as a default during processing operation performed by the server.
Exception
Exception\CreateAndSendCrashReports
An advanced property that you should not change, except under the guidance of Microsoft support.
Exception\CrashReportsFolder
An advanced property that you should not change, except under the guidance of Microsoft support.
Exception\SQLDumperFlagsOn
An advanced property that you should not change, except under the guidance of Microsoft support.
Exception\SQLDumperFlagsOff
An advanced property that you should not change, except under the guidance of Microsoft support.
Exception\MiniDumpFlagsOn
An advanced property that you should not change, except under the guidance of Microsoft support.
Exception\MinidumpErrorList
An advanced property that you should not change, except under the guidance of Microsoft support.
Flight Recorder
FlightRecorder\Enabled
A Boolean property that indicates whether the flight recorder feature is enabled.
FlightRecorder\FileSizeMB
A signed 32-bit integer property that defines the size of the flight recorder disk file, in megabytes.
FlightRecorder\LogDurationSec
A signed 32-bit integer property that defines the frequency that the flight recorder is rolled over, in seconds.
FlightRecorder\SnapshotDefinitionFile
A string property that defines the name of the snapshot definition file, containing discover commands that are
issued to the server when a snapshot is taken.
The default value for this property is blank, which in turn defaults to file name FlightRecorderSnapshotDef.xml.
FlightRecorder\SnapshotFrequencySec
A signed 32-bit integer property that defines the snapshot frequency, in seconds.
FlightRecorder\TraceDefinitionFile
A string property that specifies the name of the flight recorder trace definition file.
The default value for this property is blank, which in turn defaults to FlightRecorderTraceDef.xml.
Query Log
Applies to: Multidimensional server mode only
QueryLog\QueryLogFileName
A string property that specifies the name of the query log file. This property only applies when a disk file is used
for logging, as opposed to a database table (the default behavior).
QueryLog\QueryLogSampling
A signed 32-bit integer property that specifies the query log sampling rate.
The default value for this property is 10, meaning that 1 out of every 10 server queries is logged.
QueryLog\QueryLogFileSize
An advanced property that you should not change, except under the guidance of Microsoft support.
QueryLog\QueryLogConnectionString
A string property that specifies the connection to the query log database.
QueryLog\QueryLogTableName
A string property that specifies the name of the query log table.
The default value for this property is OlapQueryLog.
QueryLog\CreateQueryLogTable
A Boolean property that specifies whether to create the query log table.
The default value for this property is false, which indicates the server will not automatically create the log table and
will not log query events.
Trace
Trace\TraceBackgroundDistributionPeriod
An advanced property that you should not change, except under the guidance of Microsoft support.
Trace\TraceBackgroundFlushPeriod
An advanced property that you should not change, except under the guidance of Microsoft support.
Trace\TraceFileBufferSize
An advanced property that you should not change, except under the guidance of Microsoft support.
Trace\TraceFileWriteTrailerPeriod
An advanced property that you should not change, except under the guidance of Microsoft support.
Trace\TraceMaxRowsetSize
An advanced property that you should not change, except under the guidance of Microsoft support.
Trace\TraceProtocolTraffic
An advanced property that you should not change, except under the guidance of Microsoft support.
Trace\TraceQueryResponseTextChunkSize
An advanced property that you should not change, except under the guidance of Microsoft support.
Trace\TraceReportFQDN
An advanced property that you should not change, except under the guidance of Microsoft support.
Trace\TraceRequestParameters
An advanced property that you should not change, except under the guidance of Microsoft support.
Trace\TraceRowsetBackgroundFlushPeriod
An advanced property that you should not change, except under the guidance of Microsoft support.
See Also
Server Properties in Analysis Services
Determine the Server Mode of an Analysis Services Instance
Memory Properties
1/15/2019 • 6 minutes to read • Edit Online
SETTING DESCRIPTION
Property reference
The following properties apply to both tabular and multidimensional modes unless specified otherwise.
Values between 1 and 100 represent percentages of Total Physical Memory or Virtual Address Space,
whichever is less. Values over 100 represent memory limits in bytes.
LowMemoryLimit
A signed 64-bit double-precision floating-point number property that defines the first threshold at which Analysis
Services begins releasing memory for low -priority objects, such as an infrequently used cache. Once the memory
is allocated, the server does not release memory below this limit. The default value is 65; which indicates the low
memory limit is 65% of physical memory or the virtual address space, whichever is less.
TotalMemoryLimit
Defines a threshold that when reached, causes the server to deallocate memory to make room for other requests.
When this limit is reached, the instance will start to slowly clear memory out of caches by closing expired sessions
and unloading unused calculations. The default value 80% of physical memory or the virtual address space,
whichever is less. TotalMemoryLimit must always be less than HardMemoryLimit
HardMemoryLimit
Specifies a memory threshold after which the instance aggressively terminates active user sessions to reduce
memory usage. All terminated sessions will receive an error about being canceled by memory pressure. The
default value, zero (0), means the HardMemoryLimit will be set to a midway value between TotalMemoryLimit
and the total physical memory of the system; if the physical memory of the system is larger than the virtual
address space of the process, then virtual address space will be used instead to calculate HardMemoryLimit.
QueryMemoryLimit
Azure Analysis Services only. An advanced property to control how much memory can be used by temporary
results during a query. Applies only to DAX measures and queries. It does not account for general memory
allocations used by the query. Specified in percentage, the default value is determined by your plan.
PLAN DEFAULT
D1 80
SETTING DESCRIPTION
When set to 1, processing is less likely to fail due to memory constraints because the server will try to page to disk
using the method that you specified. Setting the VertiPaqPagingPolicy property does not guarantee that
memory errors will never happen. Out of memory errors can still occur under the following conditions:
There is not enough memory for all dictionaries. During processing, the server locks the dictionaries for
each column in memory, and all of these together cannot be more than the value specified for
VertiPaqMemoryLimit.
There is insufficient virtual address space to accommodate the process.
To resolve persistent out of memory errors, you can either try to redesign the model to reduce the amount of data
that needs processing, or you can add more physical memory to the computer.
VertiPaqMemoryLimit
For tabular instances only, if paging to disk is allowed, this property specifies the level of memory consumption
(as a percentage of total memory) at which paging starts. The default is 60. If memory consumption is less than 60
percent, the server will not page to disk. This property depends on the VertiPaqPagingPolicyProperty, which
must be set to 1 in order for paging to occur.
HighMemoryPrice
An advanced property that you should not change, except under the guidance of Microsoft support.
MemoryHeapType
An advanced property that you should not change, except under the guidance of Microsoft support. Valid values in
SQL Server 2016 SP1 and later Analysis Services are as follows:
SETTING DESCRIPTION
2 Windows LFH.
5 Hybrid allocator. This allocator will use Windows LFH for <=
16 KB allocations and the AS Heap for >16 KB allocations.
HeapTypeForObjects
An advanced property that you should not change, except under the guidance of Microsoft support. Valid values
are as follows:
SETTING DESCRIPTION
DefaultPagesCountToReuse
An advanced property that you should not change, except under the guidance of Microsoft support.
HandleIA64AlignmentFaults
An advanced property that you should not change, except under the guidance of Microsoft support.
MidMemoryPrice
An advanced property that you should not change, except under the guidance of Microsoft support.
MinimumAllocatedMemory
An advanced property that you should not change, except under the guidance of Microsoft support.
PreAllocate
An advanced property that you should not change, except under the guidance of Microsoft support.
SessionMemoryLimit
An advanced property that you should not change, except under the guidance of Microsoft support.
WaitCountIfHighMemory
An advanced property that you should not change, except under the guidance of Microsoft support.
See Also
Server Properties in Analysis Services
Determine the Server Mode of an Analysis Services Instance
Network Properties
12/7/2018 • 2 minutes to read • Edit Online
General
ListenOnlyOnLocalConnections
A Boolean property that identifies whether to listen only on local connections, for example localhost.
Listener
IPV4Support
A signed 32-bit integer property that defines support for IPv4 protocol. This property has one of the values listed
in the following table:
VALUE DESCRIPTION
IPV6Support
A signed 32-bit integer property that defines support for IPv6 protocol. This property has one of the values listed
in the following table:
VALUE DESCRIPTION
MaxAllowedRequestSize
An advanced property that you should not change, except under the guidance of Microsoft support.
RequestSizeThreshold
An advanced property that you should not change, except under the guidance of Microsoft support.
ServerReceiveTimeout
An advanced property that you should not change, except under the guidance of Microsoft support.
ServerSendTimeout
An advanced property that you should not change, except under the guidance of Microsoft support.
Requests
EnableBinaryXML
A Boolean property that specifies whether the server will recognize requests binary xml format.
EnableCompression
A Boolean property that specifies whether compression is enabled for requests.
Responses
CompressionLevel
An advanced property that you should not change, except under the guidance of Microsoft support.
EnableBinaryXML
A Boolean property that specifies whether the server is enabled for binary xml responses.
EnableCompression
A Boolean property that specifies whether compression is enabled for responses to client requests.
TCP
InitialConnectTimeout
An advanced property that you should not change, except under the guidance of Microsoft support.
MaxCompletedReceiveCount
An advanced property that you should not change, except under the guidance of Microsoft support.
MaxPendingAcceptExCount
An advanced property that you should not change, except under the guidance of Microsoft support.
MaxPendingReceiveCount
An advanced property that you should not change, except under the guidance of Microsoft support.
MaxPendingSendCount
An advanced property that you should not change, except under the guidance of Microsoft support.
MinPendingAcceptExCount
An advanced property that you should not change, except under the guidance of Microsoft support.
MinPendingReceiveCount
An advanced property that you should not change, except under the guidance of Microsoft support.
ScatterReceiveMultiplier
An advanced property that you should not change, except under the guidance of Microsoft support.
SocketOptions\ DisableNonblockingMode
An advanced property that you should not change, except under the guidance of Microsoft support.
SocketOptions\ EnableLingerOnClose
An advanced property that you should not change, except under the guidance of Microsoft support.
SocketOptions\EnableNagleAlgorithm
An advanced property that you should not change, except under the guidance of Microsoft support.
SocketOptions\ LingerTimeout
An advanced property that you should not change, except under the guidance of Microsoft support.
SocketOptions\ ReceiveBufferSize
An advanced property that you should not change, except under the guidance of Microsoft support.
SocketOptions\ SendBufferSize
An advanced property that you should not change, except under the guidance of Microsoft support.
See Also
Server Properties in Analysis Services
Determine the Server Mode of an Analysis Services Instance
OLAP Properties
12/7/2018 • 12 minutes to read • Edit Online
Memory
DefaultPageSizeForData
An advanced property that you should not change, except under the guidance of Microsoft support.
DefaultPageSizeForDataHeader
An advanced property that you should not change, except under the guidance of Microsoft support.
DefaultPageSizeForIndex
An advanced property that you should not change, except under the guidance of Microsoft support.
DefaultPageSizeForIndexHeader
An advanced property that you should not change, except under the guidance of Microsoft support.
DefaultPageSizeForString
An advanced property that you should not change, except under the guidance of Microsoft support.
DefaultPageSizeForHash
An advanced property that you should not change, except under the guidance of Microsoft support.
DefaultPageSizeForProp
An advanced property that you should not change, except under the guidance of Microsoft support.
LazyProcessing
Enabled
A Boolean property that specifies whether lazy aggregation processing is enabled.
SleepIntervalSecs
A signed 32-bit integer property that defines the interval, in seconds, that the server checks whether there are lazy
processing jobs pending.
MaxCPUUsage
A signed 64-bit double-precision floating-point number property that defines maximum CPU usage for lazy
processing, expressed as a percentage. The server monitors average CPU use based on snapshots. It is normal
behavior for the CPU to spike above this threshold.
The default value for this property is 0.5, indicating a maximum of 50% of the CPU will be devoted to lazy
processing.
MaxObjectsInParallel
A signed 32-bit integer property that specifies the maximum number of partitions that can be lazily processed in
parallel.
MaxRetries
A signed 32-bit integer property that defines the number of retries in the event that lazy processing fails before an
error is raised.
ProcessPlan
CacheRowsetRows
An advanced property that you should not change, except under the guidance of Microsoft support.
CacheRowsetToDisk
An advanced property that you should not change, except under the guidance of Microsoft support.
DistinctBuffer
A signed 32-bit integer property that defines the size of an internal buffer used for distinct counts. Increase this
value to speed up distinct count processing at the cost of memory use.
EnableRolapDimQueryTableGrouping
A Boolean property that specifies whether table grouping is enabled for ROLAP dimensions. If True, when
querying ROLAP dimensions at runtime, entire ROLAP dimension tables are queried at once, as opposed to
separate queries for each attribute.
EnableTableGrouping
A Boolean property that specifies whether table grouping is enabled. If True, when processing dimensions, entire
dimension tables are queried at once, as opposed to separate queries for each attribute.
ForceMultiPass
An advanced property that you should not change, except under the guidance of Microsoft support.
MaxTableDepth
An advanced property that you should not change, except under the guidance of Microsoft support.
MemoryAdjustConst
An advanced property that you should not change, except under the guidance of Microsoft support.
MemoryAdjustFactor
An advanced property that you should not change, except under the guidance of Microsoft support.
MemoryLimit
A signed 64-bit double-precision floating-point number property that defines the maximum amount of memory
to be devoted to processing, expressed as a percentage of physical memory.
The default value for this property is 65, indicating that 65% of physical memory may be devoted to cube and
dimension processing.
MemoryLimitErrorEnabled
An advanced property that you should not change, except under the guidance of Microsoft support.
OptimizeSchema
An advanced property that you should not change, except under the guidance of Microsoft support.
ProactiveCaching
DefaultRefreshInterval
An advanced property that you should not change, except under the guidance of Microsoft support.
DimensionLatencyAccuracy
An advanced property that you should not change, except under the guidance of Microsoft support.
PartitionLatencyAccuracy
An advanced property that you should not change, except under the guidance of Microsoft support.
Process
AggregationMemoryLimitMax
A signed 64-bit double-precision floating-point number property that defines the maximum amount of memory
that can be devoted to aggregation processing, expressed as a percentage of physical memory.
The default value for this property is 80, indicating that 80% of physical memory may be devoted to aggregation
processing.
AggregationMemoryLimitMin
A signed 64-bit double-precision floating-point number property that defines the minimum amount of memory
that can be devoted to aggregation processing, expressed as a percentage of physical memory. A larger value may
speed up aggregation processing at the cost of memory usage.
The default value for this property is 10, indicating that minimally 10% of physical memory will be devoted to
aggregation processing.
AggregationNewAlgo
An advanced property that you should not change, except under the guidance of Microsoft support.
AggregationPerfLog2
An advanced property that you should not change, except under the guidance of Microsoft support.
AggregationsBuildEnabled
A Boolean property that specifies whether aggregation building is enabled. This is a mechanism to benchmark
aggregation building without changing aggregation design.
BufferMemoryLimit
A signed 64-bit double-precision floating-point number property that defines the processing buffer memory limit,
expressed as a percent of physical memory.
The default value for this property is 60, which indicates that up to 60% of physical memory can be used for
buffer memory.
BufferRecordLimit
A signed 32-bit integer property that defines the number of records that can be buffered during processing.
The default value for this property is 1048576 (records).
CacheRecordLimit
An advanced property that you should not change, except under the guidance of Microsoft support.
CheckDistinctRecordSortOrder
A Boolean property that defines if the sort order for the results of a distinct count query are meaningful when
processing partitions. True indicates the sort order is not meaningful and must be "checked" by the server. When
processing partitions with distinct count measure, query sent to SQL with order-by. Set to false to speed up
processing.
The default value for this property is True, which indicates that the sort order is not meaningful and must be
checked.
DatabaseConnectionPoolConnectTimeout
A signed 32-bit integer property that specifies timeout when opening a new connection in seconds.
DatabaseConnectionPoolGeneralTimeout
A signed 32-bit integer property that specifies database connection timeout for use with external OLEDB
connections in seconds.
DatabaseConnectionPoolMax
A signed 32-bit integer property that specifies the maximum number of pooled database connections.
The default value for this property is 50 (connections).
DatabaseConnectionPoolTimeout
An advanced property that you should not change, except under the guidance of Microsoft support.
DataFileInitEnabled
An advanced property that you should not change, except under the guidance of Microsoft support.
DataPlacementOptimization
An advanced property that you should not change, except under the guidance of Microsoft support.
DataSliceInitEnabled
An advanced property that you should not change, except under the guidance of Microsoft support.
DeepCompressValue
A Boolean property applying to measures with Double data type that specifies whether numbers can be
compressed, causing a loss in numeric precision. A value of False indicates no compression and no precision loss.
The default value for this property is True, which indicates that compression is enabled and precision will be lost.
DimensionPropertyKeyCache
A Boolean property that specifies whether dimension property keys are cached. Must be set to True if keys are
non-unique.
IndexBuildEnabled
A Boolean property that specifies whether indexes are built upon processing. This property is for benchmarking
and informational purposes.
IndexBuildThreshold
A signed 32-bit integer property that specifies a row count threshold below which indexes will not be built for
partitions.
The default value for this property is 4096 (rows).
IndexFileInitEnabled
An advanced property that you should not change, except under the guidance of Microsoft support.
MapFormatMask
An advanced property that you should not change, except under the guidance of Microsoft support.
RecordsReportGranularity
A signed 32-bit integer property that specifies how often the server records Trace events during processing, in
rows.
The default value for this property is 1000, which indicates that a Trace event is logged once every 1000 rows.
ROLAPDimensionProcessingEffort
An advanced property that you should not change, except under the guidance of Microsoft support.
Query
AggregationsUseEnabled
A Boolean property that defines whether stored aggregations are used at runtime. This property allows
aggregations to be disabled without changing the aggregation design or re-processing, for informational and
benchmarking purposes.
The default value for this property is True, indicating that aggregations are enabled.
AllowSEFiltering
An advanced property that you should not change, except under the guidance of Microsoft support.
CalculationCacheRegistryMaxIterations
An advanced property that you should not change, except under the guidance of Microsoft support.
CalculationEvaluationPolicy
An advanced property that you should not change, except under the guidance of Microsoft support.
ConvertDeletedToUnknown
A Boolean property that specifies whether deleted dimension members are converted to Unknown member.
CopyLinkedDataCacheAndRegistry
An advanced property that you should not change, except under the guidance of Microsoft support.
DataCacheRegistryMaxIterations
An advanced property that you should not change, except under the guidance of Microsoft support.
DefaultDrillthroughMaxRows
A signed 32-bit integer property that specifies the maximum number of rows that will return from a drill-through
query.
The default value for this property is 10000 (rows).
DimensionPropertyCacheSize
A signed 32-bit integer property that specifies the amount of memory (in bytes) used to cache dimension
members used in a query.
The default is 4,000,000 bytes (or 4 MB ) per attribute hierarchy, per active query. The default value provides a
well-balanced cache size for solutions having typical hierarchies. However, dimensions with a very large number
of members (in the millions) or deep hierarchies perform better if you increase this value.
Implications of increasing cache size:
Memory utilization costs increase when you allow more memory to be used by the dimension cache.
Actual usage depends on query execution. Not all queries will use the allowable maximum.
Note that the memory used by these caches is considered nonshrinkable and will be included when
accounting against the TotalMemoryLimit.
Affects all databases on the server. DimensionPropertyCachesize is a server-wide property. Changing
this property affects all databases running on the current instance.
Approach for estimating dimension cache requirements:
1. Start by increasing the size by a large number to determine whether there is a benefit to increasing the
dimension cache size. For example, you might want to double the default value as an initial step.
2. If a performance improvement is evident, incrementally reduce the value until you reach a balance between
performance and memory utilization.
ExpressNonEmptyUseEnabled
An advanced property that you should not change, except under the guidance of Microsoft support.
IgnoreNullRolapRows
An advanced property that you should not change, except under the guidance of Microsoft support.
IndexUseEnabled
A Boolean property that defines whether indexes are used at runtime. This property is for informational and
benchmarking purposes.
MapHandleAlgorithm
An advanced property that you should not change, except under the guidance of Microsoft support.
MaxRolapOrConditions
An advanced property that you should not change, except under the guidance of Microsoft support.
UseCalculationCacheRegistry
An advanced property that you should not change, except under the guidance of Microsoft support.
UseDataCacheFreeLastPageMemory
An advanced property that you should not change, except under the guidance of Microsoft support.
UseDataCacheRegistry
A Boolean property that specifies whether to enable the data cache registry, where query results are cached
(though not calculated results).
UseDataCacheRegistryHashTable
An advanced property that you should not change, except under the guidance of Microsoft support.
UseDataCacheRegistryMultiplyKey
An advanced property that you should not change, except under the guidance of Microsoft support.
UseDataSlice
A Boolean property that defines whether to use partition data slices at runtime for query optimization. This
property is for benchmarking and informational purposes.
UseMaterializedIterators
An advanced property that you should not change, except under the guidance of Microsoft support.
UseSinglePassForDimSecurityAutoExist
An advanced property that you should not change, except under the guidance of Microsoft support.
UseVBANet
A Boolean property that defines whether to use the VBA .net assembly for user-defined functions.
CalculationPrefetchLocality\ ApplyIntersect
An advanced property that you should not change, except under the guidance of Microsoft support.
CalculationPrefetchLocality\ ApplySubtract
An advanced property that you should not change, except under the guidance of Microsoft support.
CalculationPrefetchLocality\ PrefetchLowerGranularities
An advanced property that you should not change, except under the guidance of Microsoft support.
DataCache\ CachedPageAlloc\ Income
An advanced property that you should not change, except under the guidance of Microsoft support.
DataCache\ CachedPageAlloc\ InitialBonus
An advanced property that you should not change, except under the guidance of Microsoft support.
DataCache\ CachedPageAlloc\ MaximumBalance
An advanced property that you should not change, except under the guidance of Microsoft support.
DataCache\ CachedPageAlloc\ MinimumBalance
An advanced property that you should not change, except under the guidance of Microsoft support.
DataCache\ CachedPageAlloc\ Tax
An advanced property that you should not change, except under the guidance of Microsoft support.
DataCache\CellStore\ Income
An advanced property that you should not change, except under the guidance of Microsoft support.
DataCache\CellStore\ InitialBonus
An advanced property that you should not change, except under the guidance of Microsoft support.
DataCache\CellStore\ MaximumBalance
An advanced property that you should not change, except under the guidance of Microsoft support.
DataCache\CellStore\ MinimumBalance
An advanced property that you should not change, except under the guidance of Microsoft support.
DataCache\CellStore\ Tax
An advanced property that you should not change, except under the guidance of Microsoft support.
DataCache\ MemoryModel \ Income
An advanced property that you should not change, except under the guidance of Microsoft support.
DataCache\ MemoryModel \ InitialBonus
An advanced property that you should not change, except under the guidance of Microsoft support.
DataCache\ MemoryModel \ MaximumBalance
An advanced property that you should not change, except under the guidance of Microsoft support.
DataCache\ MemoryModel \ MinimumBalance
An advanced property that you should not change, except under the guidance of Microsoft support.
DataCache\ MemoryModel\ Tax
An advanced property that you should not change, except under the guidance of Microsoft support.
Jobs
ProcessAggregation\ MemoryModel\ Income
An advanced property that you should not change, except under the guidance of Microsoft support.
ProcessAggregation\ MemoryModel\ InitialBonus
An advanced property that you should not change, except under the guidance of Microsoft support.
ProcessAggregation\ MemoryModel\ MaximumBalance
An advanced property that you should not change, except under the guidance of Microsoft support.
ProcessAggregation\ MemoryModel\ MinimumBalance
An advanced property that you should not change, except under the guidance of Microsoft support.
ProcessAggregation\ MemoryModel\ Tax
An advanced property that you should not change, except under the guidance of Microsoft support.
ProcessAggregation\ ProcessPartition\ Income
An advanced property that you should not change, except under the guidance of Microsoft support.
ProcessAggregation\ ProcessPartition \ InitialBonus
An advanced property that you should not change, except under the guidance of Microsoft support.
ProcessAggregation\ ProcessPartition \ MaximumBalance
An advanced property that you should not change, except under the guidance of Microsoft support.
ProcessAggregation\ ProcessPartition \ MinimumBalance
An advanced property that you should not change, except under the guidance of Microsoft support.
ProcessAggregation\ ProcessPartition \ Tax
An advanced property that you should not change, except under the guidance of Microsoft support.
ProcessAggregation\ ProcessProperty\ Income
An advanced property that you should not change, except under the guidance of Microsoft support.
ProcessAggregation\ ProcessProperty\ InitialBonus
An advanced property that you should not change, except under the guidance of Microsoft support.
ProcessAggregation\ ProcessProperty\ MaximumBalance
An advanced property that you should not change, except under the guidance of Microsoft support.
ProcessAggregation\ ProcessProperty\ MinimumBalance
An advanced property that you should not change, except under the guidance of Microsoft support.
ProcessAggregation\ ProcessProperty\ Tax
An advanced property that you should not change, except under the guidance of Microsoft support.
See Also
Server Properties in Analysis Services
Determine the Server Mode of an Analysis Services Instance
Security Properties
12/7/2018 • 2 minutes to read • Edit Online
Properties
RequireClientAuthentication
A Boolean property that indicates whether client authentication is required.
The default value for this property is True, which indicates that client authentication is required.
SecurityPackageList
A string property that contains a comma-separated list of SSPI packages used by server for client authentication.
DisableClientImpersonation
A Boolean property that indicates whether client impersonation (for example, from stored procedures) is disabled.
The default value for this property is False, which indicates that client impersonation is enabled.
BuiltinAdminsAreServerAdmins
A Boolean property that indicates whether members of the local machine administrators group are Analysis
Services administrators.
ServiceAccountIsServerAdmin
A Boolean property that indicates whether the service account is a server administrator.
The default value for this property is True, which indicates that the service account is a server administrator.
ErrorMessageMode
An advanced property that you should not change, except under the guidance of Microsoft support.
DataProtection\ RequiredProtectionLevel
A signed 32-bit integer property that defines the required protection level for all client requests. This property has
one of the values listed in the following table.
VALUE DESCRIPTION
AdministrativeDataProtection\ RequiredProtectionLevel
An advanced property that you should not change, except under the guidance of Microsoft support.
See Also
Server Properties in Analysis Services
Determine the Server Mode of an Analysis Services Instance
Thread Pool Properties
1/28/2019 • 29 minutes to read • Edit Online
NOTE
Tabular deployment on NUMA systems is out of scope for this topic. Although tabular solutions can be successfully
deployed on NUMA systems, the performance characteristics of the in-memory database technology used by tabular
models may show limited benefits on a highly scaled up architectures. For more information, see Analysis Services Case
Study: Using Tabular Models in Large-scale Commercial Solutions and Hardware Sizing a Tabular Solution.
NOTE
A thread from either parsing pool can be used to execute a query. Queries that execute quickly, such as a fast
Discover or Cancel request, are sometimes executed immediately rather than queued to the Query thread pool.
ThreadPool \ Query is the thread pool that executes all requests that are not handled by the parsing
thread pool. Threads in this thread pool will execute all types of operations, such as Discovers, MDX, DAX,
DMX, and DDL commands. A
ThreadPool \ IOProcess is used for IO jobs associated with storage engine queries in the
multidimensional engine. The work done by these threads is expected to not have dependencies on other
threads. These threads will typically be scanning a single segment of a partition and performing filtering
and aggregation on the segment data. IOProcess threads are particularly sensitive to NUMA hardware
configurations. As such, this thread pool has the PerNumaNode configuration property which can be used
to tune the performance if needed.
ThreadPool \ Process is for longer duration storage engine jobs, including aggregations, indexing, and
commit operations. ROLAP storage mode also uses threads from the Processing thread pool.
VertiPaq \ ThreadPool is the thread pool for executing table scans in a tabular model.
To service requests, Analysis Services may exceed the maximum thread pool limit, requesting additional threads if
they are necessary to perform the work. However, when a thread finishes executing its task, if the current count of
threads is greater than the maximum limit, the thread is simply ended, rather than returned to the thread pool.
NOTE
Exceeding the maximum thread pool count is a protection invoked only when certain deadlock conditions arise. To prevent
runaway thread creation beyond the maximum, threads are created gradually (after a short delay) after the maximum limit
has been reached. Exceeding maximum thread count can lead to a slowdown in task execution. If the performance counters
show the thread counts are regularly beyond the thread pool maximum size, you might consider that as an indicator that
thread pool sizes are too small for the degree of concurrency being requested from the system.
By default, thread pool size is determined by Analysis Services, and is based on the number of cores. You can
observe the selected default values by examining the msmdsrv.log file after server startup. As a performance
tuning exercise, you might choose to increase the size of the thread pool, as well as other properties, to improve
query or processing performance.
Applies to
multidimensional
models only.
Applies to
multidimensional
models only.
NAME TYPE DESCRIPTION DEFAULT GUIDANCE
More information
about tuning the
thread pool settings
can be found in the
Analysis Services
Operations Guide.
Applies to
multidimensional
models only.
NAME TYPE DESCRIPTION DEFAULT GUIDANCE
More information
about tuning the
thread pool settings
can be found in the
Analysis Services
Operations Guide.
Applies to
multidimensional
models only.
NAME TYPE DESCRIPTION DEFAULT GUIDANCE
0 = Disables per
NUMA node thread
pools so that there is
only one IOProcess
thread pool used by
the msmdsrv.exe
process.
1 = Enables one
IOProcess thread pool
per NUMA node.
2 = One IOProcess
thread pool per
logical processor.
Threads in each
thread pool are
affinitized to the
NUMA node of the
logical processor, with
the ideal processor
set to the logical
processor.
See Set
PerNumaNode to
affinitize IO threads to
processors in a
NUMA node for
details.
Applies to
multidimensional
models only.
NAME TYPE DESCRIPTION DEFAULT GUIDANCE
Applies to
multidimensional
models only.
More information
about tuning the
thread pool settings
can be found in the
Analysis Services
Operations Guide.
NAME TYPE DESCRIPTION DEFAULT GUIDANCE
More information
about tuning the
thread pool settings
can be found in the
Analysis Services
Operations Guide.
More information
about tuning the
thread pool settings
can be found in the
Analysis Services
Operations Guide.
NAME TYPE DESCRIPTION DEFAULT GUIDANCE
More information
about tuning the
thread pool settings
can be found in the
Analysis Services
Operations Guide.
NOTE
GroupAffinity is constrained by editions that limit the number of cores used by Analysis Services. At startup, Analysis
Services uses edition information and the GroupAffinity properties to compute affinity masks for each thread pool
managed by Analysis Services. Standard edition can use a maximum of 24 cores. If you install Analysis Services standard
edition on a large multi-core system that has more than 24 cores, Analysis Services will only use 24 of them. For more
information about processor maximums, see the cross-box scale limits in Features by editions in SQL Server.
Syntax
The value is hexadecimal for each processor group, with the hexadecimal representing the logical processors that
Analysis Services attempts to use first when allocating threads for a given thread pool.
Bitmask for Logical Processors
You can have up to 64 logical processors within a single processor group. The bitmask is 1 (or 0) for each logical
processor in the group that is used (or not used) by a thread pool. Once you compute the bitmask, you then
calculate the hexadecimal value as the value for GroupAffinity.
Multiple processor groups
Processor groups are determined on system startup. GroupAffinity accepts hexadecimal values for each
processor group in a comma delimited list. Given multiple processor groups (up to 10 on higher end systems),
you can bypass individual groups by specifying 0x0. For example, on a system with four processor groups (0, 1, 2,
3), you could exclude groups 0 and 2 by entering 0x0 for the first and third values.
<GroupAffinity>0x0, 0xFF, 0x0, 0xFF</GroupAffinity>
The example shows only 8 processors (0 through 7), but a processor group can have a maximum of 64
logical processors, and there can be up to 10 processor groups in an enterprise-class Windows server.
3. Compute the bitmask for the processor groups you want to use
7654 3210
Replace the number with a 0 or 1, depending on whether you want to exclude or include the logical
processor. On a system having eight processors, your calculation might look like this if you wanted to use
processors 7, 6, 5, 4, and 1 for Analysis Services:
1111 0010
IMPORTANT
Setting GroupAffinity is a manual task encompassing multiple steps. When computing GroupAffinity, check your
calculations carefully. Although Analysis Services will return an error if the entire mask is invalid, a combination of valid and
invalid settings results in Analysis Services ignoring the property. For example, if the bitmask includes extra values, Analysis
Services ignores the setting, using all processors on the system. There is no error or warning to alert you when this action
occurs, but you can check the msmdsrv.log file to learn how the affinities are actually set.
Valid values for PerNumaNode are -1, 0, 1, 2, as described in the Thread Pool Property Reference section in this
topic.
Default (Recommended)
On systems having NUMA nodes, we recommend using the default setting of PerNumaNode=-1, allowing
Analysis Services to adjust the number of thread pools and their thread affinity based on node count. If the system
has fewer than 4 nodes, Analysis Services implements the behaviors described by PerNumaNode=0, whereas
PerNumaNode=1 is used on systems having 4 or more nodes.
Choosing a value
You can also override the default to use another valid value.
Setting PerNumaNode=0
NUMA nodes are ignored. There will be just one IOProcess thread pool, and all threads in that thread pool will be
affinitized to all logical processors. By default (where PerNumaNode=-1), this is the operative setting if the
computer has fewer than 4 NUMA nodes.
Setting PerNumaNode=1
IOProcess thread pools are created for each NUMA node. Having separate thread pools improves coordinated
access to local resources, such as local cache on a NUMA node.
Setting PerNumaNode=2
This setting is for very high-end systems running intensive Analysis Services workloads. This property sets
IOProcess thread pool affinity at its most granular level, creating and affinitizing separate thread pools at the
logical processor level.
In the following example, on a system having 4 NUMA nodes and 32 logical processors, setting PerNumaNode
to 2 would result in 32 IOProcess thread pools. The threads in the first 8 thread pools would be affinitized to all
the logical processors in the NUMA node 0, but with the ideal processor set to 0, 1, 2, up to 7. The next 8 thread
pools would be affinitized to all the logical processors in NUMA node 1, with the ideal processor set to 8, 9, 10, up
to 15, and so on.
At this level of affinity, the scheduler always attempts to use the ideal logical processor first, within the preferred
NUMA node. If the logical processor is unavailable, the scheduler chooses another processor within the same
node, or within the same processor group if no other threads are available. For more information and examples,
see Analysis Services 2012 Configuration settings (Wordpress Blog).
Work distribution among IOProcess threads
As you consider whether to set the PerNumaNode property, knowing how IOProcess threads are used can help
you make a more informed decision.
Recall that IOProcess is used for IO jobs associated with storage engine queries in the multidimensional engine.
When a segment is scanned, the engine identifies the partition to which the segment belongs, and attempts to
queue the segment job to the thread pool used by the partition. In general, all segments belonging to a partition
will queue their tasks to the same thread pool. On NUMA systems, this behavior is particularly advantageous
because all scans for a partition will use memory in the file system cache that is allocated locally to that NUMA
node.
The following scenarios suggest adjustments that can sometimes improve query performance on NUMA systems:
For measure groups that are under-partitioned (for example, having a single partition), increase the
number of partitions. Using just one partition will cause the engine to always queue tasks to one thread
pool (thread pool 0). Adding more partitions allows the engine to use additional thread pools.
Alternatively, if you cannot create additional partitions, try setting PerNumaNode=0 as a way to increase
the number of threads available to thread pool 0.
For databases in which segment scans are evenly distributed across multiple partitions, setting
PerNumaNode to 1 or 2 can improve query performance because it increases the overall number of
IOProcess thread pools used by the system.
For solutions that have multiple partitions, but only one is heavily scanned, try setting PerNumaNode=0
to see if it improves performance.
Although both partition and dimension scans use the IOProcess thread pool, dimension scans only use thread
pool 0. This can result in a slightly uneven load on that thread pool, but the imbalance should be temporary, as
dimension scans tend to be very fast and infrequent.
NOTE
When changing a server property, remember that the configuration option applies to all databases running on the current
instance. Choose settings that benefit the most important databases, or the greatest number of databases. You cannot set
processor affinity at the database level, nor can you set affinity between individual partitions and specific processors.
For more information about job architecture, see section 2.2 in SQL Server Analysis Services Performance Guide.
Recall that the algorithm for setting MinThread and MaxThread incorporates system configuration, particularly
the number of processors. The following blog post offers insights into how the values are calculated: Analysis
Services 2012 Configuration settings (Wordpress Blog). Note that these settings and behaviors are subject to
adjustment in subsequent releases.
The following list shows examples of other affinity mask settings, for different combinations of processors:
Affinity for processors 3-2-1-0 on an 8 core system results in this bitmask: 00001111, and a hexadecimal
value: 0xF
Affinity for processors 7-6-5-4 on an 8 core system results in this bitmask: 11110000, and a hexadecimal
value: 0xF0
Affinity for processors 5-4-3-2 on an 8 core system results in this bitmask: 00111100, and a hexadecimal
value: 0x3C
Affinity for processors 7-6-1-0 on an 8 core system results in this bitmask: 11000011, and a hexadecimal
value: 0xC3
Recall that on systems having multiple processor groups, a separate affinity mask is generated for each group, in a
comma separated list.
About MSMDSRV.INI
The msmdsrv.ini file contains configuration settings for an Analysis Services instance, affecting all databases
running on that instance. You cannot use server configuration properties to optimize performance of just one
database to the exclusion of all others. However, you can install multiple instances of Analysis Services and
configure each instance to use properties that benefit databases sharing similar characteristics or workloads.
All server configuration properties are included in the msmdsrv.ini file. Subsets of the properties more likely to be
modified also appear in administration tools, such as SSMS.
The contents of msmdsrv.ini are identical for both Tabular and Multidimensional instances of Analysis Services.
However, some settings apply to one mode only. Differences in behavior based on server mode are noted in
property reference documentation.
NOTE
For instructions on how to set properties, see Server Properties in Analysis Services.
See Also
About Processes and Threads
Multiple Processors
Processor Groups
Analysis Services Thread Pool Changes in SQL Server 2012
Analysis Services 2012 Configuration settings (Wordpress Blog)
Supporting Systems That Have More Than 64 Processors
SQL Server Analysis Services Operations Guide
Monitoring overview
1/28/2019 • 2 minutes to read • Edit Online
Monitoring tools
TOOL DESCRIPTION
SQL Server Profiler Tracks engine process events. It also captures data about
those events, enabling you to monitor server and database
activity.
Dynamic Management Views (DMVs) Queries that return information about model objects, server
operations, and server health. The query, based on SQL, is an
interface to schema rowsets.
Performance counters* Using Performance Monitor, you can monitor the performance
of a Microsoft SQL Server Analysis Services (SSAS) instance by
using performance counters.
Log operations* A SQL Server Analysis Services instance will log server
notifications, errors, and warnings to the msmdsrv.log file -
one for each instance you install.
See also
Monitor Azure Analysis Services server metrics
Setup diagnostic logging for Azure Analysis Services
Use SQL Server Profiler to Monitor Analysis Services
11/15/2018 • 2 minutes to read • Edit Online
In This Section
TOPIC DESCRIPTION
Introduction to Monitoring Analysis Services with SQL Server Describes how to use SQL Server Profiler to monitor an
Profiler Analysis Services instance.
Create Profiler Traces for Replay (Analysis Services) Describes the requirements for creating a trace for replay by
using SQL Server Profiler.
Analysis Services Trace Events Describes Analysis Services event classes. These event classes
map to actions generated by Analysis Services and are used
for trace replays.
Introduction to Monitoring Analysis Services with
SQL Server Profiler
1/8/2019 • 2 minutes to read • Edit Online
NOTE
Passwords are not revealed in trace events, but are replaced by ****** in the event.
For optimal performance, use SQL Server Profiler to monitor only those events in which you are most interested.
Monitoring too many events adds overhead and can cause the trace file or table to grow very large, especially
when you monitor over a long period of time. In addition, use filtering to limit the amount of data that is collected
and to prevent traces from becoming too large.
See Also
Analysis Services Trace Events
Create Profiler Traces for Replay (Analysis Services)
Create Profiler Traces for Replay (Analysis Services)
10/26/2018 • 2 minutes to read • Edit Online
See Also
Analysis Services Trace Events
Introduction to Monitoring Analysis Services with SQL Server Profiler
Monitor Analysis Services with SQL Server Extended
Events
11/28/2018 • 4 minutes to read • Edit Online
NOTE
Watch this quick video introduction or read the supporting blog post to learn more about xEvents for Analysis Services in
SQL Server 2016.
Choose Events
If you already know which events you want to capture, searching for them is the easiest way to add them to the
trace. Otherwise, the following events are commonly used for monitoring operations:
CommandBegin and CommandEnd.
QueryBegin, QueryEnd, and QuerySubcubeVerbose (shows the entire MDX or DAX query sent to the
server), plus ResourceUsage for stats on resources consumed by the query and how many rows are
returned.
ProgressReportBegin and ProgressReportEnd (for processing operations).
AuditLogin and AuditLogout (captures the user identity under which a client application connects to
Analysis Services).
Choose Data Storage
A session can be streamed live to a window in Management Studio or persisted to a file for subsequent analysis
using Power Query or Excel.
event_file stores session data in an .xel file.
event_stream enables the Watch Live Data option in Management Studio.
ring_buffer stores session data in memory for as long as the server is running. On a server restart, the
session data is thrown out
Add Event Fields
Be sure to configure the session to include event fields so that you can easily see information of interest.
Configure is an option on the far side of the dialog box.
In configuration, on the Event Fields tab, select TextData so that this field appears adjacent to the event, showing
return values, including queries that are executing on the server.
After you configure a session for the desired events and data storage, you can click the script button to send your
configuration to one of supported destinations including a file, a new query in SQL Server Management Studio,
and the clipboard.
Refresh Sessions
Once you create the session, be sure to refresh the Sessions folder in Management Studio to see the session you
just created. If you configured an event_stream, you can right-click the session name and choose Watch Live
Data to monitor server activity in real time.
Where the following elements are to be defined by the user, depending on the tracing needs:
trace_id
Defines the unique identifier for this trace.
trace_name
The name given to this trace; usually a human readable definition of the trace. It is a common practice to use the
trace_id value as the name.
AS_event
The Analysis Services event to be exposed. See Analysis Services Trace Events for names of the events.
data_filename
The name of the file that contains the events data. This name is suffixed with a time stamp to avoid data
overwriting if the trace is sent over and over.
metadata_filename
The name of the file that contains the events metadata. This name is suffixed with a time stamp to avoid data
overwriting if the trace is sent over and over.
Where the following elements are to be defined by the user, depending on the tracing needs:
trace_id
Defines the unique identifier for the trace to be deleted.
See Also
Extended Events
Dynamic Management Views (DMVs)
12/6/2018 • 9 minutes to read • Edit Online
DMV queries return information about server and object state at the time the query is run. To monitor operations
in real-time, use tracing instead. To learn more about real-time monitoring using traces, see Use SQL Server
Profiler to Monitor Analysis Services.
Query syntax
The query engine for DMVs is the Data Mining parser. The DMV query syntax is based on the SELECT (DMX)
statement. Although DMV query syntax is based on a SQL SELECT statement, it does not support the full syntax
of a SELECT statement. Notably, JOIN, GROUP BY, LIKE, CAST, and CONVERT are not supported.
The following example for DISCOVER_CALC_DEPENDENCY illustrates the use of the WHERE clause for
supplying a parameter to the query:
For schema rowsets that have restrictions, the query must include the SYSTEMRESTRICTSCHEMA function. The
following example returns CSDL metadata about 1103 compatibility level tabular models. Note that
CATALOG_NAME is case-sensitive:
Schema rowsets
Not all schema rowsets have a DMV interface. To return a list of all the schema rowsets that can be queried using
DMV, run the following query.
If a DMV is not available for a given rowset, the server returns error:
The <schemarowset> request type was not recognized by the server. All other errors indicate problems with the
syntax.
Schema rowsets are described in two SQL Server Analysis Services protocols:
[MS -SSAS -T]: SQL Server Analysis Services Tabular Protocol - Describes schema rowsets for tabular models at
the 1200 and higher compatibility levels.
[MS -SSAS ]: SQL Server Analysis Services Protocol - Describes schema rowsets for multidimensional models
and tabular models at the 1100 and 1103 compatibility levels.
Rowsets described in the [MS -SSAS -T ]: SQL Server Analysis Services Tabular Protocol
ROWSET DESCRIPTION
Rowsets described in the [MS -SSAS ]: SQL Server Analysis Services Protocol
ROWSET DESCRIPTION
DISCOVER_DATASOURCES Returns a list of the data sources that are available on the
server.
DISCOVER_KEYWORDS (XMLA) Returns information about keywords that are reserved by the
XMLA server.
DISCOVER_MEMORYGRANT Returns a list of internal memory quota grants that are taken
by jobs that are currently running on the server.
DISCOVER_OBJECT_ACTIVITY Provides resource usage per object since the start of the
service.
DISCOVER_TRACE_COLUMNS
DMSCHEMA_MINING_MODEL_CONTENT_PMML Returns the XML structure of the mining model. The format
of the XML string follows the PMML 2.1 standard.
DMSCHEMA_MINING_MODEL_XML Returns the XML structure of the mining model. The format
of the XML string follows the PMML 2.1 standard.
DMSCHEMA_MINING_MODELS Enumerates the data mining models that are deployed on the
server.
NOTE
STORAGES DMVs do not have a schema rowset described in the protocol.
Performance Counters (SSAS)
5/16/2018 • 17 minutes to read • Edit Online
Counters by Groups
GROUP DESCRIPTION
Data Mining Model Processing Statistics related to creating predictions from data mining
models.
Storage Engine Query Statistics related to Microsoft Analysis Services storage engine
queries.
Cache
Statistics related to the Microsoft Analysis Services aggregation cache.
COUNTER DESCRIPTION
Inserts/sec Rate of insertions into the cache. The rate is tracked per
partition per cube per database.
Evictions/sec Rate of evictions from the cache. This is per partition per cube
per database. Evictions are typically due to background
cleaner.
Total inserts Insertions into the cache. The rate is tracked per partition per
cube per database.
Total evictions Evictions from the cache. Evictions are tracked per partition
per cube per database. Evictions are typically due to
background cleaner.
Direct hits/sec Rate of cache direct hits. A cache hit indicates that queries
were answered from an existing cache entry.
Total direct hits Total count of direct cache hits. A direct cache hit indicates
that queries were answered from existing cache entries.
Direct hit ratio Ratio of cache direct hits to cache lookups, for the period
between counter values.
Total filtered iterator cache hits Total number of cache hits that returned an indexed iterator
over the filtered results.
Total filtered iterator cache misses Total number of cache hits that were unable to build an
indexed iterator over the filtered results and had to build a
new cache with the filtered results.
Connection
Statistics related to Microsoft Analysis Services connections.
COUNTER DESCRIPTION
COUNTER DESCRIPTION
COUNTER DESCRIPTION
Concurrent DM queries Current number of data mining queries being actively worked
on.
COUNTER DESCRIPTION
Total Predictions Total data mining prediction queries received by the server.
Locks
Statistics related to Microsoft Analysis Services internal server locks.
COUNTER DESCRIPTION
Current latch waits Current number of threads waiting for a latch. These are latch
requests that could not be given immediate grants and are in
a wait state.
Latch waits/sec Rate of latch requests that could not be granted immediately
and had to wait before being granted.
Lock waits/sec Number of lock waits per second. These are lock requests that
could not be given immediate lock grants and were put in a
wait state.
MDX
Statistics related to Microsoft Analysis Services MDX Calculations.
COUNTER DESCRIPTION
Number of calculation covers Total number of evaluation nodes built by MDX execution
plans, including active and cached.
COUNTER DESCRIPTION
Current number of evaluation nodes Current (approximate) number of evaluation nodes built by
MDX execution plans, including active and cached.
Number of Storage Engine evaluation nodes Total number of Storage Engine evaluation nodes built by
MDX execution plans.
Number of cell-by-cell evaluation nodes Total number of cell-by-cell evaluation nodes built by MDX
execution plans.
Number of bulk-mode evaluation nodes Total number of bulk-mode evaluation nodes built by MDX
execution plans.
Number of evaluation nodes that covered a single cell Total number of evaluation nodes built by MDX execution
plans that covered only one cell.
Number of evaluation nodes with calculations at the same Total number of evaluation nodes built by MDX execution
granularity plans for which the calculations were at the same granularity
as the evaluation node.
Current number of cached evaluation nodes Current (approximate) number of cached evaluation nodes
built by MDX execution plans.
Number of cached Storage Engine evaluation nodes Total number of cached Storage Engine evaluation nodes built
by MDX execution plans
Number of cached bulk-mode evaluation nodes Total number of cached bulk-mode evaluation nodes built by
MDX execution plans.
Number of cached 'other' evaluation nodes Total number of cached evaluation nodes built by MDX
execution plans that are neither Storage Engine nor Bulk-
mode.
Number of evictions of evaluation nodes Total number of cache evictions of evaluation nodes due to
collisions.
Number of hash index hits in the cache of evaluation nodes Total number of hits in the cache of evaluation nodes that
were satisfied by the hash index.
Number of cell-by-cell hits in the cache of evaluation nodes Total number of cell-by-cell hits in the cache of evaluation
nodes.
Number of cell-by-cell misses in the cache of evaluation nodes Total number of cell-by-cell misses in the cache of evaluation
nodes.
Number of subcube hits in the cache of evaluation nodes Total number of subcube hits in the cache of evaluation
nodes.
Number of subcube misses in the cache of evaluation nodes Total number of subcube misses in the cache of evaluation
nodes.
Total Sonar subcubes Total number of subcubes that the query optimizer generated.
Total flat cache inserts Total number of cell values inserted into flat calculation cache.
Total NON EMPTY Total number of times a NON EMPTY algorithm was used.
Total NON EMPTY unoptimized Total number of times an unoptimized NON EMPTY algorithm
was used.
Total NON EMPTY for calculated members Total number of times a NON EMPTY algorithm looped over
calculated members.
Memory
Statistics related to Microsoft Analysis Services internal server memory.
COUNTER DESCRIPTION
Page Pool 64 Alloc KB Memory borrowed from system, in KB. This memory is given
away to other parts of the server.
Page Pool 64 Lookaside KB Current memory in 64KB lookaside list, in KB. (Memory pages
ready to be used.)
Page Pool 8 Alloc KB Memory borrowed from 64KB page pool, in KB. This memory
is given away to other parts of the server.
Page Pool 8 Lookaside KB Current memory in 8KB lookaside list, in KB. (Memory pages
ready to be used.)
Page Pool 1 Alloc KB Memory borrowed from 64KB page pool, in KB. This memory
is given away to other parts of the server.
Page Pool 1 Lookaside KB Current memory in 8KB lookaside list, in KB. (Memory pages
ready to be used.)
Cleaner Memory nonshrinkable KB Amount of memory, in KB, not subject to purging by the
background cleaner.
Quota Blocked Current number of quota requests that are blocked until
other memory quotas are freed.
Filestore Clock Pages Examined/sec Rate of background cleaner examining pages for eviction
consideration.
Filestore Clock Pages HaveRef/sec Rate of background cleaner examining pages that have a
current reference count (are currently in use).
Filestore Clock Pages Valid/sec Rate of background cleaner examining pages that are valid
candidates for eviction.
In-memory Dimension Property File KB Current size of in-memory dimension property file, in KB.
In-memory Dimension Property File KB/sec Rate of writes to in-memory dimension property file, in KB.
Potential In-memory Dimension Property File KB Potential size of in-memory dimension property file, in KB.
In-memory Dimension Index (Hash) File KB Size of current in-memory dimension index (hash) file, in KB.
In-memory Dimension Index (Hash) File KB/sec Rate of writes to in-memory dimension index (hash) file, in KB.
Potential In-memory Dimension Index (Hash) File KB Potential size of in-memory dimension index (hash) file, in KB.
In-memory Dimension String File KB Current size of in-memory dimension string file, in KB.
In-memory Dimension String File KB/sec Rate of writes to in-memory dimension string file, in KB.
Potential In-memory Dimension String File KB Potential size of in-memory dimension string file, in KB.
In-memory Map File KB/sec Rate of writes to in-memory map file, in KB.
Potential In-memory Map File KB Potential size of in-memory map file, in KB.
In-memory Aggregation Map File KB Current size of in-memory aggregation map file, in KB.
In-memory Aggregation Map File KB/sec Rate of writes to in-memory aggregation map file, in KB.
Potential In-memory Aggregation Map File KB Size of potential in-memory aggregation map file, in KB.
In-memory Fact Data File KB Size of current in-memory fact data file, in KB.
In-memory Fact Data File KB/sec Rates of writes to in-memory fact data file KB rate.
Potential In-memory Fact Data File KB Size of potential in-memory fact data file, in KB.
In-memory Fact String File KB Size of current in-memory fact string file, in KB.
COUNTER DESCRIPTION
In-memory Fact String File KB/sec Rate of writes to in-memory fact string file, in KB.
Potential In-memory Fact String File KB Size of potential in-memory fact string file, in KB.
In-memory Fact Aggregation File KB Current size of in-memory fact aggregation file, in KB.
In-memory Fact Aggregation File KB/sec Rate of writes to in-memory fact aggregation file, in KB.
Potential In-memory Fact Aggregation File KB Size of potential in-memory fact aggregation file, in KB.
In-memory Other File KB/sec Rate of writes to in-memory other file, in KB.
Potential In-memory Other File KB Size of potential in-memory other file, in KB.
VertiPaq Nonpaged KB Kilobytes of memory locked in the working set for use by the
in-memory engine.
Proactive Caching
Statistics related to Microsoft Analysis Services Proactive Caching.
COUNTER DESCRIPTION
Processing Aggregations
Statistics related to Microsoft Analysis Services processing of aggregations in MOLAP data files.
COUNTER DESCRIPTION
Temp file rows written/sec Rate of writing rows to a temporary file. Temporary files are
written when aggregations exceed memory limits.
Temp file bytes written/sec Rate of writing bytes to a temporary file. Temporary files are
written when aggregations exceed memory limits.
Processing Indexes
Statistics related to Microsoft Analysis Services processing of indexes for MOLAP data files.
COUNTER DESCRIPTION
Total rows Total rows from MOLAP files used to create indexes.
Processing
Statistics related to Microsoft Analysis Services processing of data.
COUNTER DESCRIPTION
Total rows read Count of rows read from all relational databases.
COUNTER DESCRIPTION
Current measure group queries Current number of measure group queries being actively
worked on.
Current dimension queries Current number of dimension queries being actively worked
on.
Total bytes sent Total bytes sent by server to clients, in response to queries.
Queries from cache direct/sec Rate of queries answered from cache directly.
Queries from cache filtered/sec Rate of queries answered by filtering existing cache entry.
Total queries from cache direct Total number of queries derived directly from cache. Note that
this is per partition.
Total queries from cache filtered Total queries answered by filtering existing cache entries.
Total queries from file Total number of queries answered from files.
Map reads/sec Number of logical read operations using the Map file.
Data reads/sec Number of logical read operations using the Data file.
Avg time/query Average time per query, in milliseconds. Response time based
on queries answered since the last counter measurement.
Network round trips/sec Rate of network round trips. This includes all client/server
communication.
Total network round trips Total network round trips. This includes all client/server
communication.
Flat cache lookups/sec Rate of flat cache lookups. This includes global, session, and
query scope flat caches.
Flat cache hits/sec Rate of flat cache hits. This includes global, session, and query
scope flat caches.
Calculation cache lookups/sec Rate of calculation cache lookups. This includes global, session,
and query scope calculation caches.
Calculation cache hits/sec Rate of calculation cache hits. This includes global, session, and
query scope calculation caches.
Persisted cache lookups/sec Rate of persisted cache lookups. Persisted caches are created
by the MDX script CACHE statement.
Persisted cache hits/sec Rate of persisted cache hits. Persisted caches are created by
the MDX script CACHE statement.
Threads
Statistics related to Microsoft Analysis Services threads.
COUNTER DESCRIPTION
Short parsing idle threads Number of idle threads in the short parsing thread pool.
Short parsing busy threads Number of busy threads in the short parsing thread pool.
Short parsing job queue length Number of jobs in the queue of the short parsing thread pool.
Short parsing job rate Rate of jobs through the short parsing thread pool.
COUNTER DESCRIPTION
Long parsing idle threads Number of idle threads in the long parsing thread pool.
Long parsing busy threads Number of busy threads in the long parsing thread pool.
Long parsing job queue length Number of jobs in the queue of the long parsing thread pool.
Long parsing job rate Rate of jobs through the long parsing thread pool.
Query pool idle threads Number of idle threads in the query thread pool.
Query pool busy threads Number of busy threads in the query thread pool.
Query pool job queue length Number of jobs in the queue of the query thread pool.
Query pool job rate Rate of jobs through the query thread pool.
Processing pool idle non-I/O threads Number of idle threads in the processing thread pool
dedicated to non-I/O jobs.
Processing pool busy non-I/O threads Number of threads running non-I/O jobs in the processing
thread pool.
Processing pool job queue length Number of non-I/O jobs in the queue of the processing
thread pool.
Processing pool job rate Rate of non-I/O jobs through the processing thread pool.
Processing pool idle I/O job threads Number of idle threads for I/O jobs in the processing thread
pool.
Processing pool busy I/O job threads Number of threads running I/O jobs in the processing thread
pool.
Processing pool I/O job queue length Number of I/O jobs in the queue of the processing thread
pool.
Processing pool I/O job completion rate Rate of I/O jobs through the processing thread pool.
Log operations in Analysis Services
11/28/2018 • 7 minutes to read • Edit Online
We highly recommend the following link for additional information resources not covered in this topic: Initial data
collection tips from Microsoft Support.
<MaxFileSizeMB>256</MaxFileSizeMB>
<MaxNumberOfLogFiles>5</MaxNumberOfLogFiles>
3. Paste the two lines into the Log section of msmdsrv.ini, below the filename for msmdsrv.log. Both settings
must be added manually. There are no placeholders for them in the msmdsrv.ini file.
The changed configuration file should look like the following:
<Log>
<File>msmdsrv.log</File>
<MaxFileSizeMB>256</MaxFileSizeMB>
<MaxNumberOfLogFiles>5</MaxNumberOfLogFiles>
<FileBufferSize>0</FileBufferSize>
4. Edit the values if those provided differ from what you want.
5. Save the file.
6. Restart the service.
Query logs
The query log is a bit of a misnomer in that it does not log the MDX or DAX query activity of your users. Instead, it
collects data about queries generated by Analysis Services, which is subsequently used as data input in the Usage
Based Optimization Wizard. The data collected in the query log is not intended for direct analysis. Specifically, the
datasets are described in bit arrays, with a zero or a one indicating the parts of dataset is included in the query.
Again, this data is meant for the wizard.
For query monitoring and troubleshooting, many developers and administrators use a community tool, ASTrace,
to monitor queries. You can also use SQL Server Profiler, xEvents, or an Analysis Services trace.
When should you use the query log? We recommend enabling the query log as part of a query performance
tuning exercise that includes the Usage Based Optimization Wizard. The query log does not exist until you enable
the feature, create the data structures to support it, and set properties used by Analysis Services to locate and
populate the log.
To enable the query log, follow these steps:
1. Create a SQL Server relational database to store the query log.
2. Grant the Analysis Services service account sufficient permissions on the database. The account needs
permission to create a table, write to the table, and read from the table.
3. In SQL Server Management Studio, right-click Analysis Services | Properties | General, set
CreateQueryLogTable to true.
4. Optionally, change QueryLogSampling or QueryLogTableName if you want to sample queries at a
different rate, or use a different name for the table.
The query log table will not be created until you have run enough MDX queries to meet the sampling
requirements. For example, if you keep the default value of 10, you must run at least 10 queries before the table
will be created.
Query log settings are server wide. The settings you specify will be used by all databases running on this server.
After the configuration settings are specified, run an MDX query multiple times. If sampling is set to 10, run the
query 11 times.Verify the table is created. In Management Studio, connect to the relational database engine, open
the database folder, open the Tables folder, and verify that OlapQueryLog exists. If you do not immediately see
the table, refresh the folder to pick up any changes to its contents.
Allow the query log to accumulate sufficient data for the Usage Based Optimization Wizard. If query volumes are
cyclical, capture enough traffic to have a representative set of data. See Usage Based Optimization Wizard for
instructions on how to run the wizard.
See Configuring the Analysis Services Query Log to learn more about query log configuration. Although the paper
is quite old, query log configuration has not changed in recent releases and the information it contains still applies.
<Exception>
<CreateAndSendCrashReports>1</CreateAndSendCrashReports>
<CrashReportsFolder/>
<SQLDumperFlagsOn>0x0</SQLDumperFlagsOn>
<SQLDumperFlagsOff>0x0</SQLDumperFlagsOff>
<MiniDumpFlagsOn>0x0</MiniDumpFlagsOn>
<MiniDumpFlagsOff>0x0</MiniDumpFlagsOff>
<MinidumpErrorList>0xC1000000, 0xC1000001, 0xC102003F, 0xC1360054, 0xC1360055</MinidumpErrorList>
<ExceptionHandlingMode>0</ExceptionHandlingMode>
<CriticalErrorHandling>1</CriticalErrorHandling>
<MaxExceptions>500</MaxExceptions>
<MaxDuplicateDumps>1</MaxDuplicateDumps>
</Exception>
VALUE DESCRIPTION
0 Turns off the memory dump file. All other settings under the
Exception section are ignored.
1 (Default) Enables, but does not send, the memory dump file.
CrashReportsFolder is the location of the dump files. By default, an .mdmp file and associated log records can be
found in the \Olap\Log folder.
SQLDumperFlagsOn is used to generate a full dump. By default, full dumps are not enabled. You can set this
property to 0x34.
The following links provide more background:
Looking Deeper into SQL Server using Minidumps
How to create a user mode dump file
How to use the Sqldumper.exe utility to generate a dump file in SQL Server
See Also
Analysis Services Instance Management
Introduction to Monitoring Analysis Services with SQL Server Profiler
Server Properties in Analysis Services
Clear the Analysis Services Caches
11/15/2018 • 4 minutes to read • Edit Online
For both multidimensional and tabular models, clearing some of these caches can be a two-step process that
consists of invalidating the cache when ClearCache executes, followed by emptying the cache when the next query
is received. A reduction in memory consumption will be evident only after the cache is actually emptied.
Clearing the cache requires that you provide an object identifier to the ClearCache statement in an XMLA query.
The first step in this topic explains how to get an object identifier.
Step 1: Get the object identifier
1. In Management Studio, right-click an object, select Properties, and copy the value from the ID property in
the Properties pane. This approach works for the database, cube, dimension, or table.
2. To get the measure group ID, right-click the measure group and select Script Measure Group As. Choose
either Create or Alter, and send the query to a window. The ID of the measure group will be visible in the
object definition. Copy the ID of the object definition.
Step 2: Run the query
1. In Management Studio, right-click a database, point to New Query, and select XMLA.
2. Copy the following code example into the XMLA query window. Change DatabaseID to the ID of the
database on the current connection.
<ClearCache xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Object>
<DatabaseID> Adventure Works DW Multidimensional</DatabaseID>
</Object>
</ClearCache>
Alternatively, you can specify a path of a child object, such as a measure group, to clear the cache for just
that object.
<ClearCache xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Object>
<DatabaseID>Adventure Works DW Multidimensional</DatabaseID>
<CubeID>Adventure Works</CubeID>
<MeasureGroupID>Fact Currency Rate</MeasureGroupID>
</Object>
</ClearCache>
3. Press F5 to execute the query. You should see the following result:
<return xmlns="urn:schemas-microsoft-com:xml-analysis">
<root xmlns="urn:schemas-microsoft-com:xml-analysis:empty" />
</return>
Database Consistency Checker (DBCC) for Analysis
Services
11/27/2018 • 19 minutes to read • Edit Online
NOTE
If you're familiar with DBCC (Transact-SQL), you'll quickly notice that the DBCC in Analysis Services has a much narrower
scope. DBCC in Analysis Services is a single command that reports exclusively on data corruption across the database or on
individual objects. If you have other tasks in mind, such as collecting information, try using AMO PowerShell or XMLA scripts
instead.
Permission requirements
You must be an Analysis Services database or server administrator (a member of the server role) to run the
command. See Grant database permissions (Analysis Services) or Grant server admin rights to an Analysis
Services instance for instructions.
Command syntax
Tabular databases at the 1200 and higher compatibility levels use tabular metadata for object definitions. The
complete DBCC syntax for a tabular database created at a SQL Server 2016 functional level is illustrated in the
following example.
Key differences between the two syntaxes include a newer XMLA namespace, no <Object> element, and no
<Model> element (there is still only one model per database).
<DBCC xmlns="http://schemas.microsoft.com/analysisservices/2014/engine">
<DatabaseID>MyTabular1200DB_7811b5d8-c407-4203-8793-12e16c3d1b9b</DatabaseID>
<TableName>FactSales</TableName>
<PartitionName>FactSales 4</PartitionName>
</DBCC>
You can omit lower-level objects, such as table or partition names, to check the entire schema.
You can get object names and DatabaseID from Management Studio, through the property page of each object.
<DBCC xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Object>
<DatabaseID>AdventureWorksDW2014Multidimensional-EE</DatabaseID>
<CubeID>Adventure Works</CubeID>
<MeasureGroupID>Fact Internet Sales 1</MeasureGroupID>
<PartitionID>Internet_Sales_2006</PartitionID>
</Object>
</DBCC>
To run DBCC on objects higher up the object chain, delete any lower-level object ID elements you don't need:
<DBCC xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Object>
<DatabaseID>AdventureWorksDW2014Multidimensional-EE</DatabaseID>
<CubeID>Adventure Works</CubeID>
</Object>
</DBCC>
For tabular 110x databases, the object definition syntax is modeled after the syntax of Process command
(specifically, in how tables are mapped to dimensions and measure groups).
CubeID maps to the model ID, which is Model.
MeasureGroupID maps to a table ID.
PartitionID maps to a partition ID.
Usage
In SQL Server Management Studio, you can invoke DBCC using either an MDX or XMLA query window.
Additionally, you can use either SQL Server 2017 Profiler or Analysis Services xEvents to view DBCC output. Note
that SSAS DBCC messages are not reported to the Windows application event log or the msmdsrv.log file.
DBCC checks for physical data corruption, as well as logical data corruption that occur when orphaned members
exist in a segment. A database must be processed before you can run DBCC. It skips remote, empty, or
unprocessed partitions.
The command runs in a read transaction, and can thus be kicked out by force commit timeout. Partition checks are
run in parallel.
A service restart might be required to pick up any corruption errors that have occurred since the last service
restart. Reconnecting to the server is not enough to pick up the changes.
Run DBCC commands in Management Studio
For ad hoc queries, open an MDX or XMLA query window in SQL Server Management Studio. To do this, right-
click the database | New Query | XMLA ) to run the command and read the output.
The Results tab will indicate an empty result set (as shown in the screenshot) if no problems were detected.
The Messages tab provides detail information but is not always reliable for smaller databases. Status messages are
sometimes trimmed, indicating the command completed, but without the status check messages on each object. A
typical message report might look similar to the one shown below.
Messages reported from DBCC for the cube validation check
Executing the query ...
READS, 0
READ_KB, 0
WRITES, 0
WRITE_KB, 0
CPU_TIME_MS, 0
ROWS_SCANNED, 0
ROWS_RETURNED, 0
<DBCC xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Object>
<DatabaseID>AdventureWorksDW2014Multidimensional-EE</DatabaseID>
<CubeID>Adventure Works</CubeID>
</Object>
</DBCC>
Started checking segment indexes for the 'Internet_Sales_2011' partition.
Started checking segment indexes for the 'Internet_Sales_2012' partition.
Finished checking segment indexes for the 'Internet_Sales_2011' partition.
Started checking segment indexes for the 'Internet_Sales_2013' partition.
Finished checking segment indexes for the 'Internet_Sales_2012' partition.
Started checking segment indexes for the 'Internet_Sales_2014' partition.
Started checking segment indexes for the 'Internet_Orders_2011' partition.
Finished checking segment indexes for the 'Internet_Sales_2014' partition.
Started checking segment indexes for the 'Internet_Orders_2012' partition.
Started checking segment indexes for the 'Internet_Orders_2013' partition.
Finished checking segment indexes for the 'Internet_Orders_2012' partition.
...
Run complete
NOTE
In CTP 3.0, objects are identified by internal names. For example, a Categories hierarchy is articulated as
H$Categories-<objectID>. Internal names should be replaced by user friendly names in an upcoming CTP.
Partition Index Scan segments to look for physical The partition segment is corrupted.
corruptions.
Database Checks count of tables in the database. There is corruption in the storage layer.
A value less than zero indicates The collection of tables in the '%
corruption. {parent/}' database is corrupt.
Database Checks internal structure used to track Database files failed to pass consistency
Referential Integrity and throw s an checks.
error if the size is incorrect.
Table Checks internal value used to determine Database consistency checks (DBCC)
if table is a Dimension or Fact table. A failed while checking the table statistics.
value that falls outside the known range
indicates corruption.
Table Checks that the number of partitions in There is corruption in the storage layer.
the segment map for the table matches The collection of partitions in the '%
the number of partitions defined for the {parent/}' table is corrupt.
table.
Table If a tabular database was created or Database consistency checks (DBCC)
imported from PowerPivot for Excel failed while checking the segment map.
2010 and has a partition count greater
than one, an error will be raised, as
partition support was added in later
versions and this would indicate
corruption.
Partition Verifies for each partition that the Database consistency checks (DBCC)
number segments of data and the failed while checking the segment map.
record count for each segment of data
in the segment matches the values
stored in the index for the segment.
Partition Raise an error if the number of total Database consistency checks (DBCC)
records, segments, or records per failed while checking the segment map.
segment is not valid (less than zero), or
the number of segments doesn't match
the calculated number of segments
needed based on total record count.
Relationship Raise an error if the structure used to Database consistency checks (DBCC)
store data about the relationship failed while checking relationships.
contains no records or if the name of
the table used in the relationship is
empty.
Relationship Verify that the name of the primary Database consistency checks (DBCC)
table, primary column, foreign table, failed while checking relationships.
and foreign column are set and that the
columns and tables involved in the
relationship can be accessed.
Hierarchy Raise an error if the sort order for the Database consistency checks (DBCC)
hierarchy isn't a recognized value. failed while checking the '%{hier/}'
hierarchy.
Hierarchy The checks performed on the hierarchy Database consistency checks (DBCC)
depend on the internal type of failed while checking the '%{hier/}'
hierarchy mapping scheme used. hierarchy.
Column Raise an error if the encoding used for Database consistency checks (DBCC)
the column is not set to a known value. failed while checking the column
statistics.
Column Check whether the column was Database consistency checks (DBCC)
compressed by the in-memory engine failed while checking the column
or not. statistics.
Column Check the compression type on the Database consistency checks (DBCC)
column for known values. failed while checking the column
statistics.
Column When the column "tokenization" is not Database consistency checks (DBCC)
set to a known value, raise an error. failed while checking the column
statistics.
Column If the id range stored for a columns Database consistency checks (DBCC)
data dictionary does not match the failed while checking the data dictionary.
number of values in the data dictionary
or is outside the allowed range, raise an
error.
Column Check that the number of data There is corruption in the storage layer.
segments for a column matches the The collection of segments in the '%
number of data segments for the table {parent/}' column is corrupt.
to which it belongs.
Column Check that the number of Partitions for Database consistency checks (DBCC)
a data column matches the number of failed while checking the segment map.
partitions for the data segment map for
the column.
Column Verify that the number of records in a There is corruption in the storage layer.
column segment matches the record The collection of segments in the '%
count stored in the index for that {parent/}' column is corrupt.
column segment.
Column Report an error if segment statistics for Database consistency checks (DBCC)
a column don't match the actual failed while checking the segment
column values for Minimum Data ID, statistics.
Maximum Data ID, number of Distinct
values, number of rows, or presence of
NULL values.
ColumnSegment If there are no rows for this segment, Database consistency checks (DBCC)
the minimum and maximum data failed while checking the segment
values for the column should be set to statistics.
the system reserved value for NULL. If
the value is not null, raise an error.
ColumnSegment If the column has rows and at least one Database consistency checks (DBCC)
non-null value, checkthat the minimum failed while checking the segment
and maximum data id for the column is statistics.
greater than the system reserved value
for NULL.
Internal Verify that the store tokenization hint is Database files failed to pass consistency
set and that if the store is processed, checks.
there are valid pointers for internal
tables. If the store is not processed,
verify all the pointers are null.
If not, return a generic DBCC error.
DBCC Database Raise an error if the database schema There is corruption in the storage layer.
has no tables or one or more tables The collection of tables in the '%
cannot be accessed. {parent/}' database is corrupt.
DBCC Database Raise an error if a table is marked as A bad table type was encountered.
temporary or has an unknown type.
DBCC Database Raise an error if the number of There is corruption in the storage layer.
relationships for a table has a negative The collection of relationships in the '%
value, or if any table has a relationship {parent/}' table is corrupt.
defined and a corresponding
relationship structure cannot be found.
DBCC Database If the compatibility level for the Database files failed to pass consistency
database is 1050 (SQL Server 2008 checks.
R2/PowerPivot v1.0) and the number of
relationships exceeds the number of
tables in the model, mark the database
as corrupted.
DBCC Table For the table under validation, check if There is corruption in the storage layer.
the number of columns is less than zero The collection of columns in the '%
and raise an error if true. An error also {parent/}' table is corrupt.
occurs if the column store for a column
in the table is NULL.
DBCC Partition Checks the table that the partition There is corruption in the storage layer.
being validated belongs to, and if the The collection of columns in the '%
number of columns for the table is less {parent/}' table is corrupt.
than zero, it indicates the Columns
collection is corrupt for the table. An
error will also occur if the column store
for a column in the table is NULL.
DBCC Partition Loops through each column for the There is corruption in the storage layer.
selected partition and checks that each The collection of segments in the '%
segment for the partition has a valid {parent/}' column is corrupt.
link to a column segment structure. If
any segment has a NULL link, the
partition is considered corrupt.
Column Returns an error if the column type is A bad segment type was encountered.
not valid.
Column Returns an error if any column has a There is corruption in the storage layer.
negative count for the number of The collection of segments in the '%
segments in a column, or if the pointer {parent/}' column is corrupt.
to the column segment structure for a
segment has a NULL link.
DBCC Command The DBCC Command will report Checking consistency of the
multiple status messages as it proceeds <objectname> <objecttype>. Phase:
through the DBCC operation. It will pre-check.
report a status message before starting
that includes the database, table, or Checking consistency of the
column name of the object, and again <objectname> <objecttype>. Phase:
after finishing each object check. post-check.
Errors in the metadata manager malformed command Check the command syntax. Most likely,
you included a lower level object
The object reference '<objectID>' is not without specifying one or more of its
valid. It does not match the structure of parent objects.
the metadata class hierarchy.
ERROR ISSUE RESOLUTION
Errors in the metadata manager Index corruption (multidimensional) Reprocess the object and any
dependent objects.
Either the <object> with the ID of
'<objectID>' does not exist in the
<parentobject> with the ID of
'<parentobjectID>', or the user does
not have permissions to access the
object.
Error occurred during consistency Index corruption (multidimensional) Reprocess the object and any
check of the partition dependent objects.
Partition segment statistics Index corruption (multidimensional) Reprocess the object and any
corrupted dependent objects.
Partition segment is corrupted Metadata corruption (multidimensional Delete and redeploy the project, or
or tabular) restore from a backup and reprocess.
Table metadata corruption Metadata corruption (tabular only) Delete and redeploy the project, or
restore from a backup and reprocess.
Table <table-name> metadata file is
corrupt. The main table is not found See How to handle corruption in
under DataFileList node. Analysis Services databases (blog) for
instructions.
Corruption in storage layer Metadata corruption (tabular only) Delete and redeploy the project, or
restore from a backup and reprocess.
Corruption in storage layer: collection
of <type-name> in <parent-name> See How to handle corruption in
<parent-type> is corrupt. Analysis Services databases (blog) for
instructions.
System table is missing Object corruption (tabular only) Reprocess the object and any
dependent objects
System table <table-name> is missing.
Table statistics are corrupt Metadata corruption (tabular only) Delete and redeploy the project, or
restore from a backup and reprocess.
Statistics of table System table <table-
name> is missing. See How to handle corruption in
Analysis Services databases (blog) for
instructions.
<ConfigurationSettings>
<Vertipaq />
<DisableConsistencyChecks />
This setting is not present in the configuration file and must be added manually.
Valid values are as follows:
-2 (default) DBCC is enabled. If the server can logically resolve the error with a high degree of certainty, a fix
will be applied automatically. Otherwise, an error will be logged.
-1 DBCC is partially enabled. It is enabled for RESTORE and on pre-commit validations that check database
state at the end of a transaction.
0 DBCC is partially enabled. Database consistency checks are performed during RESTORE, IMAGELOAD,
LOCALCUBELOAD, and ATTACH
operations.
1 DBCC is disabled. Data integrity checks are disabled, however deserialization checks will still occur.
NOTE
This setting has no impact on DBCC when running the command on demand.
See Also
Process Database, Table, or Partition (Analysis Services)
Processing a multidimensional model (Analysis Services)
Compatibility Level for Tabular models in Analysis Services
Server Properties in Analysis Services
Analysis Services Scripts Project in SQL Server
Management Studio
10/26/2018 • 2 minutes to read • Edit Online
File Types
A SQL Server Management Studio solution can contain several file types, depending on what projects you
included in the solution and what items you included in each project for that solution. For more information about
file types for solutions in SQL Server Management Studio, see Files That Manage Solutions and Projects.
Typically, the files for each project in a SQL Server Management Studio solution are stored in the solution folder,
in a separate folder for each project.
The project folder for an Analysis Server Scripts project can contain the file types listed in the following table.
Analysis Server Scripts project definition file (.ssmsasproj) Contains metadata about the folders shown in Solution
Explorer, as well as information that indicates which folders
should display files included in the project.
DMX script file (.dmx) Contains a DMX script included in the project.
MDX script file (.mdx) Contains an MDX script included in the project.
XMLA script file (.xmla) Contains an XMLA script included in the project.
See Also
Creating Multidimensional Models Using SQL Server Data Tools (SSDT)
Multidimensional Expressions (MDX) Reference
Data Mining Extensions (DMX) Reference
Analysis Services Scripting Language (ASSL for XMLA)
Analysis Services Scripting Language (ASSL for XMLA)
Create Analysis Services Scripts in Management
Studio
5/16/2018 • 3 minutes to read • Edit Online
IMPORTANT
When scripting the Role Object, be aware that security permissions are contained by the objects they secure rather than with
the security role with which they are associated.
NOTE
Typically, you would select File if you want to create multiple different versions of the file.
See Also
XMLA Query Editor (Analysis Services - Multidimensional Data)
Schedule SSAS Administrative Tasks with SQL Server
Agent
5/16/2018 • 7 minutes to read • Edit Online
Prerequisites
SQL Server Agent service must be installed.
By default, jobs run under the service account. The default account for SQL Server Agent is NT
Service\SQLAgent$<instancename>. To perform a backup or processing task, this account must be a system
administrator on the Analysis Services instance. For more information, see Grant server admin rights to an
Analysis Services instance.
You should also have a test database to work with. You can deploy the AdventureWorks multidimensional sample
database or a project from the Analysis Services multidimensional tutorial to use in this walkthrough. For more
information, see Install Sample Data and Projects for the Analysis Services Multidimensional Modeling Tutorial.
<Batch xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Parallel>
<Process xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance">
<Object>
<DatabaseID>Adventure Works DW Multidimensional</DatabaseID>
<DimensionID>Dim Account</DimensionID>
</Object>
<Type>ProcessFull</Type>
<WriteBackTableCreation>UseExisting</WriteBackTableCreation>
</Process>
</Parallel>
</Batch>
WARNING
If the partition is processed first, the subsequent dimension processing causes the partition to become unprocessed.
The partition would then require a second processing to reach a processed state.
9. In the XMLA Query window that contains the XMLA script that processes the partition, highlight the code
inside the Batch and Parallel tags, right-click the highlighted script, and select Copy.
10. Open the XMLA Query window that contains the XMLA script that processes the dimension. Right-click
within the script to the left of the </Process> tag and select Paste.
The following example shows the revised XMLA script.
<Batch xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Parallel>
<Process xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance">
<Object>
<DatabaseID>Adventure Works DW Multidimensional</DatabaseID>
<DimensionID>Dim Customer</DimensionID>
</Object>
<Type>ProcessFull</Type>
<WriteBackTableCreation>UseExisting</WriteBackTableCreation>
</Process>
<Process xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance">
<Object>
<DatabaseID>Adventure Works DW Multidimensional</DatabaseID>
<CubeID>Adventure Works</CubeID>
<MeasureGroupID>Fact Internet Sales 1</MeasureGroupID>
<PartitionID>Internet_Sales_2004</PartitionID>
</Object>
<Type>ProcessFull</Type>
<WriteBackTableCreation>UseExisting</WriteBackTableCreation>
</Process>
</Parallel>
</Batch>
11. Highlight the revised XMLA script, right-click the highlighted script, and select Copy.
12. This step copies the XMLA script to the Windows Clipboard. You can leave the XMLA script in the
Clipboard, save it to a file, or paste it into Notepad or another text editor.
Create and schedule the batch processing job
1. Connect to an instance of SQL Server, and then open Object Explorer.
2. Expand SQL Server Agent. Start the service if is not running.
3. Right-click Jobs and select New Job.
4. In the New Job dialog box, enter a job name in Name.
5. In Steps, click New.
6. In the New Job Step dialog box, enter a step name in Step Name.
7. In Type, select SQL Server Analysis Services Command.
8. In Run as, select the SQL Server Agent Service Account. Recall from the Prerequisites section that this
account must have administrative permissions on Analysis Services.
9. In Server, specify the server name of the Analysis Services instance.
10. In Command, right-click and select Paste.
11. Click OK.
12. In the Schedules page, click New.
13. In the New Job Schedule dialog box, enter a schedule name in Name, and then click OK.
This step creates a schedule for Sunday at 12:00 AM. The next step shows you how to manually execute the
job. You can also select a schedule which will execute the job when you are monitoring it.
14. Click OK to close the dialog box.
15. In Object Explorer, expand Jobs, right-click the job you created, and select Start Job at Step.
Because the job has only one step, the job executes immediately. If the job contains more than one step, you
can select the step at which the job should start.
16. When the job finishes, click Close.
See Also
Processing Options and Settings (Analysis Services)
Use Analysis Services Templates in SQL Server
Management Studio
10/26/2018 • 13 minutes to read • Edit Online
To open a template, right-click the template name and select Open, or drag the template into a query window that
you already opened. After the query window is open, you can use commands on the toolbar or Query menu to
help you build statements:
To check the syntax of a query, click Parse.
To run a query, click Execute.
To stop a query that is running, click Cancel Executing Query.
View the results of a query in the Results tab at the bottom of the screen.
Switch to the Messages tab to see the number of records returned, errors, query statements, and any other
messages that are associated with the execution of the query. For example, if you execute a DAX statement
against a model running in Direct Query mode, you can see the Transact-SQL statement that is generated
by the xVelocity in-memory analytics engine (VertiPaq).
Build and Run an MDX Query on a Tabular Model using a Template
This example shows you how to create an MDX query in SQL Server Management Studio, using a tabular model
database as the data source. To repeat this example on your computer, you can download the Adventureworks
tabular model sample project.
WARNING
You cannot use MDX queries against tabular models that have been deployed in Direct Query mode. You can, however,
send equivalent queries by using the DAX table queries with the EVALUATE command. For more information, see DAX
Query Parameters.
WARNING
You cannot set the context of an XMLA query by changing the restriction list, or by specifying a database in the
connection dialog. You must open the XMLA query window from the database that you want to query.
2. Drag the Backup template into the empty query window.
3. Double-click the text within the <DatabaseID> element.
4. In Object Explorer, select the database you want to backup, and drag and drop the database between the
brackets of the DatabaseID element.
5. Double-click the text within the <File> element. Type the name of the backup file, including the .abf file
extension. Specify the full file path if you are not using the default backup location. For more information,
see Backing Up, Restoring, and Synchronizing Databases (XMLA).
<Discover xmlns="urn:schemas-microsoft-com:xml-analysis">
<RequestType>DISCOVER_SCHEMA_ROWSETS</RequestType>
<Restrictions>
<RestrictionList>
</RestrictionList>
</Restrictions>
<Properties>
<PropertyList>
</PropertyList>
</Properties>
</Discover>
Get a list of data sources for a tabular model using a schema rowset query
1. In SQL Server Management Studio, open the instance that contains the database you want to query. Right-
click the database icon, select New Query, and then select XMLA.
WARNING
You cannot set the context of an XMLA query by changing the restriction list, or by specifying a database in the
connection dialog. You must open the XMLA query window from the database that you want to query.
2. Open Template Explorer, and drag the template, Discover Schema Rowsets, into the blank query
window.
3. In the template, replace the RequestType Element (XMLA) element with the following text:
<RequestType>MDSCHEMA_INPUT_DATASOURCES</RequestType>
4. Click Execute.
Expected results:
XMLA\Schema Rowsets Discover Schema Rowsets Demonstrates how to use the XMLA
Discover method to retrieve the
contents of the
DISCOVER_SCHEMA_ROWSETS schema
rowset.
See Also
Multidimensional Expressions (MDX) Reference
Data Mining Extensions (DMX) Reference
Analysis Services Scripting Language (ASSL for XMLA)
Analysis Services Scripting Language (ASSL for XMLA)
Automate Analysis Services Administrative Tasks with
SSIS
5/16/2018 • 3 minutes to read • Edit Online
See Also
Partition Processing Destination
Dimension Processing Destination
Data Mining Query Transformation
Processing a multidimensional model (Analysis Services)
Connect to Analysis Services
5/16/2018 • 2 minutes to read • Edit Online
Connection Tasks
LINK TASK DESCRIPTION
Connect from client applications (Analysis Services) If you are new to Analysis Services, read this topic to get
started with the tools and applications most often used with
Analysis Services.
Connection String Properties (Analysis Services) Analysis Services includes numerous server and database
properties, allowing you to customize a connection for a
specific application, independent of how the instance or
database is configured.
Authentication methodologies supported by Analysis This topic is a brief introduction to the authentication
Services methods used by Analysis Services.
Configure Analysis Services for Kerberos constrained Many business intelligence solutions require impersonation
delegation to ensure that only authorized data is returned to each user.
In this topic, learn the requirements for using impersonation.
This topic also explains the steps for configuring Analysis
Services for Kerberos constrained delegation.
LINK TASK DESCRIPTION
SPN registration for an Analysis Services instance Kerberos authentication requires a valid Service Principle
Name (SPN) for services that impersonate or delegate user
identities in multi-server solutions. Use the information in
this topic to learn the construction and steps for SPN
registration for Analysis Services.
Configure HTTP Access to Analysis Services on Internet Basic authentication or cross-domain boundaries are two
Information Services (IIS) 8.0 important reasons for configuring Analysis Services for HTTP
access.
Data providers used for Analysis Services connections Analysis Services provides three client libraries for accessing
server operations or Analysis Services data. This topic offers a
brief introduction to ADOMD.NET, Analysis Services
Management Objects (AMO), and the Analysis Services OLE
DB provider (MSOLAP).
Disconnect Users and Sessions on Analysis Services Server Clear existing connections and sessions before taking a
server offline or conducting baseline performance tests.
See Also
Post-install Configuration (Analysis Services)
Server Properties in Analysis Services
Connect from client applications (Analysis Services)
5/16/2018 • 8 minutes to read • Edit Online
NOTE
When using SQL Server Data Tools to work on an existing Analysis Services project, remember that you can connect offline
using a local or version controlled project, or connect in online mode to update Analysis Services objects while the database
is running. For more information, see Connect in Online Mode to an Analysis Services Database. More commonly,
connections from SQL Server Data Tools are in project mode, where changes are deployed to the database only when you
explicitly deploy the project.
Test connections
You can use SQL Server Profiler to monitor connections to Analysis Services. The Audit Login and Audit Logout
events provide evidence of a connection. The identity column indicates the security context under which the
connection is made.
1. Start SQL Server Profiler on the Analysis Services instance and then start a new trace.
2. In Events Selection, verify that Audit Login and Audit Logout are checked in the Security Audit section.
3. Connect to Analysis Services via an application service (such as SharePoint or Reporting Services) from a
remote client computer. The Audit Login event will show the identity of the user connecting to Analysis
Services.
Connection errors are often traced to an incomplete or invalid server configuration. Always check server
configuration first:
Ping the server from a remote computer to ensure it allows remote connections.
Firewall rules on the server allow inbound connections from clients in the same domain
With the exception of Power Pivot for SharePoint, all connections to a remote server require that you have
configured the firewall to allow access to the port that Analysis Services is listening on. If you are getting
connection errors, verify that the port is accessible and that user permissions are granted to the
appropriate databases.
To test, use Excel or SSMS to on a remote computer, specifying the IP address and port used by the
Analysis Services instance. If you can connection, the firewall rules are valid for the instance and the
instance allows remote connections.
Also, when using TCP/IP for the connection protocol, remember that Analysis Services requires client
connections originate from the same domain or a trusted domain. If connections flow across security
boundaries, you will most likely need to configure HTTP access. For more information, see Configure HTTP
Access to Analysis Services on Internet Information Services (IIS ) 8.0.
Can you connect using some tools but not others? The problem might be the wrong version of a client
library. You can get client libraries from the SQL Server Feature Pack download page.
Resources that can help you resolve connection failures include the following:
Resolving Common Connectivity Issues in SQL Server 2005 Analysis Services Connectivity Scenarios. This
document is a few years old, but the information and methodologies still apply.
See Also
Connect to Analysis Services
Authentication methodologies supported by Analysis Services
Impersonation
Create a Data Source (SSAS Multidimensional)
Connection String Properties (Analysis Services)
12/6/2018 • 17 minutes to read • Edit Online
NOTE
When setting properties, if you inadvertently set the same property twice, the last one in the connection string is used.
For more information about how to specify an Analysis Services connection in existing Microsoft applications, see Connect
from client applications (Analysis Services).
Data Source or DataSource Specifies the server instance. This property is Data
required for all connections. Valid values source=asazure://westus.asazure.windows.net/myasserver
include the network name or IP address of
the server, local or localhost for local Data source=AW-SRV01 for the default
connections, a URL if the server is instance and port (TCP 2383).
configured for HTTP or HTTPS access, or the
name of a local cube (.cub) file. Data source=AW-SRV01$Finance:8081 for
a named instance ($Finance) and fixed port.
Valid value for Azure Analysis Services,
<protocol>://<region>/<servername> Data source=AW-SRV01.corp.Adventure-
where protocol is string asazure, region is Works.com
the Uri where the server was created (for for a fully qualified domain name, assuming
example, westus.asazure.windows.net) and the default instance and port.
servername is the name of your unique
server within the region. Data source=172.16.254.1 for an IP
address of the server, bypassing DNS server
lookup, useful for troubleshooting
connection problems.
Initial Catalog or Catalog Specifies the name of the Analysis Services Initial catalog=AdventureWorks2016
database to connect to. The database must
be deployed on Analysis Services, and you
must have permission to connect to it. This
property is optional for AMO connections,
but required for ADOMD.NET.
PROPERTY DESCRIPTION EXAMPLE
Cube Cube name or perspective name. A database Cube=SalesPerspective shows that you
can contain multiple cubes and perspectives. can use the Cube connection string
When multiple targets are possible, include property to specify either the name of a
the cube or perspective name on the cube or the name of a perspective.
connection string.
PROPERTY DESCRIPTION
PROPERTY DESCRIPTION
EffectiveUserName Use when an end user identity must be impersonated on the server.
Specify the account in a domain\user format. To use this property,
the caller must have administrative permissions in Analysis Services.
For more information about using this property in an Excel
workbook from SharePoint, see Use Analysis Services
EffectiveUserName in SharePoint Server 2013.
Encryption Password The password used to decrypt an encrypted local cube. Default value
is empty. This value must be explicitly set by the user.
Impersonation Level Indicates the level of impersonation that the server is allowed to use
when impersonating the client. Valid values include:
Integrated Security The Windows identity of the caller is used to connect to Analysis
Services. Valid values are blank, SSPI, and BASIC.
Persist Encrypted Set this property when the client application requires the data source
object to persist sensitive authentication information, such as a
password, in encrypted form. By default, authentication information
is not persisted.
Persist Security Info Valid values are True and False. When set to True, security
information, such as the user identity or password previously
specified on the connection string, can be obtained from the
connection after the connection is made. The default value is False.
PROPERTY DESCRIPTION
Protection Level Determines the security level used on the connection. Valid values
are:
Use Encryption for Data Encrypts data transmissions. Value values are True and False.
User ID=...; Password= User ID and Password are used together. Analysis Services
impersonates the user identity specified through these credentials.
On an Analysis Services connection, putting credentials on the
command line is used only when the server is configured for HTTP
access, and you specified Basic authentication instead of integrated
security on the IIS virtual directory. When connecting directly to the
server, UserID and Password connection string params are ignored
and the connection is made using the context of the logged on user.
Special-purpose parameters
This section describes the remainder of the connection string parameters. These are used to ensure specific connection
behaviors required by an application.
Properties are listed in alphabetical order.
PROPERTY DESCRIPTION
PROPERTY DESCRIPTION
Application Name Sets the name of the application associated with the connection. This
value can be useful when monitoring tracing events, especially when
you have several applications accessing the same databases. For
example, adding Application Name='test' to a connection string
causes 'test' to appear in a SQL Server Profiler trace, as shown in the
following screenshot:
AutoSyncPeriod Sets the frequency (in milliseconds) of client and server cache
synchronization. ADOMD.NET provides client caching for frequently
used objects that have minimal memory overhead. This helps reduce
the number of round trips to the server. The default is 10000
milliseconds (or 10 seconds). When set to null or 0, automatic
synchronization is turned off.
Character Encoding Defines how characters are encoded on the request. Valid values are
Default or UTF-8 (these are equivalent), and UTF-16
Connect Timeout Determines the maximum amount of time (in seconds) the client
attempts a connection before timing out. If a connection does not
succeed within this period, the client quits trying to connect and
generates an error.
MDX Compatibility The purpose of this property is to ensure a consistent set of MDX
behaviors for applications that issue MDX queries. Excel, which uses
MDX queries to populate and calculate a PivotTable connected to
Analysis Services, sets this property to 1, to ensure that placeholder
members in ragged hierarchies are visible in a PivotTable. Valid values
include 0, 1, 2.
MDX Missing Member Mode=Error Indicates whether missing members are ignored in MDX statements.
Valid values are Default, Error, and Ignore. Default uses a server-
defined value. Error generates an error when a member does not
exist. Ignore specifies that missing values should be ignored.
PROPERTY DESCRIPTION
Packet Size A network packet size (in bytes) between 512 and 32,767. The
default network packet size is 4096.
Protocol Format Sets the format of the XML sent to the server. Valid values are
Default, XML, or Binary. The protocol is XMLA. You can specify that
the XML be sent in compressed form (this is the default), as raw
XML, or in a binary format. Binary format encodes XML elements
and attributes, making them smaller. Compression is a proprietary
format that further reduces the size of requests and responses.
Compression and binary formats are used to speed up data transfer
requests and responses.
Real Time Olap Set this property to bypass caching, causing all partitions to actively
listen for query notifications. By default, this property is not set.
Safety Options Sets the safety level for user-defined functions and actions. Valid
values are 0, 1, 2. In an Excel connection this property is Safety
Options=2. Details about this option can be found in
ConnectionString.
SQLQueryMode Specifies whether SQL queries include calculations. Valid values are
Data, Calculated, IncludeEmpty. Data means that no calculations are
allowed. Calculated allows calculations. IncludeEmpty allows
calculations and empty rows to be returned in the query result.
Timeout Specifies how long (in seconds) the client library waits for a command
to complete before generating an error.
Transport Compression Defines how client and server communications are compressed,
when compression is specified via the Protocol Format property.
Valid values are Default, None, Compressed and gzip. Default is no
compression for TCP, or gzip for HTTP. None indicates that no
compression is used. Compressed uses XPRESS compression (SQL
Server 2008 and later). gzip is only valid for HTTP connections,
where the HTTP request includes Accept-Encoding=gzip.
VisualMode Set this property to control how members are aggregated when
dimension security is applied.
For cube data that everyone is allowed to see, aggregating all of the
members makes sense because all of the values that contribute to
the total are visible. However, if you filter or restrict dimensions
based on user identity, showing a total based on all the members
(combining both restricted and allowed values into a single total)
might be confusing or show more information than should be
revealed.
When set on the connection string, this value applies to the cube or
perspective level. Within a model, you can control visual totals at a
more granular level.
Aliases for this property include Visual Total or Default MDX Visual
Mode.
For more information, see Data Connections, Data Sources, and Connection Strings (Report Builder and SSRS ) and Data
Authentication for Excel Services in SharePoint Server 2013.
See Also
Configure HTTP Access to Analysis Services on Internet Information Services (IIS ) 8.0
Configure Analysis Services for Kerberos constrained delegation
Data providers used for Analysis Services connections
Connect to Analysis Services
Authentication methodologies supported by Analysis
Services
5/16/2018 • 5 minutes to read • Edit Online
NOTE
Windows Server 2012 supports constrained delegation across domains. In contrast, configuring Kerberos constrained
delegation in domains at lower functional levels, such as Windows Server 2008 or 2008 R2, require both client and server
computers to be members of the same domain.
EffectiveUserName
EffectiveUserName is a connection string property used for passing identity information to Analysis Services.
Power Pivot for SharePoint uses it to record user activity in the usage logs. Excel Services and PerformancePoint
Services can use it to retrieve data used by workbooks or dashboards in SharePoint. It can also be used in custom
applications or scripts that perform operations on an Analysis Services instance.
For more information about using EffectiveUserName in SharePoint, see Use Analysis Services
EffectiveUserName in SharePoint Server 2010.
Basic Authentication and Anonymous User
Basic authentication provides yet a fourth alternative for connecting to a backend server as a specific user. Using
Basic authentication, the Windows user name and password are passed on the connection string, introducing
additional wire encryption requirements to ensure sensitive information is protected while in transit. An
important advantage to using Basic authentication is that the authentication request can cross domain
boundaries.
For Anonymous authentication, you can set the anonymous user identity to a specific Windows user account
(IUSR_GUEST by default) or an application pool identity. The anonymous user account will be used on the
Analysis Services connection, and must have data access permissions on the Analysis Services instance. When
you use this approach, only the user identity associated with the Anonymous account is used on the connection. If
your application requires additional identity management, you will need to choose one of the other approaches,
or supplement with an identity management solution that you provide.
Basic and Anonymous are available only when you configure Analysis Services for HTTP access, using IIS and
the msmdpump.dll to establish the connection. For more information, see Configure HTTP Access to Analysis
Services on Internet Information Services (IIS ) 8.0.
Stored Credentials
Most middle tier application services include functionality for storing a user name and password subsequently
used to retrieve data from a down-level data store, such as Analysis Services or the SQL Server relational engine.
As such, stored credentials provide a fifth alternative for retrieving data. Limitations with this approach include
maintenance overhead associated with keeping user names and passwords up to date, and the use of a single
identity on the connection. If your solution requires the identity of the original caller, then stored credentials
would not be a viable alternative.
For more information about stored credentials, see Create, Modify, and Delete Shared Data Sources (SSRS ) and
Use Excel Services with Secure Store Service in SharePoint Server 2013.
See Also
Using Impersonation with Transport Security
Configure HTTP Access to Analysis Services on Internet Information Services (IIS ) 8.0
Configure Analysis Services for Kerberos constrained delegation
SPN registration for an Analysis Services instance
Connect to Analysis Services
Configure Analysis Services for Kerberos constrained
delegation
11/27/2018 • 8 minutes to read • Edit Online
TIP
Microsoft Kerberos Configuration Manager for SQL Server is a diagnostic tool that helps troubleshoot Kerberos
related connectivity issues with SQL Server. For more information, see Microsoft Kerberos Configuration Manager for SQL
Server.
NOTE
Delegation is not required if the connection to Analysis Services is a single hop, or your solution uses stored credentials
provided by SharePoint Secure Store Service or Reporting Services. If all connections are direct connections from Excel to
an Analysis Services database, or based on stored credentials, you can use Kerberos (or NTLM) without having to
configure constrained delegation.
Kerberos constrained delegation is required if the user identity has to flow over multiple computer connections (known as
"double-hop"). When Analysis Services data access is contingent upon user identity, and the connection request is from a
delegating service, use the checklist in the next section to ensure that Analysis Services is able to impersonate the original
caller. For more information about Analysis Services authentication flows, see Microsoft BI Authentication and Identity
Delegation.
As a security best practice, Microsoft always recommends constrained delegation over unconstrained delegation.
Unconstrained delegation is a major security risk because it allows the service identity to impersonate another user on any
downstream computer, service, or application (as opposed to just those services explicitly defined via constrained
delegation).
Step 1: Verify that accounts are suitable for delegation Ensure that the accounts used to run the services have the
correct properties in Active Directory. Service accounts in
Active Directory must not be marked as sensitive accounts,
or specifically excluded from delegation scenarios. For more
information, see Understanding User Accounts.
Step 2: Register the SPN Before setting up constrained delegation, you must register a
Service Principle Name (SPN) for the Analysis Services
instance. You will need the Analysis Services SPN when
configuring Kerberos constrained delegation for middle tier
services. See SPN registration for an Analysis Services
instance for instructions.
Step 3: Configure constrained delegation After validating the accounts you want to use and registering
SPNs for those accounts, your next step is to configure up-
level services, such as IIS, Reporting Services, or SharePoint
web services for constrained delegation, specifying the
Analysis Services SPN as the specific service for which
delegation is allowed.
Step 4: Test connections When testing, connect from remote computers, under
different identities, and query Analysis Services using the
same applications as business users. You can use SQL Server
Profiler to monitor the connection. You should see the user
identity on the request. For more information, see Test for
impersonated or delegated identity in this section.
This section explains how to set up Analysis Services for trusted delegation. After you complete this task,
Analysis Services will be able to pass delegated credentials to SQL Server, in support of DirectQuery mode used
in Tabular solutions.
Before you start:
Verify that Analysis Services is started.
Verify the SPN registered for Analysis Services is valid. For instructions, see SPN registration for an
Analysis Services instance
When both prerequisites are satisfied, continue with the following steps. Note that you must be a domain
administrator to set up constrained delegation.
1. In Active Directory Users and Computers, find the service account under which Analysis Services runs.
Right-click the service account and choose Properties.
For illustrative purposes, the following screenshots use OlapSvc and SQLSvc to represent Analysis
Services and SQL Server, respectively.
OlapSvc is the account that will be configured for constrained delegation to SQLSvc. When you complete
this task, OlapSvc will have permission to pass delegated credentials on a service ticket to SQLSvc,
impersonating the original caller when requesting data.
2. On the Delegation tab, select Trust this user for delegation to specified services only, followed by
Use Kerberos only. Click Add to specify which service Analysis Services is permitted to delegate
credentials.
Delegation tab appears only when the user account (OlapSvc) is assigned to a service (Analysis Services),
and the service has an SPN registered for it. SPN registration requires that the service is running.
3. On the Add Services page, click Users or Computers.
4. On the Select Users or Computer page, enter the account used to run the SQL Server instance providing
data to Analysis Services tabular model databases. Click OK to accept the service account.
If you cannot select the account you want, verify that SQL Server is running and has an SPN registered
for that account. For more information about SPNs for the database engine, see Register a Service
Principal Name for Kerberos Connections.
5. The SQL Server instance should now appear in Add Services. Any service also using that account will
also appear in the list. Choose the SQL Server instance you want to use. Click OK to accept the instance.
6. The properties page of the Analysis Services service account should now look similar to the following
screenshot. Click OK to save your changes.
7. Test for successful delegation by connecting from a remote client computer, under a different identity, and
query the tabular model. You should see the user identity on the request in SQL Server Profiler.
See Also
Microsoft BI Authentication and Identity Delegation
Mutual Authentication Using Kerberos
Connect to Analysis Services
SPN registration for an Analysis Services instance
Connection String Properties (Analysis Services)
SPN registration for an Analysis Services instance
11/28/2018 • 10 minutes to read • Edit Online
TIP
Microsoft Kerberos Configuration Manager for SQL Server is a diagnostic tool that helps troubleshoot Kerberos
related connectivity issues with SQL Server. For more information, see Microsoft Kerberos Configuration Manager for SQL
Server.
ELEMENT DESCRIPTION
Port-number Although the port number is part of SPN syntax, you never
specify a port number when registering an Analysis Services
SPN. The colon ( : ) character, typically used to provide a port
number in standard SPN syntax, is used by Analysis Services
to specify the instance name. For an Analysis Services
instance, the port is assumed to be the default port (TCP
2383) or a port assigned by the SQL Server Browser service
(TCP 2382).
NOTE
Remember to create two SPN registrations, one for the NetBIOS host name and a second for a fully-qualified domain name
of the host. Different client applications use different host name conventions when connecting to Analysis Services. Having
two SPN registrations ensures that both versions of the host name are accounted for.
Example syntax for a named instance running as NT Service\MSOLAP$<instance-name>
This example shows setspn syntax for a named instance running under the default virtual account. In this
example, the computer host name is AW -SRV02, and the instance name is AW -FINANCE. Again, it is the
machine account that is specified for the SPN, rather than the virtual account NT Service\MSOLAP$<instance-
name>.
TIP
Verify whether the SPN was created for the Analysis Services server by running Setspn -L <domain account> or
Setspn -L <machinename> , depending on how the SPN was registered. You should see MSOLAPSVC.3/<hostname> in
the list.
Recall that nodes in an Analysis Services cluster are required to use the default port (TCP 2383) and run under
the same domain user account so that each node has the same SID. See How to Cluster SQL Server Analysis
Services for more information.
See Also
Microsoft BI Authentication and Identity Delegation
Mutual Authentication Using Kerberos
How to configure SQL Server 2008 Analysis Services and SQL Server 2005 Analysis Services to use Kerberos
authentication
Service Principal Names (SPNs) SetSPN Syntax (Setspn.exe)
What SPN do I use and how does it get there?
SetSPN
Service Accounts Step-by-Step Guide
Configure Windows Service Accounts and Permissions
How to use SPNs when you configure Web applications that are hosted on Internet Information Services
what's new in service accounts
Configure Kerberos authentication for SharePoint 2010 Products (white paper)
Configure HTTP Access to Analysis Services on IIS
8.0
2/11/2019 • 18 minutes to read • Edit Online
Overview
MSMDPUMP is an ISAPI extension that loads into IIS and provides redirection to a local or remote Analysis
Services instance. By configuring this ISAPI extension, you create an HTTP endpoint to an Analysis Services
instance.
You must create and configure one virtual directory for each HTTP endpoint. Each endpoint will need its own set
of MSMDPUMP files, for each Analysis Services instance you want to connect to. A configuration file in this file
set specifies the name of the Analysis Services instance used for each HTTP endpoint.
On IIS, MSMDPUMP connects to Analysis Services using the Analysis Services OLE DB provider over TCP/IP.
Although client requests can originate outside of domain trust, both Analysis Services and IIS must be in the
same domain or in trusted domains in order for the native connection to succeed.
When MSMDPUMP connects to Analysis Services, it does so under a Windows user identity. This account will
either be the Anonymous account if you configured the virtual directory for anonymous connections, or a
Windows user account. The account must have the appropriate data access rights on the Analysis Services
server and database.
The following table lists additional considerations when you enable HTTP access for different scenarios.
SCENARIO CONFIGURATION
IIS and Analysis Services on the same computer This is the simplest configuration because it allows you to
use the default configuration (where the server name is
localhost), the local Analysis Services OLE DB provider, and
Windows integrated security with NTLM. Assuming that the
client is also in the same domain, authentication is
transparent to the user, with no additional work on your
part.
IIS and Analysis Services on different computers For this topology, you must install the Analysis Services OLE
DB provider on the web server. You must also edit the
msmdpump.ini file to specify the location of Analysis Services
instance on the remote computer.
Client connections are from a non-trusted domain or an Client connections from a non-trusted domain introduce
extranet connection further restrictions on authentication. By default, Analysis
Services uses Windows integrated authentication, which
requires users to be on the same domain as the server. If
you have Extranet users who connect to IIS from outside the
domain, those users will get a connection error if the server
is configured to use the default settings.
Prerequisites
The instructions in this article assume IIS is already configured and that Analysis Services is already installed.
Windows Server 2012 ships with IIS 8.x as a server role that you can enable on the system.
Extra configuration in IIS 8.0
The default configuration of IIS 8.0 is missing components that are necessary for HTTP access to Analysis
Services. These components, found in the Security and Application Development feature areas of the Web
Server (IIS ) role, include the following:
Security | Windows Authentication, or Basic Authentication, and any other security features
required for your data access scenario.
Application Development | CGI
Application Development | ISAPI Extensions
To verify or add these components, use Server Manager | Manage | Add Roles and Features. Step through
the wizard until you get to Server Roles. Scroll down to find Web Server (IIS ).
1. Open Web Server | Security and choose the authentication methods.
2. Open Web Server | Application Development and choose CGI and ISAPI Extensions.
NOTE
Remember to unblock the ports in Windows Firewall to allow client connections to a remote Analysis Services server. For
more information, see Configure the Windows Firewall to Allow Analysis Services Access.
NOTE
The IIS manager might not be able to connect to the Analysis Services in the current version if the Database is a backup
from a previous one. This is caused by changes in the MSMDPUMP and should be solved by copying the msmdpump.dll
file from the previous working version.
3. By default, IIS creates application pools using ApplicationPoolIdentity as the security identity, which is
a valid choice for HTTP access to Analysis Services. If you have specific reasons for changing the identity,
right-click OLAP, and then select Advanced Settings. Select ApplicationPoolIdentity. Click the
Change button for this property to replace the built-in account with the custom account you want to use.
4. By default, on a 64-bit operating system, IIS sets the Enable 32-bit Applications property to false. If
you copied msmdpump.dll from a 64-bit installation of Analysis Services, this is the correct setting for the
MSMDPUMP extension on a 64-bit IIS server. If you copied the MSMDPUMP binaries from a 32-bit
installation, set it to true. Check this property now in Advanced Settings to ensure it is set correctly.
Create an application
1. In IIS Manager, open Sites, open Default Web Site. You should see a folder named Olap. This is a
reference to the OLAP folder you created under \inetpub\wwwroot.
4. Click OK. Refresh the web site and notice that the OLAP folder is now an application under the default
web site. The virtual path to the MSMDPUMP file is now established.
NOTE
Previous versions of these instructions included steps for creating a virtual directory. That step is no longer necessary.
4. Alternatively, enable Basic Authentication if your client and server applications are in different
domains. This mode requires the user to enter a user name and password. The user name and password
are transmitted over the HTTP connection to IIS. IIS will try to impersonate the user using the provided
credentials when connecting to MSMDPUMP, but the credentials will not be delegated to Analysis
Services. Instead, you will need to pass a valid user name and password on a connection, as described in
Step 6 in this document.
IMPORTANT
Please note that it is imperative for anyone building a system where the password is transmitted to have ways of
securing the communication channel. IIS provides a set of tools that help you secure the channel. For more
information, see How to Set Up SSL on IIS 7.
5. Disable Anonymous Authentication if you are using Windows or Basic authentication. When
Anonymous authentication is enabled, IIS will always use it first, even if other authentication methods are
enabled.
Under Anonymous authentication, the pump (msmdpump.dll) runs as the user account you established
for anonymous user. There is no distinction between the user connecting to IIS and the user connecting
to Analysis Services. By default, IIS uses the IUSR account, but you can change it to a domain user
account that has network permissions. You'll need this capability if IIS and Analysis Services are on
different computers.
For instructions on how to configure credentials for Anonymous authentication, see Anonymous
Authentication.
IMPORTANT
Anonymous authentication is most likely found in an extremely controlled environment, where users are given or
denied access by way of access control lists in the file system. For best practices, see Enable Anonymous
Authentication (IIS 7).
6. Click the OLAP virtual directory to open the main page. Double-click Handler Mappings.
7. Right-click anywhere on the page and then select Add Script Map. In the Add Script Map dialog box,
specify *.dll as the request path, specify c:\inetpub\wwwroot\OLAP\msmdpump.dll as the executable,
and type OLAP as the name. Keep all of the default restrictions associated with this script map.
8. When prompted to allow the ISAPI extension, click Yes.
<ConfigurationSettings>
<ServerName>localhost</ServerName>
<SessionTimeout>3600</SessionTimeout>
<ConnectionPoolSize>100</ConnectionPoolSize>
</ConfigurationSettings>
If the Analysis Services instance for which you are configuring HTTP access is located on the local computer and
installed as a default instance, there is no reason to change this setting. Otherwise, you must specify the server
name (for example, <ServerName>ADWRKS -SRV01</ServerName>). For a server that is installed as a named
instance, be sure to append the instance name (for example, <ServerName>ADWRKS -
SRV01\Tabular</ServerName>).
By default, Analysis Services listens on TCP/IP port 2383. If you installed Analysis Services as the default
instance, you do not need to specify any port in <ServerName> because Analysis Services knows how to listen
on port 2383 automatically. However, you do need to allow inbound connections to that port in Windows
Firewall. For more information, see Configure the Windows Firewall to Allow Analysis Services Access.
If you configured a named or default instance of Analysis Services to listen on a fixed port, you must add the
port number to the server name (for example, <ServerName>AW -SRV01:55555</ServerName>) and you
must allow inbound connections in Windows Firewall to that port.
Windows authentication Add to the Membership list the Windows user or group
accounts requesting Analysis Services data via impersonation
or delegation.
Basic authentication Add to the Membership list the Windows user or group
accounts that will be passed on the connection string.
For more information about setting permissions, see Authorizing access to objects and operations (Analysis
Services).
If you see an ERROR XML displayed in the browser window, you can eliminate MSMDPUMP as the potential
cause and shift your focus to the certificate.
Test connections using SQL Server Management Studio
1. In Management Studio, in the Connect to Server dialog box, select Analysis Services as the server type.
In Server name, enter the HTTP address of the msmdpump extension:
http://my-web-srv01/OLAP/msmdpump.dll .
2. Authentication must be Windows authentication, and the person using Management Studio must be an
Analysis Services administrator. An administrator can grant further permissions to enable access by other
users.
Test connections using Excel
1. On the Data tab in Excel, in Get External Data, click From Other Sources, and then choose From
Analysis Services to start the Data Connection wizard.
2. In Server name, enter the HTTP address of the msmdpump extension:
http://my-web-srv01/OLAP/msmdpump.dll .
3. For Log on credentials, choose Use Windows Authentication if you are using Windows integrated
security or NTLM, or Anonymous user.
For Basic authentication, choose Use the following User Name and Password, and then specify the
credentials used to sign on. The credentials you provide will be passed on the connection string to
Analysis Services.
Test connections using AMO
You can test HTTP access programmatically using AMO, substituting the URL of the endpoint for the server
name. For details, see Forum Post (How to sync SSAS 2008 R2 databases via HTTPS across domain/forest and
firewall boundaries).
An example connection string illustrating the syntax for HTTP (S ) access using Basic authentication:
Data Source=https://<servername>/olap/msmdpump.dll; Initial Catalog=AdventureWorksDW2012; Integrated
Security=Basic; User ID=XXXX; Password=XXXXX;
For more information about setting up the connection programmatically, see Establishing Secure Connections
in ADOMD.NET.
As a final step, be sure to follow -up with more rigorous testing by using a client computer that runs in the
network environment from which the connections will originate.
See Also
Forum post (http access using msmdpump and basic authentication)
Configure the Windows Firewall to Allow Analysis Services Access
Authorizing access to objects and operations (Analysis Services)
IIS Authentication Methods
How to Set Up SSL on IIS 7
Client libraries (data providers) used for Analysis
Services connections
5/16/2018 • 2 minutes to read • Edit Online
See also
Connect to Analysis Services
Disconnect Users and Sessions on Analysis Services
Server
10/26/2018 • 2 minutes to read • Edit Online
<Cancel xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<ConnectionID>111</ConnectionID>
<SessionID>222</SessionID>
<SPID>333</SPID>
<CancelAssociated>1</CancelAssociated>
</Cancel>
See Also
Managing Connections and Sessions (XMLA)
BeginSession Element (XMLA)
EndSession Element (XMLA)
Session Element (XMLA)
Analysis Services Developer Documentation
10/26/2018 • 4 minutes to read • Edit Online
See Also
Technical Reference Query and Expression Language Reference (Analysis Services)
Tabular Model Programming for Compatibility Level
1200 and higher
12/7/2018 • 2 minutes to read • Edit Online
Query Languages
DAX and MDX are supported for all Tabular models.
Expression Language
Filters and expressions used to create calculated objects, including measures and KPIs, are formulated in DAX. See
Understanding DAX in Tabular Models and Data Analysis Expressions (DAX) in Analysis Services.
NOTE
Analysis Services Management Objects (AMO), ADOMD.NET, and Tabular Object Model (TOM) client libraries now target the
.NET 4.0 runtime.
See Also
Analysis Services Developer Documentation
Tabular Model Programming for Compatibility Levels 1050 through 1103
Technical Reference Upgrade Analysis Services
Compatibility levels of Tabular models and databases
Tabular Model Programming for Compatibility Levels
1050 through 1103
12/7/2018 • 2 minutes to read • Edit Online
In This Section
CSDL Annotations for Business Intelligence (CSDLBI)
Understanding the Tabular Object Model at Compatibility Levels 1050 through 1103
Technical Reference for BI Annotations to CSDL
IMDEmbeddedData Interface
CSDL Annotations for Business Intelligence (CSDLBI)
10/26/2018 • 3 minutes to read • Edit Online
See Also
Understanding the Tabular Object Model at Compatibility Levels 1050 through 1103
CSDLBI Concepts
Understanding the Tabular Object Model at Compatibility Levels 1050 through 1103
CSDLBI Attributes for Report Design
11/27/2018 • 4 minutes to read • Edit Online
Model Attributes
These attributes are defined on a sub-element of a CSDL EntityContainer element.
Entity Attributes
These attributes are defined on a sub-element of either a CSDL EntitySet or EntityType element.
Field Attributes
These attributes are defined on a sub-element of a CSDL Property or NavigationProperty element.
<EntityContainer Name="SimpleModel">
<EntitySet Name="DimCustomer"EntityType="SimpleModel.DimCustomer">
<bi:EntitySet />
</EntitySet>
<EntitySet Name="DimDate" EntityType="SimpleModel.DimDate">
<bi:EntitySet />
</EntitySet>
<EntitySet Name="DimGeography" EntityType="SimpleModel.DimGeography">
<bi:EntitySet />
</EntitySet> />
The EntitySet does not contain information about columns or data in the table. The detailed description of the
columns and their properties is provided in the EntityType element.
The EntitySet element for each entity (table) includes a collection of properties that define the key column, the
data type and length of the column, nullability, sorting behavior, and so forth. For example, the following CSDL
excerpt describes three columns in the Customer table. The first column is a special hidden column used internally
by the model.
<EntityType Name="Customer">
<Key>
<PropertyRef Name="RowNumber" />
</Key>
<Property Name="RowNumber" Type="Int64" Nullable="false">
<bi:Property Hidden="true" Contents="RowNumber"
Stability="RowNumber" />
</Property>
<Property Name="CustomerKey" Type="Int64" Nullable="false">
<bi:Property />
</Property>
<Property Name="FirstName" Type="String" MaxLength="Max" FixedLength="false">
<bi:Property />
</Property>
To limit the size of the CSDLBI document that is generated, properties that appear more than once in an entity are
specified by a reference to an existing property, so that the property need be listed only once for the EntityType.
The client application can get the value of the property by finding the EntityType that matches the
OriginEntityType.
Relationships
In the Entity Data Framework, relationships are defined as associations between entities.
Associations always have exactly two ends, each pointing to a field or column in a table. Therefore, multiple
relationships are possible between two tables, if the relationships have different end points. A role name is
assigned to the end points of the association, and indicates how the association is used in the context of the data
model. An example of a role name might be ShipTo, when applied to a customer ID that is related to the customer
ID in an Orders table.
The CSDLBI representation of the model also contains attributes on the association that determine how the entities
are mapped to each other in terms of the multiplicity of the association. Multiplicity indicates whether the attribute
or column at the end point of a relationship between tables is on the one side of a relationship, or on the many side.
There is no separate value for one-to-one relationships. CSDLBI annotations support multiplicity of 0 (meaning the
entity is not associated with anything) or 0..1, which means either a one-one relationship or a one-to-many
relationship.
The following sample represents the CSDLBI output for a relationship between the tables, Date and
ProductInventory, where the two tables are joined on the column DateAlternateKey. Notice that, by default, the
name of the AssociationSet is the fully qualified name of the columns that are involved in the relationship.
However, you can change this behavior when you design the model, to use a different naming format.
RULE ACTION
Names must be unique If two strings are the same, one is made unique by appending
underscore plus a number
WARNING
Captions and qualifiers both have translations, and for a given language, one or the other might be present. This means that
in cases where a qualifier and name or qualifier and caption are concatenated, the strings could be in two different languages.
See Also
CSDL Annotations for Business Intelligence (CSDLBI)
Connection Representation (Tabular)
5/16/2018 • 2 minutes to read • Edit Online
Connection Representation
The specification for the connection object follows the rules of OLE DB providers.
Connection in AMO
When using AMO to manage a tabular model database, the DataSource object in AMO matches one-to-one to the
connection logical object.
The following code snippet shows how to create an AMO data source, or Connection object in a tabular model.
Database Representation
The database is the place where all objects that form a tabular model reside. Contained by the database, the
developer finds objects like connections, tables, roles and many more.
Database in AMO
When using AMO to manage a tabular model database, the Database object in AMO matches one-to-one the
database logical object in a tabular model.
NOTE
In order to gain access to a database object, in AMO, the user needs to have access to a server object and connect to it.
Database in ADOMD.Net
When using ADOMD to consult and query a tabular model database, connection to a specific database is obtained
through the AdomdConnection object.
You can connect directly to a certain database using the following code snippet:
Also, over an existing connection object (that hasn't been closed), you can change the current database to another
as shown in the following code snippet:
currentCnx.ChangeDatabase("myOtherDatabase");
Database in AMO
When using AMO to manage a database object, start with a Server object. Then search for your database in the
databases collection or create a new database by adding one to the collection.
The following code snippet shows the steps to connect to a server and create an empty database, after checking the
database doesn't exist:
AMO.Server CurrentServer = new AMO.Server();
try
{
CurrentServer.Connect(currentServerName);
}
catch (Exception cnxException)
{
MessageBox.Show(string.Format("Error while trying to connect to server: [{0}]\nError message: {1}",
currentServerName, cnxException.Message), "AMO to Tabular message", MessageBoxButtons.OK,
MessageBoxIcon.Error);
return;
}
newDatabaseName = DatabaseName.Text;
if (CurrentServer.Databases.Contains(newDatabaseName))
{
return;
}
try
{
AMO.Database newDatabase = CurrentServer.Databases.Add(newDatabaseName);
CurrentServer.Update();
}
catch (Exception createDBxc)
{
MessageBox.Show(String.Format("Database [{0}] couldn't be created.\n{1}", newDatabaseName,
createDBxc.Message), "AMO to Tabular message", MessageBoxButtons.OK, MessageBoxIcon.Error);
newDatabaseAvailable = false;
}
For a practical understanding on how to use AMO to create and manipulate database representations, see source
code in the Tabular AMO 2012 sample; specifically check in the following source file: Database.cs. The sample is
available at Codeplex. Sample code is provided only as a support to the logical concepts explained here, and should
not be used in a production environment.
Perspective Representation (Tabular)
5/16/2018 • 2 minutes to read • Edit Online
WARNING
Perspectives are not a security mechanism; objects outside the perspective can still be accessed by the user through other
interfaces.
Perspective Representation
In terms of AMO objects a perspective representation has a one to one mapping relationship with Perspective and
no other main AMO objects are required.
Perspective in AMO
The following code snippet shows how to create a perspective in a Tabular model. The key element in this piece of
code is the perspectiveElements; this object is a graphical representation of all the objects in the tabular model that
are exposed to the user. perspectiveElements contains 4 columns and for this scenario only columns 1, 2 and 3 are
relevant. Column 1 contains the type of element displayed -elementTypeValue-; column 2 contains the complete
name of the element --, that probably will need to parsed to enter the element in the perspective; column 3
contains a checkbox item -checkedElement- that tells if the element is part of the perspective or not.
newDatabase.Update(AMO.UpdateOptions.ExpandFull, AMO.UpdateMode.CreateOrReplace);
MessageBox.Show(String.Format("Perpective successfully updated."), "AMO to Tabular message",
MessageBoxButtons.OK, MessageBoxIcon.Information);
}
AMO2Tabular sample
However, to have an understanding on how to use AMO to create and manipulate perspective representations see
the source code of the AMO to Tabular sample. The sample is available at Codeplex. An important note about the
code: the code is provided only as a support to the logical concepts explained here and should not be used in a
production environment; nor should it be used for other purpose other than the pedagogical one.
Querying a Tabular Model
5/16/2018 • 3 minutes to read • Edit Online
Example
If the above code is used with the following MDX expression:
Against the sample model 'Adventure Works DW Tabular Denali CTP3' you should receive the following values as
the resulting table:
PRODUCT CATEGORY
CALENDAR YEAR NAME INTERNET TOTAL SALES RESELLER TOTAL SALES TOTAL SALES
PRODUCT CATEGORY
CALENDAR YEAR NAME INTERNET TOTAL SALES RESELLER TOTAL SALES TOTAL SALES
DEFINE
MEASURE 'Product Category'[Internet Sales] = SUM( 'Internet Sales'[Sales Amount])
MEASURE 'Product Category'[Reseller Sales] = SUM('Reseller Sales'[Sales Amount]) \n"
EVALUATE ADDCOLUMNS('Product Category', \"Internet Sales - All Years\", 'Product Category'[Internet Sales],
\"Reseller Sales - All Years\", 'Product Category'[Reseller Sales])
And sent to the server using the above sample code, against the sample model 'Adventure Works DW Tabular
Denali CTP3' you should receive the following values as the resulting table:
2 2 Components $ 11,799,076.66
Relationship Representation (Tabular)
5/16/2018 • 5 minutes to read • Edit Online
Relationship Representation
In tabular models, multiple relationships can be defined between two tables. When multiple relationships, between
two tables, are defined only one can be defined as the default relationship for the model and it is named as the
Active relationship; all other relationships are named as Inactive.
Relationship in AMO
In terms of AMO objects all inactive relationships have a representation of a one to one mapping relationship with
Relationship and no other main AMO objects are required; for the active relationship other requirements exist and
a mapping to the ReferenceMeasureGroupDimension is also required.
The following code snippets show how to create a relationship in Tabular models, how to activate a relationship
and how to define a primary key in a table (other than "RowNumber"). To create an active relationship a primary
key need to be defined in the primary key table - PKTableName - of the relationship (the one side of the
relationship), the sample shown here creates the primary key on the PKColumnName if no primary key is defined
in this column. Inactive relationships can be created without the need of having a primary key on the primary key
column.
//Terminology note:
// - the many side of the relationship is named the From end in AMO
// - the PK side of the relationship in named the To end in AMO
//
//It seems relationships flow FROM the many side of the relationship in TO the primary key side of the
relationship in AMO
//
//Verify the relationship we are creating does not exist, regardless of name.
//if it exists, return true (no need to recreate it)
//if it doesn't exists it will be created after this validation
//
foreach (AMO.Relationship currentRelationship in tabularDb.Dimensions[MVTableName].Relationships)
{
if ((currentRelationship.FromRelationshipEnd.Attributes[0].AttributeID == MVColumnName)
&& (currentRelationship.ToRelationshipEnd.DimensionID == PKTableName)
&& (currentRelationship.ToRelationshipEnd.Attributes[0].AttributeID == PKColumnName))
{
if (forceActive)
{
//Activate the relationship
setActiveRelationship(tabularDb.Cubes[cubeName], MVTableName, MVColumnName, PKTableName,
currentRelationship.ID);
//Update server with changes made here
tabularDb.Update(AMO.UpdateOptions.ExpandFull, AMO.UpdateMode.CreateOrReplace);
tabularDb.Cubes[cubeName].MeasureGroups[MVTableName].Process(AMO.ProcessType.ProcessFull);
}
return true;
}
}
//A relationship like the one to be created does not exist; ergo, let's create it:
//First, create the INACTIVE relationship definitions in the MultipleValues end of the relationship
#region define unique name for relationship
string newRelationshipID = string.Format("Relationship _{0}_{1}_ to _{2}_{3}_", MVTableName, MVColumnName,
PKTableName, PKColumnName);
int rootLen = newRelationshipID.Length;
for (int i = 0; tabularDb.Dimensions[MVTableName].Relationships.Contains(newRelationshipID); )
{
newRelationshipID = string.Format("{0}_{1,8:0}", newRelationshipID.Substring(0, rootLen), i);
}
#endregion
AMO.Relationship newRelationship = tabularDb.Dimensions[MVTableName].Relationships.Add(newRelationshipID);
newRelationship.FromRelationshipEnd.DimensionID = MVTableName;
newRelationship.FromRelationshipEnd.Attributes.Add(MVColumnName);
newRelationship.FromRelationshipEnd.Multiplicity = AMO.Multiplicity.Many;
newRelationship.FromRelationshipEnd.Role = string.Empty;
newRelationship.ToRelationshipEnd.DimensionID = PKTableName;
newRelationship.ToRelationshipEnd.Attributes.Add(PKColumnName);
newRelationship.ToRelationshipEnd.Multiplicity = AMO.Multiplicity.One;
newRelationship.ToRelationshipEnd.Role = string.Empty;
if (!currentMG.Dimensions.Contains(PKTableName))
{
AMO.ReferenceMeasureGroupDimension newReferenceMGDim = new AMO.ReferenceMeasureGroupDimension();
newReferenceMGDim.CubeDimensionID = PKTableName;
newReferenceMGDim.IntermediateCubeDimensionID = MVTableName;
newReferenceMGDim.IntermediateGranularityAttributeID = MVColumnName;
newReferenceMGDim.Materialization = AMO.ReferenceDimensionMaterialization.Regular;
newReferenceMGDim.RelationshipID = relationshipID;
foreach (AMO.CubeAttribute PKAttribute in currentCube.Dimensions[PKTableName].Attributes)
{
AMO.MeasureGroupAttribute PKMGAttribute =
newReferenceMGDim.Attributes.Add(PKAttribute.AttributeID);
OleDbType PKMGAttributeType = PKAttribute.Attribute.KeyColumns[0].DataType;
PKMGAttribute.KeyColumns.Add(new AMO.DataItem(PKTableName, PKAttribute.AttributeID,
PKMGAttributeType));
PKMGAttribute.KeyColumns[0].Source = new AMO.ColumnBinding(PKTableName, PKAttribute.AttributeID);
}
currentMG.Dimensions.Add(newReferenceMGDim);
newReferenceMGDim.Validate(errors, true);
if (errors.Count > 0)
{
StringBuilder errorMessages = new StringBuilder();
foreach (AMO.ValidationError err in errors)
{
errorMessages.AppendLine(string.Format("At {2}: # {0} : {1}", err.ErrorCode,
err.FullErrorText, err.Source));
}
throw new AMO.AmoException(errorMessages.ToString());
}
//Update changes in the server
currentMG.Update(AMO.UpdateOptions.ExpandFull, AMO.UpdateMode.CreateOrReplace);
}
else
{
AMO.ReferenceMeasureGroupDimension currentReferenceMGDim =
(AMO.ReferenceMeasureGroupDimension)currentMG.Dimensions[PKTableName];
currentReferenceMGDim.RelationshipID = relationshipID;
currentReferenceMGDim.IntermediateGranularityAttributeID = MVColumnName;
//Update changes in the server
currentMG.Update(AMO.UpdateOptions.ExpandFull, AMO.UpdateMode.UpdateOrCreate);
}
//process MG to activate relationship
currentMG.Process(AMO.ProcessType.ProcessFull);
tabularDb.Dimensions[PKTableName].Attributes["RowNumber"].AttributeRelationships[currentDimAttribute.ID].Cardi
nality = AMO.Cardinality.Many;
}
}
}
{
AMO.DimensionAttribute currentAttribute =
tabularDb.Dimensions[PKTableName].Attributes["RowNumber"];
AMO.AttributeRelationship currentAttributeRelationship =
tabularDb.Dimensions[PKTableName].Attributes[PKColumnName].AttributeRelationships.Add(currentAttribute.ID);
currentAttributeRelationship.OverrideBehavior = AMO.OverrideBehavior.None;
}
tabularDb.Dimensions[PKTableName].Attributes[PKColumnName].AttributeRelationships["RowNumber"].Cardinality =
AMO.Cardinality.One;
AMO2Tabular sample
However, to have an understanding on how to use AMO to create and manipulate relationship representations see
the source code of the AMO to Tabular sample. The sample is available at Codeplex. An important note about the
code: the code is provided only as a support to the logical concepts explained here and should not be used in a
production environment; nor should it be used for other purpose other than the pedagogical one.
Tables - Calculated Column Representation
5/16/2018 • 2 minutes to read • Edit Online
if (newDatabase.Dimensions[ccTableName].Attributes.Contains(ccName))
{
MessageBox.Show(String.Format("Calculated Column name already defined."), "AMO to Tabular message",
MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
//Add CC attribute to the Dimension
AMO.Dimension dim = newDatabase.Dimensions[ccTableName];
AMO.DimensionAttribute currentAttribute = dim.Attributes.Add(ccName, ccName);
currentAttribute.Usage = AMO.AttributeUsage.Regular;
currentAttribute.KeyUniquenessGuarantee = false;
currentAttribute.OrderBy = AMO.OrderBy.Key;
currentAttribute.OrderBy = AMO.OrderBy.Key;
AMO.AttributeRelationship currentAttributeRelationship =
dim.Attributes["RowNumber"].AttributeRelationships.Add(currentAttribute.ID);
currentAttributeRelationship.Cardinality = AMO.Cardinality.Many;
currentAttributeRelationship.OverrideBehavior = AMO.OverrideBehavior.None;
currentMGDim.Attributes.Add(mga);
try
{
//Update Dimension, CubeDimension and MG in server
newDatabase.Update(AMO.UpdateOptions.ExpandFull, AMO.UpdateMode.UpdateOrCreate);
}
catch (AMO.OperationException amoOpXp)
{
MessageBox.Show(String.Format("Calculated Column expression contains syntax errors, or references
undefined or missspelled elements.\nError message: {0}", amoOpXp.Message), "AMO to Tabular message",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
catch (AMO.AmoException amoXp)
{
MessageBox.Show(String.Format("AMO exception accessing the server.\nError message: {0}",
amoXp.Message), "AMO to Tabular message", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
catch (Exception)
{
throw;
}
}
Tables - Calculated Measure Representation
5/16/2018 • 2 minutes to read • Edit Online
//ToDo: Verify if measure already exits and ask user what wants to do next
if (mdxScript.Commands.Count == 1)
{
measuresCommand.AppendLine("-------------------------------------------------------------");
measuresCommand.AppendLine("-- Tabular Model measures command (do not modify manually) --");
measuresCommand.AppendLine("-------------------------------------------------------------");
measuresCommand.AppendLine();
measuresCommand.AppendLine();
mdxScript.Commands.Add(new AMO.Command(measuresCommand.ToString()));
}
else
else
{
measuresCommand.Append(mdxScript.Commands[1].Text);
}
measuresCommand.AppendLine(string.Format("CREATE MEASURE '{0}'[{1}]={2};", cmTableName, cmName,
newCalculatedMeasureExpression));
mdxScript.Commands[1].Text = measuresCommand.ToString();
if (!mdxScript.CalculationProperties.Contains(cmName))
{
AMO.CalculationProperty cp = new AMO.CalculationProperty(cmName, AMO.CalculationType.Member);
cp.FormatString = ""; // ToDo: Get formatting attributes for the member
cp.Visible = true;
mdxScript.CalculationProperties.Add(cp);
}
try
{
modelCube.Update(AMO.UpdateOptions.ExpandFull, AMO.UpdateMode.UpdateOrCreate);
MessageBox.Show(String.Format("Calculated Measure successfully defined."), "AMO to Tabular message",
MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (AMO.OperationException amoOpXp)
{
MessageBox.Show(String.Format("Calculated Measure expression contains syntax errors, or references
undefined or missspelled elements.\nError message: {0}", amoOpXp.Message), "AMO to Tabular message",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
catch (AMO.AmoException amoXp)
{
MessageBox.Show(String.Format("AMO exception accessing the server.\nError message: {0}",
amoXp.Message), "AMO to Tabular message", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
catch (Exception)
{
throw;
}
}
Tables - Hierarchy Representation
5/16/2018 • 2 minutes to read • Edit Online
Hierarchy Representation
Hierarchy in AMO
When using AMO to manage a tabular model table, there is a one-to-one object match for a hierarchy in AMO. A
hierarchy is represented by the Hierarchy object.
The following code snippet shows how to add a hierarchy to an existing tabular model. The code assumes you have
an AMO database object, newDatabase, and an AMO cube object, modelCube.
try
{
if (newDatabase.Dimensions[tableName].Hierarchies.Contains(hierarchyName))
{
//Hierarchy exists... deleting it to write it later
newDatabase.Dimensions[tableName].Hierarchies.Remove(hierarchyName, true);
newDatabase.Dimensions[tableName].Update(AMO.UpdateOptions.AlterDependents);
}
AMO.Hierarchy currentHierarchy = newDatabase.Dimensions[tableName].Hierarchies.Add(hierarchyName,
hierarchyName);
currentHierarchy.AllMemberName = string.Format("(All of {0})", hierarchyName);
//Parse hierarchyLayout
using (StringReader levels = new StringReader(levelsText))
{
//Each line:
// must come with: The columnId of the attribute in the dimension --> this represents the
SourceAttributeID
// optional: A display name for the Level (if this argument doesn't come the default is the
SourceAttributeID)
string line;
string line;
while ((line = levels.ReadLine()) != null)
{
if (string.IsNullOrEmpty(line) || string.IsNullOrWhiteSpace(line)) continue;
line = line.Trim();
string[] hierarchyData = line.Split(',');
if (string.IsNullOrEmpty(hierarchyData[0])) continue; //first argument cannot be empty or
blank,
//assume is a blank line and ignore it
string levelSourceAttributeID = hierarchyData[0].Trim();
string levelID = (hierarchyData.Length > 1 && !string.IsNullOrEmpty(hierarchyData[1])) ?
hierarchyData[1].Trim() : levelSourceAttributeID;
currentHierarchy.Levels.Add(levelID).SourceAttributeID = levelSourceAttributeID;
}
}
newDatabase.Dimensions[tableName].Update(AMO.UpdateOptions.AlterDependents);
}
catch (Exception ex)
{
MessageBox.Show(String.Format("Error creating hierarchy [{0}].\nError message: {1}",
newHierarchyName.Text, ex.Message), "AMO to Tabular message", MessageBoxButtons.OK, MessageBoxIcon.Warning);
if (newDatabase.Dimensions[tableName].Hierarchies.Contains(hierarchyName))
{
//Hierarchy was created but exception prevented complete hierarchy to be written... deleting
incomplete hierarchy
newDatabase.Dimensions[tableName].Hierarchies.Remove(hierarchyName, true);
newDatabase.Dimensions[tableName].Update(AMO.UpdateOptions.AlterDependents);
}
}
newDatabase.Dimensions[tableName].Process(AMO.ProcessType.ProcessFull);
modelCube.MeasureGroups[tableName].Process(AMO.ProcessType.ProcessFull);
}
Tables - Key Performance Indicator Representation
11/28/2018 • 4 minutes to read • Edit Online
//Status
if (string.IsNullOrEmpty(firstStatusThresholdValue.Text)
|| string.IsNullOrWhiteSpace(firstStatusThresholdValue.Text)
|| !double.TryParse(firstStatusThresholdValue.Text, out status1ThresholdValue)
|| string.IsNullOrEmpty(secondStatusThresholdValue.Text)
|| string.IsNullOrWhiteSpace(secondStatusThresholdValue.Text)
|| !double.TryParse(secondStatusThresholdValue.Text, out status2ThresholdValue))
{
MessageBox.Show(String.Format("Status Threshold are not defined or they are not a valid number."), "AMO
to Tabular message", MessageBoxButtons.OK, MessageBoxIcon.Error);
to Tabular message", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
if (string.IsNullOrEmpty(statusValueRedArea.Text)
|| string.IsNullOrWhiteSpace(statusValueRedArea.Text)
|| !double.TryParse(statusValueRedArea.Text, out redAreaValue)
|| string.IsNullOrEmpty(statusValueYellowArea.Text)
|| string.IsNullOrWhiteSpace(statusValueYellowArea.Text)
|| !double.TryParse(statusValueYellowArea.Text, out yellowAreaValue)
|| string.IsNullOrEmpty(statusValueGreenArea.Text)
|| string.IsNullOrWhiteSpace(statusValueGreenArea.Text)
|| !double.TryParse(statusValueGreenArea.Text, out greenAreaValue))
{
MessageBox.Show(String.Format("Status Area values are not defined or they are not a valid number."),
"AMO to Tabular message", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
string goalExpression;
if (staticTargetKPI.Checked)
{//Static KPI Goal selected
goalExpression = KPIGoal.ToString();
}
else
{//Measure KPI Goal selected
string measureGoalMeasureName = ((DataRowView)KpiTargetMeasures.CheckedItems[0])[1].ToString();
goalExpression = string.Format("[Measures].[{0}]", measureGoalMeasureName);
}
string statusExpression;
if (staticTargetKPI.Checked)
{//Static KPI Goal selected
statusExpression = string.Format("KpiValue(\"{0}\")", kpiMeasureName).Trim();
}
else
{//Measure KPI Goal selected
string measureGoalMeasureName = ((DataRowView)KpiTargetMeasures.CheckedItems[0])[1].ToString().Trim();
AMO2Tabular sample
To have an understanding on how to use AMO to create and manipulate Key Performance Indicator
representations see the source code of the AMO to Tabular sample; specifically check in the following source file:
AddKPIs.cs. The sample is available at Codeplex. An important note about the code: the code is provided only as a
support to the logical concepts explained here and should not be used in a production environment; nor should it
be used for other purpose other than the pedagogical one.
Tables - Partition Representation
5/16/2018 • 2 minutes to read • Edit Online
Partition Representation
In terms of AMO objects a partition representation has a one to one mapping relationship with Partition and no
other main AMO objects are required
Partition in AMO
When using AMO to manage a partition in a you need to find the measure group that represents the Tabular
Model table and work from there.
The following code snippet shows how to add a partition to an existing tabular model table.
private void AddPartition(
AMO.Cube modelCube
, AMO.DataSource newDatasource
, string mgName
, string newPartitionName
, string partitionSelectStatement
, Boolean processPartition
)
{
mgName = mgName.Trim();
newPartitionName = newPartitionName.Trim();
partitionSelectStatement = partitionSelectStatement.Trim();
//Validate Input
if (string.IsNullOrEmpty(newPartitionName) || string.IsNullOrWhiteSpace(newPartitionName))
{
MessageBox.Show(String.Format("Partition Name cannot be empty or blank"), "AMO to Tabular message",
MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
if (modelCube.MeasureGroups[mgName].Partitions.ContainsName(newPartitionName))
{
MessageBox.Show(String.Format("Partition Name already defined. Duplicated names are not allowed"), "AMO
to Tabular message", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
if (string.IsNullOrEmpty(partitionSelectStatement) || string.IsNullOrWhiteSpace(partitionSelectStatement))
{
MessageBox.Show(String.Format("Select statement cannot be empty or blank"), "AMO to Tabular message",
MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
//Input validated
string partitionID = newPartitionName; //Using partition name as the ID
AMO.Partition currentPartition = new AMO.Partition(partitionID, partitionID);
currentPartition.StorageMode = AMO.StorageMode.InMemory;
currentPartition.ProcessingMode = AMO.ProcessingMode.Regular;
currentPartition.Source = new AMO.QueryBinding(newDatasource.ID, partitionSelectStatement);
modelCube.MeasureGroups[mgName].Partitions.Add(currentPartition);
try
{
modelCube.Update(AMO.UpdateOptions.ExpandFull, AMO.UpdateMode.UpdateOrCreate);
if (processPartition)
{
modelCube.MeasureGroups[mgName].Partitions[partitionID].Process(AMO.ProcessType.ProcessFull);
MessageBox.Show(String.Format("Partition successfully processed."), "AMO to Tabular message",
MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
catch (AMO.AmoException amoXp)
{
MessageBox.Show(String.Format("AMO exception accessing the server.\nError message: {0}",
amoXp.Message), "AMO to Tabular message", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
catch (Exception)
{
throw;
}
}
AMO2Tabular sample
However, to have an understanding on how to use AMO to create and manipulate partition representations see
the source code of the AMO to Tabular sample. The sample is available at Codeplex. An important note about the
code: the code is provided only as a support to the logical concepts explained here and should not be used in a
production environment; nor should it be used for other purpose other than the pedagogical one.
Tables Representation (Tabular)
5/16/2018 • 5 minutes to read • Edit Online
Tables Representation
Tables in AMO
When using AMO to manage a table, there is no one-to-one object match. In AMO, a table is represented by a
Dimension and MeasureGroup. For a measure group to exist, a Cube must be defined to host the measure group.
For a dimension, measure group, and cube to exist, a Data Source View object must be defined to hold the binding
definitions to the data source.
From a procedural perspective, a Data Source View needs to be created before any other object is defined. The
data source view object contains the mapping for all relevant objects in the data source. The mapping of the
relational model is embedded in the data source view as a .Net DataSet object and stored in the Schema property
of the DSV.
The following code snippet assumes you have a SQL client connection string, a dictionary of Select statements that
map to all tables in the relational model you intend to represent in your tabular model, and a variable
newDataSourceViewName with the name of the data source view (usually the name of your relational database).
Once the Data Source View has been created and updated, the cube object needs to be created, but not updated in
the server until the first table is created. A cube object cannot be created empty. The following code snippet shows
how to create a cube; the snippet assumes you have a non-empty string newCubeName with the name of the cube
already validated for duplicates too.
modelCube = newDatabase.Cubes.Add(newCubeName, newCubeName);
modelCube.Source = new AMO.DataSourceViewBinding(newDatasourceView.ID);
modelCube.StorageMode = AMO.StorageMode.InMemory;
modelCube.Language = newDatabase.Language;
modelCube.Collation = newDatabase.Collation;
//Create initial MdxScript
AMO.MdxScript mdxScript = modelCube.MdxScripts.Add("MdxScript", "MdxScript");
StringBuilder initialCommand = new StringBuilder();
initialCommand.AppendLine("CALCULATE;");
initialCommand.AppendLine("CREATE MEMBER CURRENTCUBE.Measures.[__No measures defined] AS 1;");
initialCommand.AppendLine("ALTER CUBE CURRENTCUBE UPDATE DIMENSION Measures, Default_Member = [__No measures
defined];");
mdxScript.Commands.Add(new AMO.Command(initialCommand.ToString()));
Once the cube is defined locally, tables can be created and updated. The following procedure outlines the necessary
steps to create a table:
1. Create the dimension that represents the table and don't update the server yet.
2. Create the RowNumber attribute and define it as the key attribute of the dimension.
3. Create dimension attributes and mark them with a one-to-many relationship to RowNumber.
4. Add dimension to cube dimensions.
5. Create the measure group that also represents the table.
6. Add dimension to measure group.
7. Create AMO default measure object to the measure group. Note, this is the only time an AMO measure
object is used; calculated measures, in tabular models, are defined in the AMO MdxScripts["MdxScript"]
object.
8. Create default partition.
9. Update database.
The following code snippet shows how to create a table:
if (db.Dimensions.Contains(tableID))
{
if (cb.MeasureGroups.Contains(tableID))
{
cb.MeasureGroups[tableID].Measures.Clear();
cb.MeasureGroups[tableID].Partitions.Clear();
cb.MeasureGroups.Remove(tableID, true);
}
if (cb.Dimensions.Contains(tableID))
{
cb.Dimensions.Remove(tableID, true);
}
db.Dimensions.Remove(tableID);
}
#region Create Dimension
//Define Dimension general properties
AMO.Dimension currentDimension = db.Dimensions.AddNew(tableID, tableID);
currentDimension.Source = new AMO.DataSourceViewBinding(newDatasourceView.ID);
currentDimension.StorageMode = AMO.DimensionStorageMode.InMemory;
currentDimension.UnknownMember = AMO.UnknownMemberBehavior.AutomaticNull;
currentDimension.UnknownMemberName = "Unknown";
currentDimension.ErrorConfiguration = new AMO.ErrorConfiguration();
currentDimension.ErrorConfiguration.KeyNotFound = AMO.ErrorOption.IgnoreError;
currentDimension.ErrorConfiguration.KeyDuplicate = AMO.ErrorOption.ReportAndStop;
currentDimension.ErrorConfiguration.NullKeyNotAllowed = AMO.ErrorOption.ReportAndStop;
currentDimension.Language = db.Language;
currentDimension.Collation = db.Collation;
currentDimension.ProactiveCaching = new AMO.ProactiveCaching();
TimeSpan defaultProactiveChachingTimeSpan = new TimeSpan(0, 0, -1);
currentDimension.ProactiveCaching.SilenceInterval = defaultProactiveChachingTimeSpan;
currentDimension.ProactiveCaching.Latency = defaultProactiveChachingTimeSpan;
currentDimension.ProactiveCaching.SilenceOverrideInterval = defaultProactiveChachingTimeSpan;
currentDimension.ProactiveCaching.ForceRebuildInterval = defaultProactiveChachingTimeSpan;
currentDimension.ProactiveCaching.Source = new AMO.ProactiveCachingInheritedBinding();
//Manualy add a "RowNumber" attribute as the key attribute of the dimension, until a primary key is defined
//"RowNumber" a required column for a tabular model and has to be of type AMO.AttributeType.RowNumber and
binding AMO.RowNumberBinding.
//The name of the "RowNumber" attribute can be any name, as long as type and binding are correctly set
//By default, the MS client tools set the column name and column ID of the RowNumber attribute to
"RowNumber"
//In this sample, to avoid problems, on any customer table that contains a column named 'RowNumber'
//the Id value of the column (in the dimension object) will be renamed to 'RowNumber_in_<TableName>' and
the Name of the column will remain "RowNumber"
//Adding Dimension
AMO.DegenerateMeasureGroupDimension currentMGDim = new AMO.DegenerateMeasureGroupDimension(tableID);
currentMeasureGroup.Dimensions.Add(currentMGDim);
currentMGDim.ShareDimensionStorage = AMO.StorageSharingMode.Shared;
currentMGDim.CubeDimensionID = tableID;
foreach (AMO.CubeAttribute ca in cb.Dimensions[tableID].Attributes)
{
AMO.MeasureGroupAttribute mga = new AMO.MeasureGroupAttribute(ca.AttributeID);
if (mga.AttributeID == "RowNumber")
{
mga.Type = AMO.MeasureGroupAttributeType.Granularity;
AMO.DataItem rowNumberKeyColumn = new AMO.DataItem(new AMO.ColumnBinding(tableID, "RowNumber"));
rowNumberKeyColumn.DataType = System.Data.OleDb.OleDbType.Integer;
mga.KeyColumns.Add(rowNumberKeyColumn);
}
else
{
foreach (AMO.DataItem di in ca.Attribute.KeyColumns)
{
AMO.DataItem keyColumn = new AMO.DataItem(new AMO.ColumnBinding(tableID,
((AMO.ColumnBinding)di.Source).ColumnID));
keyColumn.DataType = di.DataType;
keyColumn.NullProcessing = AMO.NullProcessing.Preserve;
keyColumn.InvalidXmlCharacters = AMO.InvalidXmlCharacters.Remove;
mga.KeyColumns.Add(keyColumn);
}
}
currentMGDim.Attributes.Add(mga);
}
//Partitions
AMO.Partition currentPartition = new AMO.Partition(tableID, tableID);
currentPartition.StorageMode = AMO.StorageMode.InMemory;
currentPartition.ProcessingMode = AMO.ProcessingMode.Regular;
currentPartition.Source = new AMO.QueryBinding(newDatasource.ID,
(String)dataTable.ExtendedProperties["sqlStmt"]);
currentMeasureGroup.Partitions.Add(currentPartition);
#endregion
return true;
}
Cau t i on
The above code snippet has no error checking or clean up procedures in case of failure.
Understanding Tabular Object Model at Levels 1050
through 1103
11/28/2018 • 5 minutes to read • Edit Online
Database Representation
A database provides the container object for the tabular model. All objects in a tabular model are contained in the
database. In terms of AMO objects, a database representation has a one-to-one mapping relationship with
xref:Microsoft.AnalysisServices.Database , and no other main AMO objects are required. It is important to note
that this doesn't mean that all contained objects in the AMO database object can be used when modeling.
See Database Representation(Tabular) for a detailed explanation on how to create and manipulate the database
representation.
Connection Representation
A connection establishes the relationship between the data to be included in a tabular model solution and the
model itself. In terms of AMO objects, a connection has a one-to-one mapping relationship with
xref:Microsoft.AnalysisServices.DataSource , and no other main AMO objects are required. It is important to note
that this doesn't mean that all contained objects in the AMO datasource object can be used when modeling.
See Connection Representation (Tabular) for a detailed explanation on how to create and manipulate the data
source representation.
Table Representation
Tables are database objects that contain the data in the database. In terms of AMO objects, a table has a one-to-
many mapping relationship. A table is represented by the usage of the following AMO objects:
xref:Microsoft.AnalysisServices.DataSourceView , xref:Microsoft.AnalysisServices.Dimension ,
xref:Microsoft.AnalysisServices.Cube , xref:Microsoft.AnalysisServices.CubeDimension ,
xref:Microsoft.AnalysisServices.MeasureGroup and xref:Microsoft.AnalysisServices.Partition are the main
required objects. However, it is important to note that this doesn't mean that all contained objects in the
previously mentioned AMO objects can be used when modeling.
See Tables Representation (Tabular) for a detailed explanation on how to create and manipulate the table
representation.
Calculated Column Representation
Calculated columns are evaluated expressions that generate a column in a table, where a new value is calculated
and stored for each row in the table. In terms of AMO objects, a calculated column has a one-to-many mapping
relationship. A calculated column is represented by the usage of the following AMO objects:
xref:Microsoft.AnalysisServices.Dimension and xref:Microsoft.AnalysisServices.MeasureGroup are the main
required objects. It is important to note that this doesn't mean that all contained objects in the previously
mentioned AMO objects can be used when modeling.
See Calculated Column Representation (Tabular) for a detailed explanation on how to create and manipulate the
calculated column representation.
Calculated Measure Representation
Calculated Measures are stored expressions that are evaluated upon request once the model is deployed. In terms
of AMO objects, a calculated measure has a one-to-many mapping relationship. A calculated column is
represented by the usage of the following AMO objects: xref:Microsoft.AnalysisServices.MdxScript.Commands%2A
and xref:Microsoft.AnalysisServices.MdxScript.CalculationProperties%2A are the main required objects. It is
important to note that this doesn't mean that all contained objects in the previously mentioned AMO objects can
be used when modeling.
NOTE
The xref:Microsoft.AnalysisServices.Measure objects have no relationship with the calculated measures in tabular
models, and are not supported in tabular models.
See Calculated Measure Representation (Tabular) for a detailed explanation on how to create and manipulate the
calculated measure representation.
Hierarchy Representation
Hierarchies are a mechanism to provide a richer drill-up and drill-down experience to the end user. In terms of
AMO objects, a hierarchy representation has a one-to-one mapping relationship with
xref:Microsoft.AnalysisServices.Hierarchy , and no other main AMO objects are required. It is important to note
that this doesn't mean that all contained objects in the AMO database object can be used when doing tabular
modeling.
See Hierarchy Representation (Tabular) for a detailed explanation on how to create and manipulate the hierarchy
representation.
Key Performance Indicator -KPI - Representation
A KPI is used to gauge performance of a value, defined by a Base measure, against a Target value. In terms of
AMO objects, a KPI representation has a one-to-many mapping relationship. A KPI is represented by the usage of
the following AMO objects: xref:Microsoft.AnalysisServices.MdxScript.Commands%2A and
xref:Microsoft.AnalysisServices.MdxScript.CalculationProperties%2A are the main required objects. It is important
to note that this doesn't mean that all contained objects in the previously mentioned AMO objects can be used
when modeling.
NOTE
Also, important distinction, the xref:Microsoft.AnalysisServices.Kpi objects have no relationship with the KPIs in
tabular models. And, they are not supported in tabular models.
See Key Performance Indicator Representation (Tabular) for a detailed explanation on how to create and
manipulate the KPI representation.
Partition Representation
For operational purposes, a table can be divided in different subsets of rows that, when combined together, form
the table. Each of those subsets is a partition of the table. In terms of AMO objects, a partition representation has
a one-to-one mapping relationship with xref:Microsoft.AnalysisServices.Partition and no other main AMO
objects are required. It is important to note that this doesn't mean that all contained objects in the AMO database
object can be used when modeling.
See Partition Representation (Tabular) for a detailed explanation on how to create and manipulate the partition
representation.
Relationship Representation
A relationship is a connection between two tables of data. The relationship establishes how the data in the two
tables should be correlated.
In tabular models, multiple relationships can be defined between two tables. When multiple relationships between
two tables are defined, only one can be defined as the default Active relationship. All other relationships are
Inactive.
In terms of AMO objects, all inactive relationships have a representation of a one-to-one mapping relationship
with xref:Microsoft.AnalysisServices.Relationship , and no other main AMO objects are required. For the active
relationship, other requirements exist and a mapping to the
xref:Microsoft.AnalysisServices.ReferenceMeasureGroupDimension is also required. It is important to note that this
doesn't mean that all contained objects in the AMO relationship or referenceMeasureGroupDimension object can
be used when modeling.
See Relationship Representation (Tabular) for a detailed explanation on how to create and manipulate the
relationship representation.
Perspective Representation
A perspective is a mechanism to simplify or focus the mode. In terms of AMO objects, a relationship
representation has a one-to-one mapping relationship with xref:Microsoft.AnalysisServices.Perspective and no
other main AMO objects are required. It is important to note that this doesn't mean that all contained objects in
the AMO perspective object can be used when doing tabular modeling.
See Perspective Representation (Tabular) for a detailed explanation on how to create and manipulate the
perspective representation.
WARNING
Perspectives are not a security mechanism; objects outside the perspective can still be accessed by the user through other
interfaces.
IMDEmbeddedData Interface
5/16/2018 • 4 minutes to read • Edit Online
Reference
The following reference documents the IMDEmbeddedData interface as presented in msmd.h header file.
Source file: PXOEmbeddedData.idl
[
local,
object,
uuid(6B6691CF-5453-41c2-ADD9-4F320B7FD421),
pointer_default(unique)
]
interface IMDEmbeddedData : IPersistStream
{
[id(1), helpstring("Set flag indicating if the application is in a hosted environment")]
HRESULT SetHosted(
[in] BOOL in_fIsHosted);
[id(2), helpstring("Set the URL for the document containing the embedded stream")]
HRESULT SetContainerURL(
[in] BSTR in_bstrURL);
[id(4), helpstring("Set the path used by the embedding application for temporary files")]
HRESULT SetTempDirPath(
[in] BSTR in_bstrPath);
IMDEmbeddedData::GetStreamIdentifier
HRESULT GetStreamIdentifier (
[out, retval] BSTR * out_pbstrStreamId
)
Description
Gets the identifier used by the host application to the embedded stream in the container document.
Parameters
out_pbstrStreamId
Specifies the location of the stream identifier.
Return Value
S_OK
The stream identifier was successfully returned.
S_FALSE
There is no stream identifier.
E_FAIL
An error occurred accessing the stream identifier.
Remarks
To verify if the current connection contains an embedded database, the user should check the value of the
DBPROP_MSMD_EMBEDDED_DATA property from the OLE DB connection properties.
The possible values for DBPROP_MSMD_EMBEDDED_DATA are:
Source
IMDEmbeddedData::SetContainerURL
HRESULT SetContainerURL (
[in] BSTR in_bstrURL
)
Description
Sets the URL for the file containing the embedded stream.
Parameters
in_bstrURL
Specifies the URL for the containing document.
Return Value
S_OK
The container URL was successfully set.
E_FAIL
An error occurred while setting the container URL.
Source
[id(2), helpstring("Set the URL for the document containing the embedded stream")]
HRESULT SetContainerURL(
[in] BSTR in_bstrURL);
IMDEmbeddedData::SetHosted
HRESULT SetHosted (
[in] BOOL in_fIsHosted
)
Description
Set a flag to indicate if the embedding application is in a hosted environment.
Parameters
in_ftHosted
TRUE if caller is in a hosted in a service application (like IIS ).
Return Value
S_OK
The flag was successfully set.
E_FAIL
An error occurred while setting the flag.
Source
IMDEmbeddedData::SetTempDirPath
HRESULT SetTempDirPath (
[in] BSTR in_bstrPath
)
Description
Set the path to temporary files used by the embedding application.
Parameters
in_bstrPath
The path used by the host application for temporary files.
Return Value
S_OK
The temporary file directory was successfully set.
E_FAIL
An error occurred while setting the path.
Source
[id(4), helpstring("Set the path used by the host application for temporary files")]
HRESULT SetTempDirPath(
[in] BSTR in_bstrPath);
IMDEmbeddedData::Cancel
Description
Cancels the current embedded database operation
Parameters
None.
Return Value
S_OK
The operation was successfully cancelled.
DB_E_CANTCANCEL
No cancellable operation is currently in progress.
E_FAIL
An error occurred while cancelling the embedded operation.
Source
[id(5), helpstring("Cancel the current operation")]
HRESULT Cancel();
IMDEmbeddedData::GetSizeMax (IPersistStream::GetSizeMax)
HRESULT GetSizeMax (
[out] ULARGE_INTEGER * out_pcbSize
)
Description
Gets the estimated size (in bytes) of the stream to save the embedded object. Inherited from IPersistStream.
Parameters
in_bstrPath
The estimated size (in bytes) of the embedded database image.
Return Value
S_OK
The size was successfully obtained.
E_FAIL
An error occurred while obtaining the size.
IMDEmbeddedData::IsDirty (IPersistStream::IsDirty)
Description
Verifies if the embedded database has changed since it was last saved. Inherited from IPersistStream.
Parameters
none
Return Value(s )
S_OK
The database has changed since it was last saved.
S_FALSE
The database has not changed since it was last saved.
E_FAIL
An error occurred while obtaining the database state.
IMDEmbeddedData::Load (IPersistStream::Load)
HRESULT Load (
[in] IStream * in_pStm
)
Description
Loads the embedded database to the local or in-process engine. Inherited from IPersistStream.
Parameters
in_pStm
A pointer to a stream interface from where to load the embedded database.
Return Value(s )
S_OK
The database was successfully loaded.
E_OUTOFMEMORY
Not enough memory to load the database.
E_FAIL
An error occurred while loading the database, different than E_OUTOFMEMORY.
IMDEmbeddedData::Save (IPersistStream::Save )
HRESULT Save (
[in] IStream * in_pStm,
[in] BOOL in_fClearDirty
)
Description
Saves the local or in-process database to the embedded stream in the container document. Inherited from
IPersistStream.
Parameters
in_pStm
A pointer to a stream interface to where to save the embedded database.
in_fClearDirty
A flag that indicates whether the dirty flag should be cleared after this operation.
Return Value(s )
S_OK
The database was successfully saved.
STG_E_CANTSAVE
An error occurred while saving the database, different than STG_E_MEDIUMFULL.
STG_E_MEDIUMFULL
The database could not be saved because there is no space left on the storage device.
Multidimensional Model Programming
10/26/2018 • 2 minutes to read • Edit Online
In This Section
Understanding Microsoft OLAP Architecture
Developing with ADOMD.NET
Developing with Analysis Management Objects (AMO )
Developing with XMLA in Analysis Services
Developing with Analysis Services Scripting Language (ASSL )
Extending OLAP functionality
Analysis Services OLE DB Provider (Analysis Services - Multidimensional Data)
See Also
Tabular Model Programming for Compatibility Levels 1050 through 1103
Data Mining Programming
Developing with Analysis Services Scripting
Language (ASSL)
10/26/2018 • 2 minutes to read • Edit Online
See Also
ASSL Objects and Object Characteristics
ASSL XML Conventions
Data Sources and Bindings (SSAS Multidimensional)
ASSL Objects and Object Characteristics
5/16/2018 • 2 minutes to read • Edit Online
Object Groups
All Microsoft SQL Server Analysis Services objects have an XML representation. The objects are divided into two
groups:
Major objects
Major objects can be independently created, altered, and deleted. Major objects include:
Servers
Databases
Dimensions
Cubes
Measure groups
Partitions
Perspectives
Mining models
Roles
Commands associated with a server or database
Data sources
Major objects have the following properties to track their history and status.
CreatedTimestamp
LastSchemaUpdate
LastProcessed (where appropriate)
NOTE
The classification of an object as a major object affects how an instance of Analysis Services treats that object and how that
object is handled in the object definition language. However, this classification does not guarantee that Analysis Services
management and development tools will allow the independent creation, modification, or deletion of these objects.
Minor objects
Minor objects can only be created, altered, or deleted as part of creating, altering, or deleting the parent major
object. Minor objects include:
Hierarchies and levels
Attributes
Measures
Mining model columns
Commands associated with a cube
Aggregations
Object Expansion
The ObjectExpansion restriction can be used to control the degree of expansion of ASSL XML returned by the
server. This restriction has the options listed in the following table.
This ASSL reference section describes the ExpandFull representation. All other ObjectExpansion levels are
derived from this level.
Object Processing
ASSL includes read-only elements or properties (for example, LastProcessed) that can be read from the Analysis
Services instance, but which are omitted when command scripts are submitted to the instance. Analysis Services
ignores modified values for read-only elements without warning or error.
Analysis Services also ignores inappropriate or irrelevant properties without raising validation errors. For
example, the X element should only be present when the Y element has a particular value. The Analysis Services
instance ignores the X element instead of validating that element against the value of the Y element.
Backing Up, Restoring, and Synchronizing Databases
(XMLA)
10/26/2018 • 10 minutes to read • Edit Online
In XML for Analysis, there are three commands that back up, restore, and synchronize databases:
The Backup command backs up a Microsoft SQL Server Analysis Services database using an Analysis
Services backup file (.abf), as described in the section, Backing Up Databases.
The Restore command restores an Analysis Services database from an .abf file, as described in the section,
Restoring Databases.
The Synchronize command synchronizes one Analysis Services database with the data and metadata of
another database, as described in the section, Synchronizing Databases.
Backing Up Databases
As mentioned earlier, the Backup command backs up a specified Analysis Services database to a backup file. The
Backup command has various properties that let you specify the database to be backed up, the backup file to use,
how to back up security definitions, and the remote partitions to be backed up.
IMPORTANT
The Analysis Services service account must have permission to write to the backup location specified for each file. Also, the
user must have one of the following roles: administrator role on the Analysis Services instance, or a member of a database
role with Full Control (Administrator) permissions on the database to be backed up.
IMPORTANT
If ApplyCompression and Password properties are not specified, the backup file stores user names and
passwords that are contained in connection strings in clear text. Data that is stored in clear text may be retrieved.
For increased security, use the ApplyCompression and Password settings to both compress and encrypt the
backup file.
Backing Up Security Settings
The Security property determines whether the Backup command backs up the security definitions, such as roles
and permissions, defined on an Analysis Services database. The Security property also determines whether the
backup file includes the Windows user accounts and groups defined as members of the security definitions.
The value of the Security property is limited to one of the strings listed in the following table.
VALUE DESCRIPTION
Restoring Databases
The Restore command restores a specified Analysis Services database from a backup file. The Restore command
has various properties that let you specify the database to restore, the backup file to use, how to restore security
definitions, the remote partitions to be stored, and the relocation relational OLAP (ROLAP ) objects.
IMPORTANT
For each backup file, the user who runs the restore command must have permission to read from the backup location
specified for each file. To restore an Analysis Services database that is not installed on the server, the user must also be a
member of the server role for that Analysis Services instance. To overwrite an Analysis Services database, the user must
have one of the following roles: a member of the server role for the Analysis Services instance or a member of a database
role with Full Control (Administrator) permissions on the database to be restored.
NOTE
After restoring an existing database, the user who restored the database might lose access to the restored database. This
loss of access can occur if, at the time that the backup was performed, the user was not a member of the server role or was
not a member of the database role with Full Control (Administrator) permissions.
VALUE DESCRIPTION
Synchronizing Databases
The Synchronize command synchronizes the data and metadata of a specified Analysis Services database with
another database. The Synchronize command has various properties that let you specify the source database,
how to synchronize security definitions, the remote partitions to be synchronized, and the synchronization of
ROLAP objects.
NOTE
The Synchronize command can be executed only by server administrators and database administrators. Both the source
and destination database must have the same database compatibility level.
VALUE DESCRIPTION
See Also
Backup Element (XMLA)
Restore Element (XMLA)
Synchronize Element (XMLA)
Backup and Restore of Analysis Services Databases
Canceling Commands (XMLA)
12/10/2018 • 2 minutes to read • Edit Online
Depending on the administrative permissions of the user issuing the command, the Cancel command in XML for
Analysis (XMLA) can cancel a command on a session, a session, a connection, a server process, or an associated
session or connection.
Canceling Commands
A user can cancel the currently executing command within the context of the current explicit session by sending a
Cancel command with no specified properties.
NOTE
A command running in an implicit session cannot be canceled by a user.
Canceling Sessions
By specifying a session identifier for an explicit session in the SessionID property of the Cancel command, a
database administrator or server administrator can cancel a session, including the currently executing command. A
database administrator can only cancel sessions for databases on which he or she has administrative permissions.
A database administrator can retrieve the active sessions for a specified database by retrieving the
DISCOVER_SESSIONS schema rowset. To retrieve the DISCOVER_SESSIONS schema rowset, the database
administrator uses the XMLA Discover method and specifies the appropriate database identifier for the
SESSION_CURRENT_DATABASE restriction column in the Restrictions property of the Discover method.
Canceling Connections
By specifying a connection identifier in the ConnectionID property of the Cancel command, a server administrator
can cancel all of the sessions associated with a given connection, including all running commands, and cancel the
connection.
NOTE
If the instance of MicrosoftSQL ServerAnalysis Services cannot locate and cancel the sessions associated with a connection,
such as when the data pump opens multiple sessions while providing HTTP connectivity, the instance cannot cancel the
connection. If this case is encountered during the execution of a Cancel command, an error occurs.
A server administrator can retrieve the active connections for an Analysis Services instance by retrieving the
DISCOVER_CONNECTIONS schema rowset using the XMLA Discover method.
See Also
Discover Method (XMLA)
Developing with XMLA in Analysis Services
Creating and Altering Objects (XMLA)
10/26/2018 • 4 minutes to read • Edit Online
Major objects can be independently created, altered, and deleted. Major objects include the following objects:
Servers
Databases
Dimensions
Cubes
Measure groups
Partitions
Perspectives
Mining models
Roles
Commands associated with a server or database
Data sources
You use the Create command to create a major object on an instance of Microsoft SQL Server Analysis Services,
and the Alter command to alter an existing major object on an instance. Both commands are run using the Execute
method.
Creating Objects
When you create objects by using the Create method, you must first identify the parent object that contains the
Analysis Services object to be created. You identify the parent object by providing an object reference in the
ParentObject property of the Create command. Each object reference contains the object identifiers needed to
uniquely identify the parent object for the Create command. For more information about object references, see
Defining and Identifying Objects (XMLA).
For example, you must provide an object reference to a cube to create a new measure group for the cube. The
object reference for the cube in the ParentObject property contains both a database identifier and a cube
identifier, as the same cube identifier could potentially be used on a different database.
The ObjectDefinition element contains Analysis Services Scripting Language (ASSL ) elements that define the
major object to be created. For more information about ASSL, see Developing with Analysis Services Scripting
Language (ASSL ).
If you set the AllowOverwrite attribute of the Create command to true, you can overwrite an existing major
object that has the specified identifier. Otherwise, an error occurs if a major object that has the specified identifier
already exists in the parent object.
For more information about the Create command, see Create Element (XMLA).
Creating Session Objects
Session objects are temporary objects that are available only to the explicit or implicit session used by a client
application and are deleted when the session is ended. You can create session objects by setting the Scope
attribute of the Create command to Session.
NOTE
When using the Session setting, the ObjectDefinition element can only contain Dimension, Cube, or MiningModel ASSL
elements.
Altering Objects
When modifying objects by using the Alter method, you must first identify the object to be modified by providing
an object reference in the Object property of the Alter command. Each object reference contains the object
identifiers needed to uniquely identify the object for the Alter command. For more information about object
references, see Defining and Identifying Objects (XMLA).
For example, you must provide an object reference to a cube in order to modify the structure of a cube. The object
reference for the cube in the Object property contains both a database identifier and a cube identifier, as the same
cube identifier could potentially be used on a different database.
The ObjectDefinition element contains ASSL elements that define the major object to be modified. For more
information about ASSL, see Developing with Analysis Services Scripting Language (ASSL ).
If you set the AllowCreate attribute of the Alter command to true, you can create the specified major object if the
object does not exist. Otherwise, an error occurs if a specified major object does not already exist.
Using the ObjectExpansion Attribute
If you are changing only the properties of the major object and are not redefining minor objects that are contained
by the major object, you can set the ObjectExpansion attribute of the Alter command to ObjectProperties. The
ObjectDefinition property then only has to contain the elements for the properties of the major object, and the
Alter command leaves minor objects associated with the major object untouched.
To redefine minor objects for a major object, you must set the ObjectExpansion attribute to ExpandFull and the
object definition must include all minor objects that are contained by the major object. If the ObjectDefinition
property of the Alter command does not explicitly include a minor object that is contained by the major object, the
minor object that was not included is deleted.
Altering Session Objects
To modify session objects created by the Create command, set the Scope attribute of the Alter command to
Session.
NOTE
When using the Session setting, the ObjectDefinition element can only contain Dimension, Cube, or MiningModel ASSL
elements.
<Create xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<ParentObject>
<DatabaseID>Adventure Works DW Multidimensional 2012</DatabaseID>
</ParentObject>
<ObjectDefinition>
<DataSource xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance" xsi:type="RelationalDataSource">
<ID>AdventureWorksDW2012</ID>
<Name>AdventureWorksDW2012</Name>
<ConnectionString>Data Source=localhost;Initial Catalog=AdventureWorksDW2008R2;Integrated
Security=True</ConnectionString>
<ImpersonationInfo>
<ImpersonationMode>ImpersonateServiceAccount</ImpersonationMode>
</ImpersonationInfo>
<ManagedProvider>System.Data.SqlClient</ManagedProvider>
<Timeout>PT0S</Timeout>
</DataSource>
</ObjectDefinition>
</Create>
Description
The following example alters the relational data source created in the previous example to set the query time-out
for the data source to 30 seconds.
Code
Comments
The ObjectExpansion attribute of the Alter command was set to ObjectProperties. This setting allows the
ImpersonationInfo element, a minor object, to be excluded from the data source defined in ObjectDefinition.
Therefore, the impersonation information for that data source remains set to the service account, as specified in
the first example.
See Also
Execute Method (XMLA)
Developing with Analysis Services Scripting Language (ASSL )
Developing with XMLA in Analysis Services
Defining and Identifying Objects (XMLA)
10/26/2018 • 2 minutes to read • Edit Online
Objects are identified in XML for Analysis (XMLA) commands by using object identifiers and object references,
and are defined by using Analysis Services Scripting Language (ASSL ) elements XMLA commands.
Object Identifiers
An object is identified by using the unique identifier of the object as defined on an instance of Microsoft SQL
Server Analysis Services. Object identifiers can either be explicitly specified or determined by the Analysis
Services instance when Analysis Services creates the object. You can use the Discover method to retrieve object
identifiers for subsequent Discover or Execute method calls.
Object References
Several XMLA commands, such as Delete or Process, use an object reference to refer to an object in an
unambiguous manner. An object reference contains the object identifier of the object on which a command is
executed and the object identifiers of the ancestors for that object. For example, the object reference for a partition
contains the object identifier of the partition, as well as the object identifiers of that partition's parent measure
group, cube, and database.
Object Definitions
The Create and Alter commands in XMLA create or alter, respectively, objects on an Analysis Services instance.
The definitions for those objects are represented by an ObjectDefinition element that contains elements from
ASSL. Object identifiers can be explicitly specified for all major and many minor objects by using the ID element.
If the ID element is not used, the Analysis Services instance provides a unique identifier, with a naming convention
that depends on the object to be identified. For more information about how to use the Create and Alter
commands to define objects, see Creating and Altering Objects (XMLA).
See Also
Object Element (XMLA)
ParentObject Element (XMLA)
Source Element (XMLA)
Target Element (XMLA)
Developing with XMLA in Analysis Services
Designing Aggregations (XMLA)
10/26/2018 • 7 minutes to read • Edit Online
Aggregation designs are associated with the partitions of a particular measure group to make sure that the
partitions use the same structure when storing aggregations. Using the same storage structure for partitions lets
you to easily define partitions that can be later merged using the MergePartitions command. For more information
about aggregation designs, see Aggregations and Aggregation Designs.
To define aggregations for an aggregation design, you can use the DesignAggregations command in XML for
Analysis (XMLA). The DesignAggregations command has properties that identify which aggregation design to
use as a reference and how to control the design process based upon that reference. Using the
DesignAggregations command and its properties, you can design aggregations iteratively or in batch, and then
view the resulting design statistics to evaluate the design process.
Specifying Queries
The DesignAggregations command supports usage-based optimization command by including one or more
Query elements in the Queries property. The Queries property can contain one or more Query elements. If the
Queries property does not contain any Query elements, the aggregation design specified in the Object element
uses a default structure that contains a general set of aggregations. This general set of aggregations is designed to
meet the criteria specified in the Optimization and Storage properties of the DesignAggregations command.
Each Query element represents a goal query that the design process uses to define aggregations that target the
most frequently used queries. You can either specify your own goal queries, or you can use the information stored
by an instance of Microsoft SQL Server Analysis Services in the query log to retrieve information about the most
frequently used queries. The Usage-Based Optimization Wizard uses the query log to retrieve goal queries based
on time, usage, or a specified user when it sends a DesignAggregations command. For more information, see
Usage-Based Optimization Wizard F1 Help.
If you are iteratively designing aggregations, you only have to pass goal queries in the first DesignAggregations
command because the Analysis Services instance stores these goal queries and uses these queries during
subsequent DesignAggregations commands. After you pass goal queries in the first DesignAggregations
command of an iterative process, any subsequent DesignAggregations command that contains goal queries in
the Queries property generates an error.
The Query element contains a comma-delimited value that contains the following arguments:
Frequency,Dataset[,Dataset...]
Frequency
A weighting factor that corresponds to the number of times that the query has previously been executed. If the
Query element represents a new query, the Frequency value represents the weighting factor used by the design
process to evaluate the query. As the frequency value becomes larger, the weight that is put on the query during
the design process increases.
Dataset
A numeric string that specifies which attributes from a dimension are to be included in the query. This string must
have the same number of characters as the number of attributes in the dimension. Zero (0) indicates that the
attribute in the specified ordinal position is not included in the query for the specified dimension, while one (1)
indicates that the attribute in the specified ordinal position is included in the query for the specified dimension.
For example, the string "011" would refer to a query involving a dimension with three attributes, from which the
second and third attributes are included in the query.
NOTE
Some attributes are excluded from consideration in the dataset. For more information about excluded attributes, see Query
Element (XMLA).
Each dimension in the measure group that contains the aggregation design is represented by a Dataset value in
the Query element. The order of Dataset values must match the order of dimensions included in the measure
group.
To start the iterative process, you first send a DesignAggregations command that contains the following
information:
The Storage and Optimization property values on which the whole design process is targeted.
The Steps and Time property values on which the first step of the design process is limited.
If you want usage-based optimization, the Queries property that contains the goal queries on which the
whole design process is targeted.
The Materialize property set to false. Setting this property to false indicates that the design process does
not save the defined aggregations to the aggregation design when the command is completed.
When the first DesignAggregations command finishes, the command returns a rowset that contains design
statistics. You can evaluate these design statistics to determine whether the design process should continue or
whether the design process is finished. If the process should continue, you then send another
DesignAggregations command that contains the Steps and Time values with which this step of the design
process is limited. You evaluate the resulting statistics and then determine whether the design process should
continue. This iterative process of sending DesignAggregations commands and evaluating the results continues
until you reach your goals and have a appropriate set of aggregations defined.
After you have reached the set of aggregations that you want, you send one final DesignAggregations command.
This final DesignAggregations command should have its Steps property set to 1 and its Materialize property
set to true. By using these settings, this final DesignAggregations command completes the design process and
saves the defined aggregation to the aggregation design.
Designing Aggregations Using a Batch Process
You can also design aggregations in a batch process by sending a single DesignAggregations command that
contains the Steps, Time, Storage, and Optimization property values on which the whole design process is
targeted and limited. If you want usage-based optimization, the goal queries on which the design process is
targeted should also be included in the Queries property. Also make sure that the Materialize property is set to
true, so that the design process saves the defined aggregations to the aggregation design when the command
finishes.
You can design aggregations using a batch process in either an implicit or explicit session. For more information
about implicit and explicit sessions, see Managing Connections and Sessions (XMLA).
You can use the design statistics that are contained in the rowset returned after each DesignAggregations
command in both iterative and batch design. In iterative design, you can use the design statistics to determine and
display progress. When you are designing aggregations in batch, you can use the design statistics to determine the
number of aggregations created by the command.
See Also
Developing with XMLA in Analysis Services
Developing with XMLA in Analysis Services
11/27/2018 • 4 minutes to read • Edit Online
XML for Analysis (XMLA) is a SOAP -based XML protocol, designed specifically for universal data access to any
standard multidimensional data source that can be accessed over an HTTP connection. Analysis Services uses
XMLA as its only protocol when communicating with client applications. Fundamentally, all client libraries
supported by Analysis Services formulate requests and responses in XMLA.
As a developer, you can use XMLA to integrate a client application with Analysis Services, without any
dependencies on the .NET Framework or COM interfaces. Application requirements that include hosting on a
wide range of platforms can be satisfied by using XMLA and an HTTP connection to Analysis Services.
Analysis Services is fully compliant with the 1.1 specification of XMLA, but also extends it to enable data
definition, data manipulation, and data control support. Analysis Services extensions are referred to as the
Analysis Services Scripting Language (ASSL ). Using XMLA and ASSL together enables a broader set of
functionality than what XMLA alone provides. For more information about ASSL, see Developing with Analysis
Services Scripting Language (ASSL ).
In This Section
TOPIC DESCRIPTION
Managing Connections and Sessions (XMLA) Describes how to connect to an Analysis Services instance,
and how to manage sessions and statefulness in XMLA.
Handling Errors and Warnings (XMLA) Describes how Analysis Services returns error and warning
information for methods and commands in XMLA.
Defining and Identifying Objects (XMLA) Describes object identifiers and object references, and how
to use identifiers and references within XMLA commands.
Performing Batch Operations (XMLA) Describes how to use the Batch command to run multiple
XMLA commands, in serial or in parallel, either within the
same transaction or as separate transactions, using a single
XMLA Execute method.
Creating and Altering Objects (XMLA) Describes how to use the Create, Alter, and Delete
commands, along with Analysis Services Scripting Language
(ASSL) elements, to define, change, or remove objects from
an Analysis Services instance.
Locking and Unlocking Databases (XMLA) Details how to use the Lock and Unlock commands to lock
and unlock an Analysis Services database.
TOPIC DESCRIPTION
Processing Objects (XMLA) Describes how to use the Process command to process an
Analysis Services object.
Backing Up, Restoring, and Synchronizing Databases (XMLA) Describes how to use the Backup and Restore commands to
back up and restore an Analysis Services database from a
backup file.
Inserting, Updating, and Dropping Members (XMLA) Describes how to use the Insert, Update, and Drop
commands to add, change, or delete members from a write-
enabled dimension.
Updating Cells (XMLA) Describes how to use the UpdateCells command to change
the values of cells in a write-enabled partition.
Managing Caches (XMLA) Details how to use the ClearCache command to clear the
caches of Analysis Services objects.
Monitoring Traces (XMLA) Describes how to use the Subscribe command to subscribe
to and monitor an existing trace on an Analysis Services
instance.
Schema
The definition of an XML Schema definition language (XSD ) schema for the Analysis Services object definition
language is based on the definition of the schema elements and hierarchy in this section.
Extensibility
Extensibility of the object definition language schema is provided by means of an Annotation element that is
included on all objects. This element can contain any valid XML from any XML namespace (other than the
target namespace that defines the DDL ), subject to the following rules:
The XML can contain only elements.
Each element must have a unique name. It is recommended that the value of Name reference the target
namespace.
These rules are imposed so that the contents of the Annotation tag can be exposed as a set of Name/Value
pairs through Decision Support Objects (DSO ) 9.0.
Comments and white space within the Annotation tag that are not enclosed with a child element may not be
preserved. In addition, all elements must be read-write; read-only elements are ignored.
The object definition language schema is closed, in that the server does not allow substitution of derived types
for elements defined in the schema. Therefore, the server accepts only the set of elements defined here, and no
other elements or attributes. Unknown elements cause the Analysis Services engine to raise an error.
See Also
Developing with Analysis Services Scripting Language (ASSL )
Understanding Microsoft OLAP Architecture
Handling Errors and Warnings (XMLA)
10/26/2018 • 4 minutes to read • Edit Online
Error handling is required when an XML for Analysis (XMLA) Discover or Execute method call does not run, runs
successfully but generates errors or warnings, or runs successfully but returns results that contain errors.
ERROR REPORTING
The XMLA method call does not run Microsoft SQL Server Analysis Services returns a SOAP fault
message that contains the details of the failure.
Errors or warnings on a successful method call Analysis Services includes an error or warning element for
each error or warning, respectively, in the Messages property
of the root element that contains the results of the method
call.
Errors in the result for a successful method call Analysis Services includes an inline error or warning element
for the error or warning, respectively, within the appropriate
Cell or row element of the results of the method call.
1 Indicates whether the data is required and must be returned, or whether the data is optional and a null string is
allowed if the column does not apply.
The following is an example of a SOAP fault that occurred when a method call failed:
<?xml version="1.0"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Fault>
<faultcode>XMLAnalysisError.0x80000005</faultcode>
<faultstring>The XML for Analysis provider encountered an error.</faultstring>
<faultactor>XML for Analysis Provider</faultactor>
<detail>
<Error
ErrorCode="2147483653"
Description="An unexpected error has occurred."
Source="XML for Analysis Provider"
HelpFile="" />
</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Envelope>
<return>
...
<root>
...
<CellData>
...
<Cell CellOrdinal="10">
<Value>
<Error>
<ErrorCode>2148497527</ErrorCode>
<Description>Security Error.</Description>
</Error>
</Value>
</Cell>
</CellData>
...
</root>
...
</return>
See Also
Developing with XMLA in Analysis Services
Inserting, Updating, and Dropping Members (XMLA)
10/26/2018 • 5 minutes to read • Edit Online
You can use the Insert, Update, and Drop commands in XML for Analysis (XMLA) to respectively insert, update, or
delete members from a write-enabled dimension. For more information about write-enabled dimensions, see
Write-Enabled Dimensions.
NOTE
All properties for the Attribute element must be included. Otherwise, an error may occur.
NOTE
All properties for the Attribute element must be included. Otherwise, an error may occur.
The Where property, which contains one or more Attribute elements that constrain the attributes in which
members are to be updated. The Where property is crucial to limiting an Update command to specific
instances of a member. If the Where property is not specified, all instances of a given member are updated.
For example, there are three customers for whom you want to change the city name from Redmond to
Bellevue. To change the city name, you must provide a Where property that identifies the three members in
the Customer attribute for which the members in the City attribute should be changed. If you do not
provide this Where property, every customer whose city name is currently Redmond would have the city
name of Bellevue after the Update command runs.
NOTE
With the exception of new members, the Update command can only update attribute key values for attributes not
included in the Where clause. For example, the city name cannot be updated when a customer is updated; otherwise,
the city name is changed for all customers.
NOTE
The Attribute elements included in a Drop command must contain only the AttributeName and Keys properties.
Otherwise, an error may occur.
IMPORTANT
A user needs only to have delete permissions for the parent member to delete both the parent member and its descendants.
A user does not need delete permissions on the descendants.
See Also
Drop Element (XMLA)
Insert Element (XMLA)
Update Element (XMLA)
Defining and Identifying Objects (XMLA)
Developing with XMLA in Analysis Services
Locking and Unlocking Databases (XMLA)
10/26/2018 • 2 minutes to read • Edit Online
You can lock and unlock databases using, respectively, the Lock and Unlock commands in XML for Analysis
(XMLA). Typically, other XMLA commands automatically lock and unlock objects as needed to complete the
command during execution. You can explicitly lock or unlock a database to perform multiple commands within a
single transaction, such as a Batch command, while preventing other applications from committing a write
transaction to the database.
Locking Databases
The Lock command locks an object, either for shared or exclusive use, within the context of the currently active
transaction. A lock on an object prevents transactions from committing until the lock is removed. Microsoft SQL
Server Analysis Services supports two types of locks, shared locks and exclusive locks. For more information about
the lock types supported by Analysis Services, see Mode Element (XMLA).
Analysis Services allows only databases to be locked. The Object element must contain an object reference to an
Analysis Services database. If the Object element is not specified or if the Object element refers to an object other
than a database, an error occurs.
IMPORTANT
Only database administrators or server administrators can explicitly issue a Lock command.
Other commands implicitly issue a Lock command on an Analysis Services database. Any operation that reads
data or metadata from a database, such as any Discover method or an Execute method running a Statement
command, implicitly issues a shared lock on the database. Any transaction that commits changes in data or
metadata to an object on an Analysis Services database, such as an Execute method running an Alter command,
implicitly issues an exclusive lock on the database.
Unlocking Objects
The Unlock command removes a lock established within the context of the currently active transaction.
IMPORTANT
Only database administrators or server administrators can explicitly issue an Unlock command.
All locks are held in the context of the current transaction. When the current transaction is committed or rolled
back, all locks defined within the transaction are automatically released.
See Also
Lock Element (XMLA)
Unlock Element (XMLA)
Developing with XMLA in Analysis Services
Managing Caches (XMLA)
10/26/2018 • 2 minutes to read • Edit Online
You can use the ClearCache command in XML for Analysis (XMLA) to clear the cache of a specified dimension or
partition. Clearing the cache forces Microsoft SQL Server Analysis Services to rebuild the cache for that object.
Specifying Objects
The Object property of the ClearCache command can contain an object reference only for one of the following
objects. An error occurs if an object reference is for an object other than one of following objects:
Database
Clears the cache for all dimensions and partitions contained in the database.
Dimension
Clears the cache for the specified dimension.
Cube
Clears the cache for all partitions contained in the measure groups for the cube.
Measure group
Clears the cache for all partitions contained in the measure group.
Partition
Clears the cache for the specified partition.
See Also
Developing with XMLA in Analysis Services
Managing Connections and Sessions (XMLA)
10/26/2018 • 3 minutes to read • Edit Online
Statefulness is a condition during which the server preserves the identity and context of a client between method
calls. Statelessness is a condition during which the server does not remember the identity and context of a client
after a method call finishes.
To provide statefulness, XML for Analysis (XMLA) supports sessions that allow a series of statements to be
performed together. An example of such a series of statements would be the creation of a calculated member that
is to be used in subsequent queries.
In general, sessions in XMLA follow the following behavior outlined by the OLE DB 2.6 specification:
Sessions define transaction and command context scope.
Multiple commands can be run in the context of a single session.
Support for transactions in the XMLA context is through provider-specific commands sent with the Execute
method.
XMLA defines a way to support sessions in a Web environment in a mode similar to the approach used by the
Distributed Authoring and Versioning (DAV ) protocol to implement locking in a loosely coupled environment. This
implementation parallels DAV in that the provider is allowed to expire sessions for various reasons (for example, a
timeout or connection error). When sessions are supported, Web services must be aware and ready to handle
interrupted sets of commands that must be restarted.
The World Wide Web Consortium (W3C ) Simple Object Access Protocol (SOAP ) specification recommends using
SOAP headers for building up new protocols on top of SOAP messages. The following table lists the SOAP
header elements and attributes that XMLA defines for initiating, maintaining, and closing a session.
BeginSession This header requests the provider to create a new session. The
provider should respond by constructing a new session and
returning the session ID as part of the Session header in the
SOAP response.
SessionId The value area contains the session ID that must be used in
each method call for the rest of the session. The provider in
the SOAP response sends this tag and the client must also
send this attribute with each Session header element.
Session For every method call that occurs in the session, this header
must be used, and the session ID must be included in the
value area of the header.
EndSession To terminate the session, use this header. The session ID must
be included with the value area.
NOTE
A session ID does not guarantee that a session stays valid. If the session expires (for example, if it times out or the
connection is lost), the provider can choose to end and roll back that session's actions. As a result, all subsequent method
calls from the client on a session ID fail with an error signaling a session that is not valid. A client should handle this
condition and be prepared to resend the session method calls from the beginning.
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Header>
<XA:BeginSession
xmlns:XA="urn:schemas-microsoft-com:xml-analysis"
xsi:type="xsd:int"
mustUnderstand="1"/>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
...<!-- Discover or Execute call goes here.-->
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
2. The SOAP response message from the provider includes the session ID in the return header area, using the
XMLA header tag <SessionId>.
<SOAP-ENV:Header>
<XA:Session
xmlns:XA="urn:schemas-microsoft-com:xml-analysis"
SessionId="581"/>
</SOAP-ENV:Header>
3. For each method call in the session, the Session header must be added, containing the session ID returned
from the provider.
<SOAP-ENV:Header>
<XA:Session
xmlns:XA="urn:schemas-microsoft-com:xml-analysis"
mustUnderstand="1"
SessionId="581"/>
</SOAP-ENV:Header>
4. When the session is complete, the <EndSession> tag is used, containing the related session ID value.
<SOAP-ENV:Header>
<XA:EndSession
xmlns:XA="urn:schemas-microsoft-com:xml-analysis"
xsi:type="xsd:int"
mustUnderstand="1"
SessionId="581"/>
</SOAP-ENV:Header>
See Also
Developing with XMLA in Analysis Services
Managing Transactions (XMLA)
10/26/2018 • 2 minutes to read • Edit Online
Every XML for Analysis (XMLA) command sent to an instance of Microsoft SQL Server Analysis Services runs
within the context of a transaction on the current implicit or explicit session. To manage each of these transactions,
you use the BeginTransaction, CommitTransaction, and RollbackTransaction commands. By using these commands,
you can create implicit or explicit transactions, change the transaction reference count, as well as start, commit, or
roll back transactions.
Beginning a Transaction
The BeginTransaction command begins an explicit transaction on the current session and increments the
transaction reference count for the current session by one. All subsequent commands are considered to be within
the active transaction, until either enough CommitTransaction commands are sent to commit the active
transaction or a single RollbackTransaction command is sent to roll back the active transaction.
Committing a Transaction
The CommitTransaction command commits the results of commands that are run after the BeginTransaction
command was run on the current session. Each CommitTransaction command decrements the reference count
for active transactions on a session. If a CommitTransaction command sets the reference count to zero, Analysis
Services commits the active transaction. If there is no active transaction (in other words, the transaction reference
count for the current session is already set to zero), a CommitTransaction command results in an error.
See Also
Developing with XMLA in Analysis Services
Merging Partitions (XMLA)
10/26/2018 • 2 minutes to read • Edit Online
If partitions have the same aggregation design and structure, you can merge the partition by using the
MergePartitions command in XML for Analysis (XMLA). Merging partitions is an important action to perform
when you manage partitions, especially those partitions that contain historical data partitioned by date.
For example, a financial cube may use two partitions:
One partition represents financial data for the current year, using real-time relational OLAP (ROLAP )
storage settings for performance.
Another partition contains financial data for previous years, using multidimensional OLAP (MOLAP )
storage settings for storage.
Both partitions use different storage settings, but use the same aggregation design. Instead of processing the cube
across years of historical data at the end of the year, you can instead use the MergePartitions command to merge
the partition for the current year into the partition for previous years. This preserves the aggregation data without
requiring a potentially time-consuming full processing of the cube.
NOTE
The Source property can contain more than one partition object reference. However, the Target property cannot.
To be successfully merged, the partitions specified in both the Source and Target must be contained by the same
measure group and use the same aggregation design. Otherwise, an error occurs.
The partitions specified in the Source are deleted after the MergePartitions command is successfully completed.
Examples
Description
The following example merges all the partitions in the Customer Counts measure group of the Adventure
Works cube in the Adventure Works DW sample Microsoft SQL Server Analysis Services database into the
Customers_2004 partition.
Code
<MergePartitions xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Sources>
<Source>
<DatabaseID>Adventure Works DW Multidimensional 2012</DatabaseID>
<CubeID>Adventure Works DW</CubeID>
<MeasureGroupID>Fact Internet Sales 1</MeasureGroupID>
<PartitionID>Internet_Sales_2001</PartitionID>
</Source>
<Source>
<DatabaseID>Adventure Works DW Multidimensional 2012</DatabaseID>
<CubeID>Adventure Works DW</CubeID>
<MeasureGroupID>Fact Internet Sales 1</MeasureGroupID>
<PartitionID>Internet_Sales_2002</PartitionID>
</Source>
<Source>
<DatabaseID>Adventure Works DW Multidimensional 2012</DatabaseID>
<CubeID>Adventure Works DW</CubeID>
<MeasureGroupID>Fact Internet Sales 1</MeasureGroupID>
<PartitionID>Internet_Sales_2003</PartitionID>
</Source>
</Sources>
<Target>
<DatabaseID>Adventure Works DW Multidimensional 2012</DatabaseID>
<CubeID>Adventure Works DW</CubeID>
<MeasureGroupID>Fact Internet Sales 1</MeasureGroupID>
<PartitionID>Internet_Sales_2004</PartitionID>
</Target>
</MergePartitions>
See Also
Developing with XMLA in Analysis Services
Monitoring Traces (XMLA)
10/26/2018 • 3 minutes to read • Edit Online
You can use the Subscribe command in XML for Analysis (XMLA) to monitor an existing trace defined on an
instance of Microsoft SQL Server Analysis Services. The Subscribe command returns the results of a trace as a
rowset.
Specifying a Trace
The Object property of the Subscribe command must contain an object reference to either an Analysis Services
instance or a trace on an Analysis Services instance. If the Object property is not specified, or a trace identifier is
not specified in the Object property, the Subscribe command monitors the default session trace for the explicit
session specified in the SOAP header for the command.
Returning Results
The Subscribe command returns a rowset containing the trace events captured by the specified trace. The
Subscribe command returns trace results until the command is canceled by the Cancel command.
The rowset contains the columns listed in the following table.
0: Success
1: Information
2: Warning
3: Error
See Also
Developing with XMLA in Analysis Services
Performing Batch Operations (XMLA)
11/28/2018 • 6 minutes to read • Edit Online
You can use the Batch command in XML for Analysis (XMLA) to run multiple XMLA commands using a single
XMLA Execute method. You can run multiple commands contained in the Batch command either as a single
transaction or in individual transactions for each command, in serial or in parallel. You can also specify out-of-line
bindings and other properties in the Batch command for processing multiple Microsoft SQL Server Analysis
Services objects.
NOTE
If a Batch command contains a command that does not return output, such as the Lock command, and that command
successfully runs, the Batch command returns an empty root element within the results element. The empty root element
ensures that each command contained in a Batch command can be matched with the appropriate root element for that
command's results.
NOTE
As long as at least one command in a nontransactional batch can be started, the nontransactional batch is considered to
have successfully run, even if every command contained in the nontransactional batch returns an error in the results of the
Batch command.
NOTE
To run commands in parallel, the Transaction attribute of the Batch command must be set to true because Analysis Services
supports only one active transaction per connection and nontransactional batches run each command in a separate
transaction. If you include the Parallel property in a nontransactional batch, an error occurs.
IMPORTANT
A Process command cannot include the Bindings, DataSource, DataSourceView, or ErrorConfiguration
properties, if the Process command is contained in a Batch command. If you must specify these properties for a
Process command, provide the necessary information in the corresponding properties of the Batch command that
contains the Process command.
See Also
Batch Element (XMLA)
Process Element (XMLA)
Processing a multidimensional model (Analysis Services)
Developing with XMLA in Analysis Services
Processing Objects (XMLA)
10/26/2018 • 5 minutes to read • Edit Online
In Microsoft SQL Server Analysis Services, processing is the step or series of steps that turn data into information
for business analysis. Processing is different depending on the type of object, but processing is always part of
turning data into information.
To process an Analysis Services object, you can use the Process command. The Process command can process the
following objects on an Analysis Services instance:
Cubes
Databases
Dimensions
Measure groups
Mining models
Mining structures
Partitions
To control the processing of objects, the Process command has various properties that can be set. The Process
command has properties that control: how much processing will be done, which objects will be processed, whether
to use out-of-line bindings, how to handle errors, and how to manage writeback tables.
ProcessUpdate Dimension
ProcessScriptCache Cube
For more information about processing Analysis Services objects, see Processing a multidimensional model
(Analysis Services).
Examples
Description
The following example fully processes the Adventure Works DW Multidimensional 2012 sample Analysis Services
database.
Code
<Process xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
<Object>
<DatabaseID>Adventure Works DW Multidimensional 2012</DatabaseID>
</Object>
<Type>ProcessFull</Type>
<WriteBackTableCreation>UseExisting</WriteBackTableCreation>
</Process>
Description
The following example incrementally processes the Internet_Sales_2004 partition in the Internet Sales measure
group of the Adventure Works DW cube in the Adventure Works DW Multidimensional 2012 sample Analysis
Services database. The Process command is adding aggregations for order dates later than December 31, 2006 to
the partition by using an out-of-line query binding in the Bindings property of the Process command to retrieve
the fact table rows from which to generate aggregations to add to the partition.
Code
You can use the UpdateCells command to change the value of one or more cells in a cube enabled for cube
writeback. Microsoft SQL Server Analysis Services stores the updated information in a separate writeback table
for each partition that contains cells to be updated.
NOTE
The UpdateCells command does not support allocations during cube writeback. To use allocated writeback, you should use
the Statement command to send a Multidimensional Expressions (MDX) UPDATE statement. For more information, see
UPDATE CUBE Statement (MDX).
Specifying Cells
The Cell property of the UpdateCells command contains the cells to be updated. You identify each cell in the Cell
property using that cell's ordinal number. Conceptually, Analysis Services numbers cells in a cube as if the cube
were a p-dimensional array, where p is the number of axes. Cells are addressed in row -major order. The following
illustration shows the formula for calculating the ordinal number of a cell.
Once you know a cell's ordinal number, you can indicate the intended value of the cell in the Value property of the
Cell property.
See Also
Update Element (XMLA)
Developing with XMLA in Analysis Services
ASSL XML Conventions
11/28/2018 • 3 minutes to read • Edit Online
Cardinality
When an element has a cardinality that is greater than 1, there is an XML element collection that encapsulates this
element. The name of collection uses the plural form of the elements contained in the collection. For example, the
following XML fragment represents the Dimensions collection within a Database element:
<Database>
...
<Dimensions>
<Dimension>
...
</Dimension>
<Dimension>
...
</Dimension>
</Dimensions>
</Database>
``
The order in which elements appear is unimportant.
Inheritance
Inheritance is used when there are distinct objects that have overlapping but significantly different sets of
properties. Examples of such overlapping but distinct objects are virtual cubes, linked cubes, and regular cubes. For
overlapping but distinct object, Analysis Services uses the standard type attribute from the XML Instance
Namespace to indicate the inheritance. For example, the following XML fragment shows how the type attribute
identifies whether a Cube element inherits from a regular cube or from a virtual cube:
<Cubes>
<Cube xsi:type="RegularCube">
<Name>Sales</Name>
...
</Cube>
<Cube xsi:type="VirtualCube">
<Name>SalesAndInventory</Name>
...
</Cube>
</Cubes>
``
Inheritance is generally not used when multiple types have a property of the same name. For example, the Name
and ID properties appear on many elements, but these properties have not been promoted to an abstract type.
Whitespace
Whitespace within an element value is preserved. However, leading and trailing whitespace is always trimmed. For
example, the following elements have the same text but differing amounts of whitespace within that text, and are
therefore treated as if they have different values:
<Description>My text<Description>
<Description>My text<Description>
``
However, the following elements vary only in leading and trailing whitespace, and are therefore treated as if they
have equivalent values:
<Description>My text<Description>
``
Data Types
Analysis Services uses the following standard XML Schema definition language (XSD ) data types:
Int
An integer value in the range of -231 to 231 - 1.
Long
An integer value in range of -263 to 263 - 1.
String
A string value that conforms to the following global rules:
Control characters are stripped out.
Leading and trailing white space is trimmed.
Internal white space is preserved.
Name and ID properties have special limitations on valid characters in string elements. For additional information
about Name and ID conventions, see ASSL Objects and Object Characteristics.
DateTime
A DateTime structure from the .NET Framework. A DateTime value cannot be NULL. The lowest date supported
by the DataTime data type is January 1, 1601, which is available to programmers as DateTime.MinValue. The
lowest supported date indicates that a DateTime value is missing.
Boolean
An enumeration with only two values, such as {true, false} or {0, 1}.
Default Values
Analysis Services uses the defaults listed in the following table.
Boolean False
An element that is present but empty is interpreted as having a value of a null string, not the default value.
Inherited Defaults
Some properties that are specified on an object provide default values for the same property on child or
descendant objects. For example, Cube.StorageMode provides the default value for Partition.StorageMode.
The rules that Analysis Services applies for inherited default values are as follows:
When the property for the child object is null in the XML, its value defaults to the inherited value. However,
if you query the value from the server, the server returns the null value of the XML element.
It is not possible to determine programmatically whether the property of a child object has been set directly
on the child object or inherited.
Some elements have defined defaults that apply when the element is missing. For example, the Dimension
elements in the following XML fragment are equivalent even though one Dimension element contains a Visible
element, but the other Dimension element does not.
<Dimension>
<Name>Product</Name>
</Dimension>
<Dimension>
<Name>Product</ Name>
<Visible>true</Visible>
</Dimension>
For more information on inherited defaults, see ASSL Objects and Object Characteristics.
ADOMD.NET Server Programming
10/26/2018 • 2 minutes to read • Edit Online
TOPIC DESCRIPTION
ADOMD.NET Server Functionality Describes the uses for ADOMD.NET server objects.
ADOMD.NET Server Object Architecture Describes the object architecture for ADOMD.NET server
objects.
User Defined Functions and Stored Procedures Walks you through the process of creating a user defined
function or stored Procedure.
See Also
ADOMD.NET Client Programming
Developing with ADOMD.NET
ADOMD.NET Server Functionality
10/26/2018 • 2 minutes to read • Edit Online
All ADOMD.NET server objects provide read-only access to the data and metadata on the server. To retrieve data
and metadata, you use the ADOMD.NET server object model as the server object model does not support schema
rowsets.
With ADOMD.NET server objects, you can create a user defined function (UDF ) or a stored procedure for
Microsoft SQL Server Analysis Services. These in-process methods are called through query statements created in
languages such as Multidimensional Expressions (MDX), Data Mining Extensions (DMX), or SQL. These in-process
methods also provide added functionality without the latencies associated with network communications.
NOTE
The Microsoft.AnalysisServices.AdomdServer.AdomdCommand object only supports DMX.
What is a UDF?
A UDF is a method that has the following characteristics:
You can call the UDF in the context of a query.
The UDF can take any number of parameters.
The UDF can return various types of data.
The following example uses the fictional UDF, FinalSalesNumber :
CALL FinalSalesNumbers()
See Also
ADOMD.NET Server Programming
ADOMD.NET Server Object Architecture
10/26/2018 • 2 minutes to read • Edit Online
The ADOMD.NET server objects are helper objects that can be used to create user defined functions (UDFs) or
stored procedures in Microsoft SQL Server Analysis Services.
NOTE
To use the Microsoft.AnalysisServices.AdomdServer namespace (and these objects), a reference to the msmgdsrv.dll
must be added to UDF project or stored procedure.
ADOMD.NET Object Model
Interaction with the ADOMD.NET object hierarchy typically starts with one or more of the objects in the topmost
layer, as described in the following table.
Support implicit conversion and casting among the six basic Microsoft.AnalysisServices.AdomdServer.MDXValue
types of the MDX language The Microsoft.AnalysisServices.AdomdServer.MDXValue object
provides implicit conversion and casting among the following
types:
Microsoft.AnalysisServices.AdomdServer.Hierarchy
Microsoft.AnalysisServices.AdomdServer.Level
Microsoft.AnalysisServices.AdomdServer.Member
Microsoft.AnalysisServices.AdomdServer.Tuple
Microsoft.AnalysisServices.AdomdServer.Set
See Also
ADOMD.NET Server Programming
User Defined Functions and Stored Procedures
5/16/2018 • 3 minutes to read • Edit Online
With ADOMD.NET server objects, you can create user defined function (UDF ) or stored procedures for Microsoft
SQL Server Analysis Services that interact with metadata and data from the server. These in-process methods are
called through Multidimensional Expressions (MDX) or Data Mining Extensions (DMX) statements to provide
added functionality without the latencies associated with network communications.
UDF Examples
A UDF is a method that can be called in the context of an MDX or DMX statement, can take any number of
parameters, and can return any type of data.
A UDF created using MDX is similar to one created for DMX. The main difference is that certain properties of the
Microsoft.AnalysisServices.AdomdServer.Context object, such as the
Microsoft.AnalysisServices.AdomdServer.Context.CurrentCube* and
Microsoft.AnalysisServices.AdomdServer.Context.CurrentMiningModel* properties, are available only for one
scripting language or the other.
The following examples show how to use a UDF to return a node description, filter tuples, and apply a filter to a
tuple.
Returning a Node Description
The following example creates a UDF that returns the node description for a specified node. The UDF uses the
current context in which it is being run, and uses a DMX FROM clause to retrieve the node from the current mining
model.
Once deployed, the previous UDF example can be called by the following DMX expression, which retrieves the
most-likely prediction node. The description contains information that describes the conditions that make up the
prediction node.
Returning Tuples
The following example takes a set and a return count, and randomly retrieves tuples from the set, returning a final
subset:
public Set RandomSample(Set set, int returnCount)
{
//Return the original set if there are fewer tuples
//in the set than the number requested.
if (set.Tuples.Count <= returnCount)
return set;
The previous example is called in the following MDX example. In this MDX example, five random states or
provinces are retrieved from the Adventure Works database.
return resultSetBuilder.ToSet();
}
The previous example is called in the following MDX example, which filters the set to cities with names beginning
with 'A'.
Select Measures.Members on Rows,
SampleAssembly.FilterSet([Customer].[Customer Geography].[City], "[Customer].[Customer Geography].
[City].CurrentMember.Name < 'B'") on Columns
From [Adventure Works]
// Create a command
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
MeasureGroup mg;
int maxOrderDateKey;
mg = cube.MeasureGroups.GetByName("Internet Sales");
maxOrderDateKey = 0;
foreach (Partition part in mg.Partitions)
{
maxOrderDateKey = Math.Max(maxOrderDateKey, Convert.ToInt32(
part.Annotations.Find("LastOrderDateKey").Value.Value,
System.Globalization.CultureInfo.InvariantCulture));
}
svr.Disconnect();
#endregion
}
Database Objects (Analysis Services -
Multidimensional Data)
5/16/2018 • 2 minutes to read • Edit Online
In This Section
The following topics describe objects shared by both OLAP and data mining features in Analysis Services.
TOPIC DESCRIPTION
Data Source Views in Multidimensional Models Describes a logical data model based on one or more data
sources, in Analysis Services.
TOPIC DESCRIPTION
Cubes in Multidimensional Models Describes cubes and cube objects, including measures,
measure groups, dimension usage relationships, calculations,
key performance indicators, actions, translations, partitions,
and perspectives.
Dimensions (Analysis Services - Multidimensional Data) Describes dimensions and dimension objects, including
attributes, attribute relationships, hierarchies, levels, and
members.
Mining Structures (Analysis Services - Data Mining) Describes mining structures and mining objects, including
mining models.
Security Roles (Analysis Services - Multidimensional Data) Describes a role, the security mechanism used to control
access to objects in Analysis Services.
See Also
Supported Data Sources (SSAS - Multidimensional)
Multidimensional Model Solutions
Data Mining Solutions
Attribute Relationships
11/28/2018 • 3 minutes to read • Edit Online
NOTE
Attribute relationships are known in Multidimensional Expressions (MDX) as member properties.
See Also
Attributes and Attribute Hierarchies
Dimension Attribute Properties Reference
User Hierarchies
User Hierarchy Properties
Attributes and Attribute Hierarchies
5/16/2018 • 3 minutes to read • Edit Online
Key Attribute
Each dimension contains a key attribute. Each attribute bound to one or more columns in a dimension table.
The key attribute is the attribute in a dimension that identifies the columns in the dimension main table that are
used in foreign key relationships to the fact table. Typically, the key attribute represents the primary key column
or columns in the dimension table. You can define a logical primary key on a table in a data source view which
has no physical primary key in the underlying data source. For more information, see Define Logical Primary
Keys in a Data Source View (Analysis Services). When defining key attributes, the Cube Wizard and Dimension
Wizard try to use the primary key columns of the dimension table in the data source view. If the dimension
table does not have a logical primary key or physical primary key defined, the wizards may not be able to
correctly define the key attributes for the dimension.
Attribute Hierarchies
By default, attribute members are organized into two level hierarchies, consisting of a leaf level and an All level.
The All level contains the aggregated value of the attribute's members across the measures in each measure
group to which the dimension of which the attribute is related is a member. However, if the IsAggregatable
property is set to False, the All level is not created. For more information, see Dimension Attribute Properties
Reference.
Attributes can be, and typically are, arranged into user-defined hierarchies that provide the drill-down paths by
which users can browse the data in the measure groups to which the attribute is related. In client applications,
attributes can be used to provide grouping and constraint information. When attributes are arranged into user-
defined hierarchies, you define relationships between hierarchy levels when levels are related in a many-to-one
or a one-to-one relationship (called a natural relationship). For example, in a Calendar Time hierarchy, a Day
level should be related to the Month level, the Month level related to the Quarter level, and so on. Defining
relationships between levels in a user-defined hierarchy enables Analysis Services to define more useful
aggregations to increase query performance and can also save memory during processing performance, which
can be important with large or complex cubes. For more information, see User Hierarchies, Create User-
Defined Hierarchies, and Define Attribute Relationships.
Attribute Relationships, Star Schemas, and Snowflake Schemas
By default, in a star schema, all attributes are directly related to the key attribute, which enables users to browse
the facts in the cube based on any attribute hierarchy in the dimension. In a snowflake schema, an attribute is
either directly linked to the key attribute if their underlying table is directly linked to the fact table or is indirectly
linked by means of the attribute that is bound to the key in the underlying table that links the snowflake table to
the directly linked table.
See Also
Create User-Defined Hierarchies
Define Attribute Relationships
Dimension Attribute Properties Reference
Database Dimension Properties - Types
5/16/2018 • 2 minutes to read • Edit Online
See Also
Create a Dimension by Using an Existing Table
Dimensions (Analysis Services - Multidimensional Data)
Database Dimension Properties
5/16/2018 • 2 minutes to read • Edit Online
PROPERTY DESCRIPTION
MiningModelID Contains the ID of the mining model with which the data
mining dimension is associated. This property is applicable
only if the dimension is a mining model dimension.
NOTE
For more information about setting values for the ErrorConfiguration and UnknownMember properties when working with
null values and other data integrity issues, see Handling Data Integrity Issues in Analysis Services 2005.
See Also
Attributes and Attribute Hierarchies
User Hierarchies
Dimension Relationships
Dimensions (Analysis Services - Multidimensional Data)
Dimension Objects (Analysis Services -
Multidimensional Data)
5/16/2018 • 2 minutes to read • Edit Online
In This Section
The following topics provide more information about how to design and implement dimension objects.
TOPIC DESCRIPTION
Dimensions (Analysis Services - Multidimensional Data) In Microsoft SQL Server Analysis Services, dimensions are a
fundamental component of cubes. Dimensions organize data
with relation to an area of interest, such as customers, stores,
or employees, to users.
Attributes and Attribute Hierarchies Dimensions are collections of attributes, which are bound to
one or more columns in a table or view in the data source
view.
See Also
Cube Translations
Translation support in Analysis Services
Globalization Tips and Best Practices (Analysis Services)
Dimensions - Introduction
5/16/2018 • 3 minutes to read • Edit Online
To completely describe a product, the product's category and subcategory must be included in the Product
dimension. However, that information does not reside directly in the main table for the DimProduct dimension. A
foreign key relationship from DimProduct to DimProductSubcategory, which in turn has a foreign key
relationship to the DimProductCategory table, makes it possible to include the information for product
categories and subcategories in the Product dimension.
Processing a Dimension
After you create a dimension, you must process the dimension before you can view the members of the attributes
and hierarchies in the dimension. After the structure of a dimension is changed or the information in its underlying
tables is updated, you have to process the dimension again before you can view the changes. When you process a
dimension after structural changes, you must also process any cubes that include the dimension - or the cube will
not be viewable.
Security
All the subordinate objects of a dimension, including hierarchies, levels, and members, are secured using roles in
Analysis Services. Dimension security can be applied for all the cubes in the database that use the dimension, or
for only a specific cube. For more information about dimension security, see Grant permissions on a dimension
(Analysis Services).
See Also
Dimension Storage
Dimension Translations
Write-Enabled Dimensions
Dimensions - Storage
5/16/2018 • 2 minutes to read • Edit Online
MOLAP
Data for a dimension that uses MOLAP is stored in a multidimensional structure in the instance of Analysis
Services. This multidimensional structure is created and populated when the dimension is processed. MOLAP
dimensions provide better query performance than ROLAP dimensions.
ROLAP
Data for a dimension that uses ROLAP is actually stored in the tables used to define the dimension. The ROLAP
storage mode can be used to support large dimensions without duplicating large amounts of data, but at the
expense of query performance. Because the dimension relies directly on the tables in the data source view used to
define the dimension, the ROLAP storage mode also supports real-time OLAP.
IMPORTANT
If a dimension uses the ROLAP storage mode and the dimension is included in a cube that uses MOLAP storage, any
schema changes to its source table must be followed by immediate processing of the cube. Failure to do this may result in
inconsistent results when querying the cube. Related topic:Automate Analysis Services Administrative Tasks with SSIS.
See Also
Partition Storage Modes and Processing
Dimensions (Analysis Services - Multidimensional
Data)
5/16/2018 • 2 minutes to read • Edit Online
In This Section
TOPIC DESCRIPTION
See Also
Dimensions in Multidimensional Models
Cube Objects (Analysis Services - Multidimensional Data)
Proactive Caching (Dimensions)
5/16/2018 • 2 minutes to read • Edit Online
PROPERTY DESCRIPTION
Never
Members are never hidden. This is the default value.
OnlyChildWithNoName
A member is hidden when the member is the only child of its
parent and the member's name is empty.
OnlyChildWithParentName
A member is hidden when the member is the only child of its
parent and the member's name is identical to that of its
parent.
NoName
A member is hidden when the member's name is empty.
ParentName
A member is hidden when the member's name is identical to
that of its parent.
Name Contains the friendly name of the level. By default, the name
of a level is the same as the name of the source attribute.
SourceAttribute Contains the name of the source attribute on which the level
is based.
See Also
User Hierarchy Properties
User Hierarchies - Properties
5/16/2018 • 2 minutes to read • Edit Online
PROPERTY DESCRIPTION
AllMemberName Contains the caption in the default language for the All
member of the hierarchy.
DisplayFolder Specifies the folder in which to list the hierarchy for users.
See Also
User Hierarchies
Level Properties - user hierarchies
User Hierarchies
5/16/2018 • 5 minutes to read • Edit Online
The Year, Quarter, and Month attributes are used to construct a user-defined hierarchy, named Calendar, in the
time dimension. The relationship between the levels and members of the Calendar dimension (a regular
dimension) is shown in the following diagram.
NOTE
Any hierarchy other than the default two-level attribute hierarchy is called a user-defined hierarchy. For more information
about attribute hierarchies, see Attributes and Attribute Hierarchies.
Member Structures
With the exception of parent-child hierarchies, the positions of members within the hierarchy are controlled by
the order of the attributes in the hierarchy's definition. Each attribute in the hierarchy definition constitutes a
level in the hierarchy. The position of a member within a level is determined by the ordering of the attribute used
to create the level. The member structures of user-defined hierarchies can take one of four basic forms,
depending on how the members are related to each other.
Balanced Hierarchies
In a balanced hierarchy, all branches of the hierarchy descend to the same level, and each member's logical
parent is the level immediately above the member. The Product Categories hierarchy of the Product dimension
in the Adventure Works DW Multidimensional 2012 sample Analysis Services database is a good example of a
balanced hierarchy. Each member in the Product Name level has a parent member in the Subcategory level,
which in turn has a parent member in the Category level. Also, every branch in the hierarchy has a leaf member
in the Product Name level.
Unbalanced Hierarchies
In an unbalanced hierarchy, branches of the hierarchy descend to different levels. Parent-child hierarchies are
unbalanced hierarchies. For example, the Organization dimension in the Adventure Works DW Multidimensional
2012 sample Analysis Services database contains a member for each employee. The CEO is the top member in
the hierarchy, and the division managers and executive secretary are immediately beneath the CEO. The division
managers have subordinate members but the executive secretary does not.
It may be impossible for end users to distinguish between unbalanced and ragged hierarchies. However, you
employ different techniques and properties in Analysis Services to support these two types of hierarchies. For
more information, see Ragged Hierarchies, and Attributes in Parent-Child Hierarchies.
Ragged Hierarchies
In a ragged hierarchy, the logical parent member of at least one member is not in the level immediately above
the member. This can cause branches of the hierarchy to descend to different levels. For example, in a Geography
dimension defined with the levels Continent, CountryRegion, and City, in that order, the member Europe appears
in the top level of the hierarchy, the member France appears in the middle level, and the member Paris appears
in the bottom level. France is more specific than Europe, and Paris is more specific than France. To this regular
hierarchy, the following changes are made:
The Vatican City member is added to the CountryRegion level.
Members are added to the City level and are associated with the Vatican City member in the
CountryRegion level.
A level, named Province, is added between the CountryRegion and City levels.
The Province level is populated with members associated with other members in the CountryRegion level, and
members in the City level are associated with their corresponding members in the Province level. However,
because the Vatican City member in the CountryRegion level has no associated members in the Province level,
members must be associated from the City level directly to the Vatican City member in the CountryRegion level.
Because of the changes, the hierarchy of the dimension is now ragged. The parent of the city Vatican City is the
country/region Vatican City, which is not in the level immediately above the Vatican City member in the City
level. For more information, see Ragged Hierarchies.
Parent-Child Hierarchies
Parent-child hierarchies for dimensions are defined by using a special attribute, called a parent attribute, to
determine how members relate to each other. A parent attribute describes a self-referencing relationship, or self-
join, within a dimension main table. Parent-child hierarchies are constructed from a single parent attribute. Only
one level is assigned to a parent-child hierarchy, because the levels present in the hierarchy are drawn from the
parent-child relationships between members associated with the parent attribute. The dimension schema of a
parent-child hierarchy depends on a self-referencing relationship present on the dimension main table. For
example, the following diagram illustrates the DimOrganization dimension main table in the Adventure Works
DW Multidimensional 2012Analysis Services sample database.
In this dimension table, the ParentOrganizationKey column has a foreign key relationship with the
OrganizationKey primary key column. In other words, each record in this table can be related through a
parent-child relationship with another record in the table. This kind of self-join is generally used to represent
organization entity data, such as the management structure of employees in a department.
When you create a parent-child hierarchy, the columns represented by both attributes must have the same data
type. Both attributes must also be in the same table. By default, any member whose parent key equals its own
member key, null, 0 (zero), or a value absent from the column for member keys is assumed to be a member of
the top level (excluding the (All) level).
The depth of a parent-child hierarchy can vary among its hierarchical branches. In other words, a parent-child
hierarchy is considered an unbalanced hierarchy.
Unlike user-defined hierarchies, in which the number of levels in the hierarchy determines the number of levels
that can be seen by end users, a parent-child hierarchy is defined with the single level of an attribute hierarchy,
and the values in this single level produce the multiple levels seen by users. The number of displayed levels
depends on the contents of the dimension table columns that store the member keys and the parent keys. The
number of levels can change when the data in the dimension tables change. For more information, see Parent-
Child Dimensions, and Attributes in Parent-Child Hierarchies.
See Also
Create User-Defined Hierarchies
User Hierarchy Properties
Dimension Attribute Properties Reference
Write-Enabled Dimensions
5/16/2018 • 4 minutes to read • Edit Online
IMPORTANT
This feature will be removed in the next version of Microsoft SQL Server. Avoid using this feature in new development work,
and plan to modify applications that currently use this feature.
The data in a dimension is generally read-only. However, for certain scenarios, you may want to write-enable a
dimension. In Microsoft SQL Server Analysis Services, write-enabling a dimension enables business users to
modify the contents of the dimension and see the immediate affect of changes on the hierarchies of the
dimension. Any dimension that is based on a single table can be write-enabled. In a write-enabled dimension,
business users and administrators can change, move, add, and delete attribute members within the dimension.
These updates are referred to collectively as dimension writeback.
Analysis Services supports dimension writeback on all dimension attributes and any member of a dimension may
be modified. For a write-enabled cube or partition, updates are stored in a writeback table separate from the
cube's source tables. However, for a write-enabled dimension, updates are recorded directly in the dimension's
table. Also, if the write-enabled dimension is included in a cube with multiple partitions where some or all their
data sources have copies of the dimension table, only the original dimension table is updated during a writeback
process.
Write-enabled dimensions and write-enabled cubes have different but complementary features. A write-enabled
dimension gives business users the ability to update members, whereas a write-enabled cube gives them the
ability to update cell values. Although these two features are complementary, you do not have to use both
features in combination. A dimension does not have to be included in a cube for dimension writeback to occur. A
write-enabled dimension can also be included in a cube that is not write-enabled. You use different procedures to
write-enable dimensions and cubes, and to maintain their security.
The following restrictions apply to dimension writeback:
When you create a new member, you must include every attribute in a dimension. You cannot insert a
member without specifying a value for the key attribute of the dimension. Therefore, creating members is
subject to any constraints (such as non-null key values) that are defined on the dimension table.
Dimension writeback is supported only for star schemas. In other words, a dimension must be based on a
single dimension table directly related to a fact table. After you write-enable a dimension, Analysis Services
validates this requirement when you deploy to an existing Analysis Services database or when you build
an Analysis Services project.
Any existing member of a writeback dimension can be modified or deleted. When a member is deleted, the
deletion cascades to all child members. For example, in a Customer dimension that contains CountryRegion,
Province, City, and Customer attributes, deleting a country/region would delete all provinces, cities, and
customers that belong to the deleted country/region. If a country/region has only one province, deleting that
province would delete the country/region also.
Members of a writeback dimension can only be moved within the same level. For example, a city could be moved
to the City level in a different country/region or province, but a city cannot be moved to the Province or
CountryRegion level. In a parent-child hierarchy, all members are leaf members, and therefore a member may be
moved to any level other than the (All) level.
If a member of a parent-child hierarchy is deleted, the member's children are moved to the member's parent.
Update permissions on the relational table are required on the deleted member, but no permissions are required
on the moved members. When an application moves a member in a parent-child hierarchy, the application can
specify in the UPDATE operation whether descendents of the member are moved with the member or are moved
to the member's parent. To recursively delete a member in a parent-child hierarchy, a user must have update
permissions on the relational table for the member and all the member's descendants.
NOTE
Updates to the parent attribute in a parent-child hierarchy must not include updates to any other properties or attributes.
All changes to a dimension cause the dimension structure to be modified. Each change to a dimension is
considered a single transaction, requiring incremental processing to update the dimension structure. Write-
enabled dimensions have the same processing requirements as any other dimension.
NOTE
Dimension writeback is not supported by linked dimensions.
Security
The only business users who can update a write-enabled dimension are those in Analysis Services database roles
that have been granted read/write permission to the dimension. For each role, you can control which members
can and cannot be updated. For business users to update write-enabled dimensions, their client application must
support this capability. For such users, a write-enabled dimension must be included in a cube that was processed
since the dimension last changed. For more information, see Authorizing access to objects and operations
(Analysis Services).
Users and groups included in the Administrators role can update the attribute members of a write-enabled
dimension, even if the dimension is not included in a cube.
See Also
Database Dimension Properties
Write-Enabled Partitions
Dimensions (Analysis Services - Multidimensional Data)
Aggregations and Aggregation Designs
11/28/2018 • 4 minutes to read • Edit Online
Designing Aggregations
Microsoft SQL Server Analysis Services incorporates a sophisticated algorithm to select aggregations for
precalculation so that other aggregations can be quickly computed from the precalculated values. For example, if
the aggregations are precalculated for the Month level of a Time hierarchy, the calculation for a Quarter level
requires only the summarization of three numbers, which can be quickly computed on demand. This technique
saves processing time and reduces storage requirements, with minimal effect on query response time.
The Aggregation Design Wizard provides options for you to specify storage and percentage constraints on the
algorithm to achieve a satisfactory tradeoff between query response time and storage requirements. However,
the Aggregation Design Wizard's algorithm assumes that all possible queries are equally likely. The Usage-Based
Optimization Wizard lets you adjust the aggregation design for a measure group by analyzing the queries that
have been submitted by client applications. By using the wizard to tune a cube's aggregation you can increase
responsiveness to frequent queries and decrease responsiveness to infrequent queries without significantly
affecting the storage needed for the cube.
Aggregations are designed by using the wizards but are not actually calculated until the partition for which the
aggregations are designed is processed. After the aggregation has been created, if the structure of a cube ever
changes, or if data is added to or changed in a cube's source tables, it is usually necessary to review the cube's
aggregations and process the cube again.
See Also
Partition Storage Modes and Processing
Calculations
12/6/2018 • 3 minutes to read • Edit Online
Calculated Members
A calculated member is a member whose value is calculated at run time using a Multidimensional Expressions
(MDX) expression that you specify when you define the calculated member. A calculated member is available to
business intelligence applications just like any other member. Calculated members do not increase the size of the
cube because only the definitions are stored in the cube; values are calculated in memory as required to answer a
query.
Calculated members can be defined for any dimension, including the measures dimension. Calculated members
created on the Measures dimension are called calculated measures.
Although calculated members are typically based on data that already exists in the cube, you can create complex
expressions by combining data with arithmetic operators, numbers, and functions. You can also use MDX
functions, such as LookupCube, to access data in other cubes in the Analysis Services database. Analysis Services
includes standardized Visual Studio function libraries, and you can use stored procedures to retrieve data from
sources other than the current Analysis Services database. For more information about stored procedures, see
Defining Stored Procedures.
For example, suppose executives in a shipping company want to determine which types of cargo are more
profitable to carry, based on profit per unit of volume. They use a Shipments cube that contains the dimensions
Cargo, Fleet, and Time and the measures Price_to_Ship, Cost_to_Ship, and Volume_in_Cubic_Meters; however,
the cube does not contain a measure for profitability. You can create a calculated member as a measure named
Profit_per_Cubic_Meter in the cube by combining the existing measures in the following expression:
([Measures].[Price_to_Ship] - [Measures].[Cost_to_Ship]) /
[Measures].[Volume_in_Cubic_Meters]
After you create the calculated member, the Profit_per_Cubic_Meter appears together with the other measures
the next time that the Shipments cube is browsed.
To create calculated members, use the Calculations tab in Cube Designer. For more information, see Create
Calculated Members
Named Sets
A named set is a CREATE SET MDX statement expression that returns a set. The MDX expression is saved as part
of the definition of a cube in Microsoft SQL Server Analysis Services. A named set is created for reuse in
Multidimensional Expressions (MDX) queries. A named set enables business users to simplify queries, and use a
set name instead of a set expression for complex, frequently used set expressions. Related topic: Create Named
Sets
Script Commands
A script command is an MDX script, included as part of the definition of the cube. Script commands let you
perform almost any action that is supported by MDX on a cube, such as scoping a calculation to apply to only
part of the cube. In SQL Server Analysis Services, MDX scripts can apply either to the whole cube or to specific
sections of the cube, at specific points throughout the execution of the script. The default script command, which
is the CALCULATE statement, populates cells in the cube with aggregated data based on the default scope.
The default scope is the whole cube, but you can define a more limited scope, known as a subcube, and then
apply an MDX script to only that particular cube space. The SCOPE statement defines the scope of all subsequent
MDX expressions and statements in the calculation script until the scope is terminated or redefined. The THIS
statement is then used to apply an MDX expression to the current scope. You can use the BACK_COLOR
statement to specify a background cell color for the cells in the current scope, to help you during debugging.
For example, you can use a script command to allocate sales quotas to employees across time and sales territory
based on the weighted values of sales for a prior time period.
See Also
Calculations in Multidimensional Models
Cube Cells (Analysis Services - Multidimensional
Data)
5/16/2018 • 3 minutes to read • Edit Online
The single shaded cell in this diagram is the intersection of the following members:
The air member of the Route dimension.
The Africa member of the Source dimension.
The 4th quarter member of the Time dimension.
The Packages measure.
Assuming the aggregations for the 3rd quarter and 4th quarter members are summations, the value of the
specified cell is 400, which is the total of all of the leaf cells shaded in the previous diagram. Because the value of
the cell is derived from the aggregation of other cells, the specified cell is considered a nonleaf cell.
The cell values derived for members that use custom rollups and member groups, in addition to custom members,
are handled similarly. However, cell values derived for calculated members are based completely on the
Multidimensional Expressions (MDX) expression used to define the calculated member; in some cases, there may
be no actual cell data involved. For more information, see Custom Rollup Operators in Parent-Child Dimensions,
Define Custom Member Formulas, and Calculations.
Empty Cells
It is not required that every cell in a cube contain a value; there can be intersections in a cube that have no data.
These intersections, called empty cells, frequently occur in cubes because not every intersection of a dimension
attribute with a measure within a cube contains a corresponding record in a fact table. The ratio of empty cells in a
cube to the total number of cells in a cube is frequently referred to as the sparsity of a cube.
For example, the structure of the cube shown in the following diagram is similar to other examples in this topic.
However, in this example, there were no air shipments to Africa for the third quarter or to Australia for the fourth
quarter. There is no data in the fact table to support the intersections of those dimensions and measures; therefore
the cells at those intersections are empty.
In SQL Server Analysis Services, an empty cell is a cell that has special qualities. Because empty cells can skew the
results of crossjoins, counts, and so on, many MDX functions supply the ability to ignore empty cells for the
purposes of calculation. For more information, see Multidimensional Expressions (MDX) Reference, and Key
Concepts in MDX (Analysis Services).
Security
Access to cell data is managed in Analysis Services at the role level, and can be finely controlled by using MDX
expressions. For more information, see Grant custom access to dimension data (Analysis Services), and Grant
custom access to cell data (Analysis Services).
See Also
Cube Storage (Analysis Services - Multidimensional Data)
Aggregations and Aggregation Designs
Cube Objects (Analysis Services - Multidimensional
Data)
5/16/2018 • 2 minutes to read • Edit Online
In this section
Topic
Calculations
Cube Translations
Dimension Relationships
Perspectives
Cube Properties - Multidimensional Model
Programming
5/16/2018 • 2 minutes to read • Edit Online
NOTE
Some properties are set automatically when the cube is created and cannot be changed.
For more information about how to set cube properties, see Cube Designer (Analysis Services - Multidimensional
Data).
PROPERTY DESCRIPTION
Collation Specifies the locale identifier (LCID) and the comparison flag,
separated by an underscore: for example,
Latin1_General_C1_AS.
Source Displays the data source view used for the cube.
StorageLocation Specifies the file system storage location for the cube. If none
is specified, the location is inherited from the database that
contains the cube object.
StorageMode Specifies the storage mode for the cube. Values are MOLAP,
ROLAP, or HOLAP.
NOTE
For more information about setting values for the ErrorConfiguration property when working with null values and other data
integrity issues, see Handling Data Integrity Issues in Analysis Services 2005.
See Also
Proactive Caching (Partitions)
Cube Storage (Analysis Services - Multidimensional
Data)
5/16/2018 • 3 minutes to read • Edit Online
Partition Storage
Storage for a measure group can be divided into multiple partitions. Partitions enable you to distribute a measure
group into discrete segments on a single server or across multiple servers, and to optimize storage and query
performance. Each partition in a measure group can be based on a different data source and stored using different
storage settings.
You specify the data source for a partition when you create it. You can also change the data source for any existing
partition. A measure group can be partitioned vertically or horizontally. Each partition in a vertically partitioned
measure group is based on a filtered view of a single source table. For example, if a measure group is based on a
single table that contains several years of data, you could create a separate partition for each year's data. In
contrast, each partition in a horizontally partitioned measure group is based on a separate table. You would use
horizontal partitions if the data source stores each year's data in a separate table.
Partitions are initially created with the same storage settings as the measure group in which they are created. The
storage settings determine whether the detail and aggregation data is stored in multidimensional format on the
instance of Analysis Services, in relational format on the source server, or a combination of both. Storage settings
also determine whether proactive caching is used to automatically process source data changes to the
multidimensional data stored on the Analysis Services.
The partitions of a cube are not visible to the user. However, the choice of storage settings for different partitions
may affect the immediacy of data, the amount of disk space that is used, and query performance. Partitions can be
stored on multiple instances of Analysis Services. This provides a clustered approach to cube storage, and
distributes workload across Analysis Services servers. For more information, see Partition Storage Modes and
Processing, Remote Partitions, and Partitions (Analysis Services - Multidimensional Data).
Linked Measure Groups
It can require considerable disk space to store multiple copies of a cube on different instances of Analysis Services,
but you can greatly reduce the space needed by replacing the copies of the measure group with linked measure
groups. A linked measure group is based on a measure group in a cube in another Analysis Services database, on
the same or a different instance of Analysis Services. A linked measure group can also be used with linked
dimensions from the same source cube. The linked dimensions and measure groups use the aggregations of the
source cube and have no data storage requirements of their own. Therefore, by maintaining the source measure
groups and dimensions in one database, and creating linked cubes and dimensions in cubes in other databases,
you can save disk space that otherwise would be used for storage. For more information, see Linked Measure
Groups.
See Also
Aggregations and Aggregation Designs
Cube Translations
5/16/2018 • 2 minutes to read • Edit Online
See Also
Dimension Translations
Translation support in Analysis Services
Globalization Tips and Best Practices (Analysis Services)
Dimension Relationships
11/28/2018 • 5 minutes to read • Edit Online
A reference dimension relationship represents the relationship between dimension tables and a fact table in a
snowflake schema design. When dimension tables are connected in a snowflake schema, you can define a
single dimension using columns from multiple tables, or you can define separate dimensions based on the
separate dimension tables and then define a link between them using the reference dimension relationship
setting. The following figure shows one fact table named InternetSales, and two dimension tables called
Customer and Geography, in a snowflake schema.
You can create a dimension with the Customer table as the dimension main table and the Geography table
included as a related table. A regular relationship is then defined between the dimension and the InternetSales
measure group.
Alternatively, you can create two dimensions related to the InternetSales measure group: a dimension based
on the Customer table, and a dimension based on the Geography table. You can then relate the Geography
dimension to the InternetSales measure group using a reference dimension relationship using the Customer
dimension. In this case, when the facts in the InternetSales measure group are dimensioned by the Geography
dimension, the facts are dimensioned by customer and by geography. If the cube contained a second measure
group named Reseller Sales, you would be unable to dimension the facts in the Reseller Sales measure group
by Geography because no relationship would exist between Reseller Sales and Geography.
There is no limit to the number of reference dimensions that can be chained together, as shown in the
following illustration.
For more information about referenced relationships, see Define a Referenced Relationship and Referenced
Relationship Properties.
NOTE
Fact dimensions are frequently used to support drillthrough actions. For more information about actions, see Actions
(Analysis Services - Multidimensional Data).
NOTE
Fact dimensions must be incrementally updated after every update to the measure group that is referenced by the fact
relationship. If the fact dimension is a ROLAP dimension, the Analysis Services processing engine drops any caches and
incrementally processes the measure group.
For more information about fact relationships, see Define a Fact Relationship and Fact Relationship Properties.
SQL Server Analysis Services lets you define a many-to-many relationship between a dimension and a fact
table.
NOTE
To support a many-to-many dimension relationship, the data source view must have established a foreign key
relationship between all the tables involved, as shown in the previous diagram. Otherwise, you will be unable to select
the correct intermediate measure group when establishing the relationship in the Dimension Usage tab of Dimension
Designer.
For more information about many-to-many relationships, see Define a Many-to-Many Relationship and
Many-to-Many Relationship Properties.
See Also
Dimensions (Analysis Services - Multidimensional Data)
Partitions - Partition Storage Modes and Processing
11/28/2018 • 5 minutes to read • Edit Online
MOLAP
The MOLAP storage mode causes the aggregations of the partition and a copy of its source data to be stored in a
multidimensional structure in Analysis Services when the partition is processed. This MOLAP structure is highly
optimized to maximize query performance. The storage location can be on the computer where the partition is
defined or on another computer running Analysis Services. Because a copy of the source data resides in the
multidimensional structure, queries can be resolved without accessing the partition's source data. Query
response times can be decreased substantially by using aggregations. The data in the partition's MOLAP
structure is only as current as the most recent processing of the partition.
As the source data changes, objects in MOLAP storage must be processed periodically to incorporate those
changes and make them available to users. Processing updates the data in the MOLAP structure, either fully or
incrementally. The time between one processing and the next creates a latency period during which data in OLAP
objects may not match the source data. You can incrementally or fully update objects in MOLAP storage without
taking the partition or cube offline. However, there are situations that may require you to take a cube offline to
process certain structural changes to OLAP objects. You can minimize the downtime required to update MOLAP
storage by updating and processing cubes on a staging server and using database synchronization to copy the
processed objects to the production server. You can also use proactive caching to minimize latency and maximize
availability while retaining much of the performance advantage of MOLAP storage. For more information, see
Proactive Caching (Partitions), Synchronize Analysis Services Databases, and Processing a multidimensional
model (Analysis Services).
ROLAP
The ROLAP storage mode causes the aggregations of the partition to be stored in indexed views in the relational
database that was specified in the partition's data source. Unlike the MOLAP storage mode, ROLAP does not
cause a copy of the source data to be stored in the Analysis Services data folders. Instead, when results cannot be
derived from the query cache, the indexed views in the data source is accessed to answer queries. Query
response is generally slower with ROLAP storage than with the MOLAP or HOLAP storage modes. Processing
time is also typically slower with ROLAP. However, ROLAP enables users to view data in real time and can save
storage space when you are working with large datasets that are infrequently queried, such as purely historical
data.
NOTE
When using ROLAP, Analysis Services may return incorrect information related to the unknown member if a join is
combined with a GROUP BY clause. Analysis Services eliminates relational integrity errors instead of returning the unknown
member value.
If a partition uses the ROLAP storage mode and its source data is stored in SQL Server Database Engine,
Analysis Services tries to create indexed views to contain aggregations of the partition. If Analysis Services
cannot create indexed views, it does not create aggregation tables. Although Analysis Services handles the
session requirements for creating indexed views on SQL Server Database Engine, the following conditions must
be met by the ROLAP partition and the tables in its schema in order for Analysis Services to create indexed views
for aggregations:
The partition cannot contain measures that use the Min or Max aggregate functions.
Each table in the schema of the ROLAP partition must be used only one time. For example, the schema
cannot contain [dbo].[address] AS "Customer Address" and [dbo].[address] AS "SalesRep Address".
Each table must be a table, not a view.
All table names in the partition's schema must be qualified with the owner name, for example, [dbo].
[customer].
All tables in the partition's schema must have the same owner; for example, you cannot have a FROM
clause that references the tables [tk].[customer], [john].[store], and [dave].[sales_fact_2004].
The source columns of the partition's measures must not be nullable.
All tables used in the view must have been created with the following options set to ON:
ANSI_NULLS
QUOTED_IDENTIFIER
The total size of the index key, in SQL Server Database Engine, cannot exceed 900 bytes. SQL Server
Database Engine will assert this condition based on the fixed length key columns when the CREATE
INDEX statement is processed. However, if there are variable length columns in the index key, SQL Server
Database Engine will also assert this condition for every update to the base tables. Because different
aggregations have different view definitions, ROLAP processing using indexed views can succeed or fail
depending on the aggregation design.
The session creating the indexed view must have the following options set to ON: ARITHABORT,
CONCAT_NULL_YEILDS_NULL, QUOTED_IDENTIFIER, ANSI_NULLS, ANSI_PADDING, and
ANSI_WARNING. This setting can be made in SQL Server Management Studio.
The session creating the indexed view must have the following option set to OFF:
NUMERIC_ROUNDABORT. This setting can be made in SQL Server Management Studio.
HOLAP
The HOLAP storage mode combines attributes of both MOLAP and ROLAP. Like MOLAP, HOLAP causes the
aggregations of the partition to be stored in a multidimensional structure in an SQL Server Analysis Services
instance. HOLAP does not cause a copy of the source data to be stored. For queries that access only summary
data in the aggregations of a partition, HOLAP is the equivalent of MOLAP. Queries that access source data-for
example, if you want to drill down to an atomic cube cell for which there is no aggregation data-must retrieve
data from the relational database and will not be as fast as they would be if the source data were stored in the
MOLAP structure. With HOLAP storage mode, users will typically experience substantial differences in query
times depending upon whether the query can be resolved from cache or aggregations versus from the source
data itself.
Partitions stored as HOLAP are smaller than the equivalent MOLAP partitions because they do not contain
source data and respond faster than ROLAP partitions for queries involving summary data. HOLAP storage
mode is generally suited for partitions in cubes that require rapid query response for summaries based on a
large amount of source data. However, where users generate queries that must touch leaf level data, such as for
calculating median values, MOLAP is generally a better choice.
See Also
Proactive Caching (Partitions)
Synchronize Analysis Services Databases
Partitions (Analysis Services - Multidimensional Data)
Partitions - Proactive Caching
5/16/2018 • 2 minutes to read • Edit Online
NOTE
To store a remote partition, the computer must have an instance of SQL ServerAnalysis Services installed and be running the
same service pack level as the instance where the partition was defined. Remote partitions on instances of an earlier version
of Analysis Services are not supported.
When remote partitions are included in a measure group, the memory and CPU utilization of the cube is
distributed across all the partitions in the measure group. For example, when a remote partition is processed,
either alone or as part of parent cube processing, most of the memory and CPU utilization for that partition
occurs on the remote instance of Analysis Services.
NOTE
A cube that contains remote partitions can contain write-enabled dimensions; however, this may affect performance for the
cube. For more information about write-enabled dimensions, see Write-Enabled Dimensions.
If a measure group contains multiple MOLAP or HOLAP partitions stored on multiple instances of Analysis
Services, the cube distributes the data in the measure group data among those instances of Analysis Services.
See Also
Create and Manage a Remote Partition (Analysis Services)
Processing Analysis Services Objects
Partitions - Write-Enabled Partitions
5/16/2018 • 3 minutes to read • Edit Online
NOTE
If you want to write-enable a cube that has a Microsoft Access database as a data source, do not use Microsoft OLE DB
Provider for ODBC Drivers in the data source definitions for the cube, its partitions, or its dimensions. Instead, you can use
Microsoft Jet 4.0 OLE DB Provider, or any version of the Jet Service Pack that includes Jet 4.0 OLE. For more information, see
the Microsoft Knowledge Base article How to obtain the latest service pack for the Microsoft Jet 4.0 Database Engine.
A cube can be write-enabled only if all its measures use the Sum aggregate function. Linked measure groups and
local cubes cannot be write-enabled.
Writeback Storage
Any change made by the business user is stored in the writeback table as a difference from the currently displayed
value. For example, if an end user changes a cell value from 90 to 100, the value +10 is stored in the writeback
table, together with the time of the change and information about the business user who made it. The net effect of
accumulated changes is displayed to client applications. The original value in the cube is preserved, and an audit
trail of changes is recorded in the writeback table.
Changes to leaf and nonleaf cells are handled differently. A leaf cell represents an intersection of a measure and a
leaf member from every dimension referenced by the measure group. The value of a leaf cell is taken directly from
the fact table, and cannot be divided further by drilling down. If a cube or any partition is write-enabled, changes
can be made to a leaf cell. Changes can be made to a nonleaf cell only if the client application provides a way of
distributing the changes among the leaf cells that make up the nonleaf cell. This process, called allocation, is
managed through the UPDATE CUBE statement in Multidimensional Expressions (MDX). Business intelligence
developers can use the UPDATE CUBE statement to include allocation functionality. For more information, see
UPDATE CUBE Statement (MDX).
IMPORTANT
When updated cells do not overlap, the Update Isolation Level connection string property can be used to enhance
performance for UPDATE CUBE. For more information, see ConnectionString.
Regardless of whether a client application distributes changes that were made to nonleaf cells, whenever queries
are evaluated, changes in the writeback table are applied to both leaf and nonleaf cells so that business users can
view the effects of the changes throughout the cube.
Changes that were made by the business user are kept in a separate writeback table that you can work with as
follows:
Convert to a partition to permanently incorporate changes into the cube. This action makes the measure
group read-only. You can specify a filter expression to select the changes you want to convert.
Discard to return the partition to its original state. This action makes the partition read-only.
Security
A business user is permitted to record changes in a cube's writeback table only if the business user belongs to a
role that has read/write permission to the cube's cells. For each role, you can control which cube cells can and
cannot be updated. For more information, see Grant cube or model permissions (Analysis Services).
See Also
Write-Enabled Dimensions
Aggregations and Aggregation Designs
Partitions (Analysis Services - Multidimensional Data)
Write-Enabled Dimensions
Partitions (Analysis Services - Multidimensional
Data)
5/16/2018 • 6 minutes to read • Edit Online
Partition Structure
The structure of a partition must match the structure of its measure group, which means that the measures that
define the measure group must also be defined in the partition, along with all related dimensions. Therefore,
when a partition is created, it automatically inherits the same set of measures and related dimensions that were
defined for the measure group.
However, each partition in a measure group can have a different fact table, and these fact tables can be from
different data sources. When different partitions in a measure group have different fact tables, the tables must be
sufficiently similar to maintain the structure of the measure group, which means that the processing query
returns the same columns and same data types for all fact tables for all partitions.
When fact tables for different partitions are from different data sources, the source tables for any related
dimensions, and also any intermediate fact tables, must also be present in all data sources and must have the
same structure in all the databases. Also, all dimension table columns that are used to define attributes for cube
dimensions related to the measure group must be present in all of the data sources. There is no need to define
all the joins between the source table of a partition and a related dimension table if the partition source table has
the identical structure as the source table for the measure group.
Columns that are not used to define measures in the measure group can be present in some fact tables but
absent in others. Similarly, columns that are not used to define attributes in related dimension tables can be
present in some databases but absent in others. Tables that are not used for either fact tables or related
dimension tables can be present in some databases but absent in others.
Incremental Updates
When you create and manage partitions in multiple-partition measure groups, you must take special
precautions to guarantee that cube data is accurate. Although these precautions do not usually apply to single-
partition measure groups, they do apply when you incrementally update partitions. When you incrementally
update a partition, a new temporary partition is created that has a structure identical to that of the source
partition. The temporary partition is processed and then merged with the source partition. Therefore, you must
ensure that the processing query that populates the temporary partition does not duplicate any data already
present in an existing partition.
See Also
Configure Measure Properties
Cubes in Multidimensional Models
Perspectives
5/16/2018 • 3 minutes to read • Edit Online
Security
Perspectives are not meant to be used as a security mechanism, but as a tool for providing a better user
experience in business intelligence applications. All security for a particular perspective is inherited from the
underlying cube. For example, perspectives cannot provide access to objects in a cube to which a user does not
already have access. - Security for the cube must be resolved before access to objects in the cube can be provided
through a perspective.
Logical Architecture Overview (Analysis Services -
Multidimensional Data)
11/27/2018 • 7 minutes to read • Edit Online
Basic Architecture
An instance of Analysis Services can contain multiple databases, and a database can have OLAP objects and data
mining objects at the same time. Applications connect to a specified instance of Analysis Services and a specified
database. A server computer can host multiple instances of Analysis Services. Instances of Analysis Services are
named as "<ServerName>\<InstanceName>". The following illustration shows all mentioned relationships
between Analysis Services objects.
Basic classes are the minimum set of objects that are required to build a cube. This minimum set of objects is a
dimension, a measure group, and a partition. An aggregation is optional.
Dimensions are built from attributes and hierarchies. Hierarchies are formed by an ordered set of attributes, where
each attribute of the set corresponds to a level in the hierarchy.
Cubes are built from dimensions and measure groups. The dimensions in the dimensions collection of a cube
belong to the dimensions collection of the database. Measure groups are collections of measures that have the
same data source view and have the same subset of dimensions from the cube. A measure group has one or more
partitions to manage the physical data. A measure group can have a default aggregation design. The default
aggregation design can be used by all partitions in the measure group; also, each partition can have its own
aggregation design.
Server Objects
Each instance of Analysis Services is seen as a different server object in AMO; each different instance is connected
to a Server object by a different connection. Each server object contains one or more data sources, data source
views, and database objects, as well as assemblies and security roles.
Dimension Objects
Each database object contains multiple dimension objects. Each dimension object contains one or more attributes,
which are organized into hierarchies.
Cube Objects
Each database object contains one or more cube objects. A cube is defined by its measures and dimensions. The
measures and dimensions in a cube are derived from the tables and views in the data source view on which the
cube is based, or which is generated from the measure and dimension definitions.
Object Inheritance
The ASSL object model contains many repeated element groups. For example, the element group, "Dimensions
contain Hierarchies," defines the dimension hierarchy of an element. Both Cubes and MeasureGroups contain
the element group, "Dimensions contain Hierarchies."
Unless explicitly overridden, an element inherits the details of these repeated element groups from the higher
level. For example, the Translations for a CubeDimension are the same as the Translations for its ancestor
element, Cube.
To explicitly override properties inherited from a higher-level object, an object does not need to repeat explicitly
the entire structure and properties of the higher-level object. The only properties that an object needs to state
explicitly are those properties that the object wants to override. For example, a CubeDimension may list only
those Hierarchies that need to be disabled in the Cube, or for which the visibility needs to be changed, or for
which some Level details have not been provided at the Dimension level.
Some properties specified on an object provide default values for the same property on a child or descendant
object. For example, Cube.StorageMode provides the default value for Partition.StorageMode. For inherited
default values, ASSL applies these rules for inherited default values:
When the property for the child object is null in the XML, the property's value defaults to the inherited
value. However, if you query the value from the server, the server returns the null value of the XML
element.
It is not possible to determine programmatically whether the property of a child object has been set directly
on the child object or inherited.
Example
The Imports cube contains two measures, Packages and Last, and three related dimensions, Route, Source, and
Time.
The smaller alphanumeric values around the cube are the members of the dimensions. Example members are
ground (member of the Route dimension), Africa (member of the Source dimension), and 1st quarter (member of
the Time dimension).
Measures
The values within the cube cells represent the two measures, Packages and Last. The Packages measure represents
the number of imported packages, and the Sum function is used to aggregate the facts. The Last measure
represents the date of receipt, and the Max function is used to aggregate the facts.
Dimensions
The Route dimension represents the means by which the imports reach their destination. Members of this
dimension include ground, nonground, air, sea, road, or rail. The Source dimension represents the locations where
the imports are produced, such as Africa or Asia. The Time dimension represents the quarters and halves of a
single year.
Aggregates
Business users of a cube can determine the value of any measure for each member of every dimension, regardless
of the level of the member within the dimension, because Analysis Services aggregates values at upper levels as
needed. For example, the measure values in the preceding illustration can be aggregated according to a standard
calendar hierarchy by using the Calendar Time hierarchy in the Time dimension as illustrated in the following
diagram.
In addition to aggregating measures by using a single dimension, you can aggregate measures by using
combinations of members from different dimensions. This allows business users to evaluate measures in multiple
dimensions simultaneously. For example, if a business user wants to analyze quarterly imports that arrived by air
from the Eastern Hemisphere and Western Hemisphere, the business user can issue a query on the cube to
retrieve the following dataset.
PACKAGES LAST
After a cube is defined, you can create new aggregations, or you can change existing aggregations to set options
such as whether aggregations are precalculated during processing or calculated at query time. Related
topic:Aggregations and Aggregation Designs.
Mapping Measures, Attributes, and Hierarchies
The measures, attributes, and hierarchies in the example cube are derived from the following columns in the cube's
fact and dimension tables.
Half attribute in Time 1st half,2nd half TimeDimensionTable Half 2nd half
dimension
Data in a single cube cell is usually derived from multiple rows in the fact table. For example, the cube cell at the
intersection of the air member, the Africa member, and the 1st quarter member contains a value that is derived by
aggregating the following rows in the ImportsFactTable fact table.
3516987 1 6 1 15 Jan-10-99
3554790 1 6 1 40 Jan-19-99
3572673 1 6 1 34 Jan-27-99
3600974 1 6 1 45 Feb-02-99
3645541 1 6 1 20 Feb-09-99
3674906 1 6 1 36 Feb-17-99
In the preceding table, each row has the same values for the RouteKey, SourceKey, and TimeKey columns,
indicating that these rows contribute to the same cube cell.
The example shown here represents a very simple cube, in that the cube has a single measure group, and all the
dimension tables are joined to the fact table in a star schema. Another common schema is a snowflake schema, in
which one or more dimension tables join to another dimension table, rather than joining directly to the fact table.
Related topic:Dimensions (Analysis Services - Multidimensional Data).
The example shown here contains only a single fact table. When a cube has multiple fact tables, the measures from
each fact table are organized into measure groups, and a measure group is related to a specific set of dimensions
by defined dimension relationships. These relationships are defined by specifying the participating tables in the
data source view and the granularity of the relationship. Related topic:Dimension Relationships.
See Also
Multidimensional Model Databases
Security Roles (Analysis Services - Multidimensional
Data)
5/16/2018 • 5 minutes to read • Edit Online
Permission Objects
Permissions are associated with an object (cube, dimension, others) for a particular role. Permissions specify what
operations the member of that role can perform on that object.
The Permission class is an abstract class. Therefore, you must use the derived classes to define permissions on the
corresponding objects. For each object, a permission derived class is defined.
OBJECT CLASS
Database DatabasePermission
DataSource DataSourcePermission
Dimension DimensionPermission
Cube CubePermission
MiningStructure MiningStructurePermission
MiningModel MiningModelPermission
Allowed on a MiningModelPermission
grants permissions to see objects in
schema rowsets and to perform predict
joins.
See Also
Permissions and Access Rights (Analysis Services - Multidimensional Data)
Authorizing access to objects and operations (Analysis Services)
Server Objects (Analysis Services - Multidimensional
Data)
5/16/2018 • 2 minutes to read • Edit Online
In This Section
Logical Architecture Overview
Logical Architecture Overview (Analysis Services - Multidimensional Data)
Server Objects
Server Objects (Analysis Services - Multidimensional Data)
Database Objects
Database Objects (Analysis Services - Multidimensional Data)
Dimension Objects
Dimension Objects (Analysis Services - Multidimensional Data)
Cube Objects
Cube Objects (Analysis Services - Multidimensional Data)
User Access Security
User Access Security Architecture
See Also
Understanding Microsoft OLAP Architecture
Physical Architecture (Analysis Services - Multidimensional Data)
Client Architecture Requirements for Analysis
Services Development
5/16/2018 • 4 minutes to read • Edit Online
Win32 client applications can connect to an Analysis Services server using OLE DB for OLAP interfaces or the
Microsoft® ActiveX® Data Objects (ADO ) object model for Component Object Model (COM ) automation
languages, such as Microsoft Visual Basic®. Applications coded with .NET languages can connect to an Analysis
Services server using ADOMD.NET.
Existing applications can communicate with Analysis Services without modification simply by using one of the
Analysis Services providers.
Analysis Services has a Web architecture with a fully scalable middle tier for deployment by both small and large
organizations. Analysis Services provides broad middle tier support for Web services. ASP applications are
supported by OLE DB for OLAP and ADO MD, ASP.NET applications are supported by ADOMD.NET. The middle
tier, illustrated in the following figure, is scalable to many concurrent users.
Both client and middle tier applications can communicate directly with Analysis Services without using a provider.
Client and middle tier applications may send XML for Analysis in SOAP packets over TCP/IP, HTTP, or HTTPS.
The client may be coded using any language that supports SOAP. Communication in this case is most easily
managed by Internet Information Services (IIS ) using HTTP, although a direct connection to the server using
TCP/IP may also be coded. This is the thinnest possible client solution for Analysis Services.
NOTE
When you use a cube as a data source for a Power Pivot workbook, the data that you get from the cube is defined as an
MDX query; however, the data is imported as a flattened snapshot. You cannot interactively work with the data or refresh
the data from the cube.
For more information about using an SSAS cube as a data source, see the Power Pivot for Excel.
Interfaces for Power Pivot Client
Power Pivot interacts with the xVelocity in-memory analytics engine (VertiPaq) storage engine within the
workbook by using the established interfaces and languages for Analysis Services: AMO and ADOMD.NET, and
MDX and XMLA. Within the add-in, measures are defined by using a formula language similar to Excel, Data
Analysis Expressions (DAX). DAX expressions are embedded within the XMLA messages that are sent to the in-
process server.
Providers
Communications between Power Pivot and Excel use the MSOLAP OLEDB provider (version 11.0). Within the
MSOLAP provider, there are four different modules, or transports, that can be used for sending messages between
the client and server.
TCP/IP Used for normal client-server connections.
HTTP Used for HTTP connections via the SSAS data pump service, or by a call to the SharePoint Power Pivot
Web Service (WS ) component.
INPROC Used for connections to the in-process engine.
CHANNEL Reserved for communications with the Power Pivot System Service in the SharePoint farm.
See Also
OLAP Engine Server Components
Data Types in Analysis Services
10/26/2018 • 2 minutes to read • Edit Online
Binary A stream of binary data of Byte type. Byte is a value type that
represents unsigned integers with values that range from 0 to
255.
Date Date and time data, stored as a double. The whole portion is
the number of days since December 30, 1899, and the
fractional portion is a fraction of a day or time of the day.
ValueColumn All
ADMOD.NET and Analysis Management Objects (AMO ) also load the local cube engine when interacting with
local cubes. Only a single process can access a local cube file, because the local cube engine exclusively locks a
local cube file when it establishes a connection to the local cube. With a process, up to five simultaneous
connections are permitted.
A .cub file may contain more than one cube or data mining model. Queries to the local cubes and data mining
models are handled by the local cube engine and do not require a connection to an Analysis Services instance.
NOTE
The use of SQL Server Management Studio and SQL Server Data Tools (SSDT) to manage local cubes is not supported.
Local Cubes
A local cube can be created and populated from either an existing cube in an Analysis Services instance or from a
relational data source.
Server-based cube You can use either the CREATE GLOBAL CUBE statement or an
Analysis Services Scripting Language (ASSL) script to create
and populate a cube from a server-based cube. For more
information, see CREATE GLOBAL CUBE Statement (MDX) or
Analysis Services Scripting Language (ASSL for XMLA).
SOURCE FOR DATA FOR LOCAL CUBE CREATION METHOD
Relational data source You use an ASSL script to create and populate a cube from an
OLE DB relational database. To create a local cube using ASSL,
you simply connect to a local cube file (*.cub) and execute the
ASSL script in the same manner as executing an ASSL script
against an Analysis Services instance to create a server cube.
For more information, see Analysis Services Scripting
Language (ASSL for XMLA).
Use the REFRESH CUBE statement to rebuild a local cube and update its data. For more information, see
REFRESH CUBE Statement (MDX).
Local Cubes Created from Server-based Cubes
When creating local cubes created from server-based cubes, the following considerations apply:
Distinct count measures are not supported.
When you add a measure, you must also include at least one dimension that is related to the measure being
added. For more information about dimension relationships to measure groups, see Dimension
Relationships.
When you add a parent-child hierarchy, levels and filters on a parent-child hierarchy are ignored and the
entire parent-child hierarchy is included.
Member properties are not created.
When you include a semi-additive measure, no slices are permitted on either the Account or the Time
dimension.
Reference dimensions are always materialized.
When you include a many-to-many dimension, the following rules apply:
You cannot slice the many-to-many dimension.
You must add a measure from the intermediary measure group.
You cannot slice any of the dimensions common to the two measure groups involved in the many-to-
may relationship.
Only those calculated members, named sets, and assignments that rely upon measures and dimensions
added to the local cube will appear in the local cube. Invalid calculated members, named sets, and
assignments will be automatically excluded.
Security
In order for a user to create a local cube from a server cube, the user must be granted Drillthrough and Local
Cube permissions on the server cube. For more information, see Grant cube or model permissions (Analysis
Services).
Local cubes are not secured using roles like server cubes. Anyone with file-level access to a local cube file can
query cubes in it. You can use the Encryption Password connection property on a local cube file to set a
password on the local cube file. Setting a password on a local cube file requires all future connections to the local
cube file to use this password in order to query the file.
See Also
CREATE GLOBAL CUBE Statement (MDX)
Developing with Analysis Services Scripting Language (ASSL )
REFRESH CUBE Statement (MDX)
Maximum capacity specifications (Analysis Services)
5/16/2018 • 3 minutes to read • Edit Online
For more information about object naming guidelines, see ASSL Objects and Object Characteristics.
For more information about data source limitations for online analytical processing (OLAP ) and data mining, see
Supported Data Sources (SSAS - Multidimensional), Supported Data Sources (SSAS - Multidimensional), and
ASSL Objects and Object Characteristics.
SharePoint (DeploymentMode=1)
OBJECT MAXIMUM SIZES/NUMBERS
Tabular (DeploymentMode=2)
The following are theoretical limits. Performance will be diminished at lower numbers.
Relationships 8,000
See also
Determine the Server Mode of an Analysis Services Instance
General Properties
Object Naming Rules (Analysis Services)
11/28/2018 • 3 minutes to read • Edit Online
Naming Conventions
Every object has a Name and ID property that must be unique within the scope of the parent collection. For
example, two dimensions can have same name as long as each one resides in a different database.
Although you can specify it manually, the ID is typically auto-generated when the object is created. You should
never change the ID once you have begun building a model. All object references throughout a model are based
on the ID. Thus, changing an ID can easily result in model corruption.
DataSource and DataSourceView objects have notable exceptions to naming conventions. DataSource ID can
be set to a single dot (.), which is not unique, as a reference to the current database. A second exception is
DataSourceView, which adheres to the naming conventions defined for DataSet objects in the .NET Framework,
where the Name is used as the identifier.
The following rules apply to Name and ID properties.
Names are case insensitive. You cannot have a cube named "sales" and another named "Sales" in the same
database.
No leading or trailing spaces allowed in an object name, although you can embed spaces within a name.
Leading and trailing spaces are implicitly trimmed. This applies to both the Name and ID of an object.
The maximum number of characters is 100.
There is no special requirement for the first character of an identifier. The first character may be any valid
character.
Tabular - 1050 No
Tabular - 1100 No
Databases can have a ModelType of default. Default is equivalent to multidimensional, and thus does not support
the use of reserved characters in column names.
See Also
MDX Reserved Words
Translation support in Analysis Services
XML for Analysis Compliance (XMLA)
OLAP Engine Server Components
5/16/2018 • 2 minutes to read • Edit Online
Architectural Diagram
An Analysis Services instance runs as a stand-alone service and communication with the service occurs through
XML for Analysis (XMLA), by using either HTTP or TCP. AMO is a layer between the user application and the
Analysis Services instance. This layer provides access to Analysis Services administrative objects. AMO is a class
library that takes commands from a client application and converts those commands into XMLA messages for the
Analysis Services instance. AMO presents Analysis Services instance objects as classes to the end user application,
with method members that run commands and property members that hold the data for the Analysis Services
objects.
The following illustration shows the Analysis Services components architecture, including all major elements
running within the Analysis Services instance and all user components that interact with the instance. The
illustration also shows that the only way to access the instance is by using the XML for Analysis (XMLA) Listener,
either by using HTTP or TCP.
XMLA Listener
The XMLA listener component handles all XMLA communications between Analysis Services and its clients. The
Analysis Services Port configuration setting in the msmdsrv.ini file can be used to specify a port on which an
Analysis Services instance listens. A value of 0 in this file indicates that Analysis Services listen on the default port.
Unless otherwise specified, Analysis Services uses the following default TCP ports:
PORT DESCRIPTION
Dynamically assigned at server startup Named instance of SQL Server Analysis Services.
See Configure the Windows Firewall to Allow Analysis Services Access for more details.
See Also
Object Naming Rules (Analysis Services)
Physical Architecture (Analysis Services - Multidimensional Data)
Logical Architecture (Analysis Services - Multidimensional Data)
Understanding Microsoft OLAP Architecture
11/28/2018 • 2 minutes to read • Edit Online
Logical Architecture
Server Objects (Analysis Services - Multidimensional Data)
Dimension Objects (Analysis Services - Multidimensional Data)
Cube Objects (Analysis Services - Multidimensional Data)
More...
Physical Architecture
OLAP Engine Server Components
Local Cubes (Analysis Services - Multidimensional Data)
More...
Programming Architecture
Developing with Analysis Management Objects (AMO )
Developing with Analysis Services Scripting Language (ASSL )
Developing with ADOMD.NET
International Considerations
Globalization scenarios for Analysis Services
See Also
Technical Reference
Understanding Microsoft OLAP Physical Architecture
5/16/2018 • 2 minutes to read • Edit Online
In This Section
The following topics provide more information about the architecture of an Analysis Services solution.
TOPIC DESCRIPTION
OLAP Engine Server Components Describes the components of an Analysis Services server.
Local Cubes (Analysis Services - Multidimensional Data) Describes how stand-alone cubes are implemented and the
scope of such implementation under an Analysis Services
solution.
Client Architecture Requirements for Analysis Services Describes the client architecture to access data and metadata
Development from an Analysis Services solution.
Analysis Services Personalization Extensions
5/16/2018 • 5 minutes to read • Edit Online
Logical Architecture
The architecture for Analysis Services personalization extensions is based on the managed assembly architecture
and the following four basic elements:
The [PlugInAttribute] custom attribute
When starting the service, Analysis Services loads the required assemblies and determines which classes have the
Microsoft.AnalysisServices.AdomdServer.PlugInAttribute custom attribute.
NOTE
The .NET Framework defines custom attributes as a way to describe your code and affect run-time behavior. For more
information, see the topic, "Attributes Overview," in the .NET Framework Developer's Guide on MSDN.
Infrastructure Foundations
Analysis Services personalization extensions are based on existing components. The following is a summary of
enhancements and improvements that provide the personalization extensions functionality.
Assemblies
The custom attribute, Microsoft.AnalysisServices.AdomdServer.PlugInAttribute, can be added to your custom
assemblies to identify Analysis Services personalization extensions classes.
Changes to the AdomdServer Object Model
The following objects in the Microsoft.AnalysisServices.AdomdServer object model have been enhanced or added
to the model.
New AdomdConnection Class
The Microsoft.AnalysisServices.AdomdServer.AdomdConnection class is new and exposes several personalization
extensions through both properties and events.
Properties
Microsoft.AnalysisServices.AdomdServer.AdomdConnection.SessionID*, a read-only string value
representing the session Id of the current connection.
Microsoft.AnalysisServices.AdomdServer.AdomdConnection.ClientCulture*, a read-only reference to the
client culture associated with current session.
Microsoft.AnalysisServices.AdomdServer.AdomdConnection.User*, a read-only reference to the identity
interface representing the current user.
Events
Microsoft.AnalysisServices.AdomdServer.AdomdConnection.CubeOpened
Microsoft.AnalysisServices.AdomdServer.AdomdConnection.CubeClosing
New Properties in the Context class
The Microsoft.AnalysisServices.AdomdServer.Context class has two new properties:
Microsoft.AnalysisServices.AdomdServer.Context.Server*, a read-only reference to the new server object.
Microsoft.AnalysisServices.AdomdServer.Context.CurrentConnection*, a read-only reference to the new
Microsoft.AnalysisServices.AdomdServer.AdomdConnection object.
New Server class
The Microsoft.AnalysisServices.AdomdServer.Server class is new and exposes several personalization extensions
through both class properties and events.
Properties
Microsoft.AnalysisServices.AdomdServer.Server.Name*, a read-only string value representing the server
name.
Microsoft.AnalysisServices.AdomdServer.Server.Culture*, A read-only reference to the global culture
associated with the server.
Events
Microsoft.AnalysisServices.AdomdServer.Server.SessionOpened
Microsoft.AnalysisServices.AdomdServer.Server.SessionClosing
AdomdCommand class
The Microsoft.AnalysisServices.AdomdServer.AdomdCommand class now supports of the following MDX
commands:
CREATE MEMBER Statement (MDX)
UPDATE MEMBER Statement (MDX)
DROP MEMBER Statement (MDX)
CREATE SET Statement (MDX)
DROP SET Statement (MDX)
CREATE KPI Statement (MDX)
DROP KPI Statement (MDX)
MDX extensions and enhancements
The CREATE MEMBER command is enhanced with the caption property, the display_folder property, and the
associated_measure_group property.
The UPDATE MEMBER command is added to avoid member re-creation when an update is needed with the
consequent loss of precedence in solving calculations. Updates cannot change the scope of the calculated member,
move the calculated member to a different parent, or define a different solveorder.
The CREATE SET command is enhanced with the caption property, the display_folder property, and the new
STATIC | DYNAMIC keyword. Static means that set is evaluated only at creation time. Dynamic means that the
set is evaluated every time that the set is used in a query. The default value is STATIC if a keyword is omitted.
CREATE KPI and DROP KPI commands are added to the MDX syntax. KPIs can be created dynamically from any
MDX script.
Schema Rowsets extensions
On MDSCHEMA_MEMBERS scope column is added. Scope values are as follows:
MDMEMBER_SCOPE_GLOBAL=1, MDMEMBER_SCOPE_SESSION=2.
On MDSCHEMA_SETS set_evaluation_context column is added. Set evaluation context values are as follows:
MDSET_RESOLUTION_STATIC = 1, MDSET_RESOLUTION_DYNAMIC = 2.
On MDSCHEMA_KPIS scope column is added. Scope values are as follows: MDKPI_SCOPE_GLOBAL=1,
MDKPI_SCOPE_SESSION=2.
Accessing Query Context in Stored Procedures
5/16/2018 • 2 minutes to read • Edit Online
The Context object exists when the Multidimensional Expressions (MDX) object model is used in a stored
procedure. It is not available when the MDX object model is used on a client. The Context object is not explicitly
passed to or returned by the stored procedure. It is available during the execution of the stored procedure.
See Also
Multidimensional Model Assemblies Management
Defining Stored Procedures
Calling Stored Procedures
5/16/2018 • 2 minutes to read • Edit Online
MyStoredProcedure()
If the stored procedure takes one or more parameters, then the parameters are supplied, in order, separated by
commas. The following example demonstrates a sample stored procedure with three parameters:
MyStoredProcedure("Parameter1", 2, 800)
Returning a Member
The following example shows a function MySproc function that returns a member:
Call MyStoredProcedure(a,b,c)
The only supported type returned from stored procedure in a Call statement is a rowset. The serialization for a
rowset is defined by XML for Analysis. If a stored procedure in a Call statement returns any other type, it is
ignored and not returned in XML to the calling application. For more information about XML for Analysis rowsets,
see, XML for Analysis Schema Rowsets.
If a stored procedure returns a .NET rowset, Analysis Services converts the result on the server to an XML for
Analysis rowset. The XML for Analysis rowset is always returned by a stored procedure in the Call function. If a
dataset contains features that cannot be expressed in the XML for Analysis rowset, a failure results.
Procedures that return void values (for example, subroutines in Visual Basic) can also be employed with the CALL
keyword. If, for example, you wanted to use the function MyVoidFunction() in an MDX statement, the following
syntax would be employed:
CALL(MyVoidFunction)
See Also
Multidimensional Model Assemblies Management
Defining Stored Procedures
Creating Stored Procedures
11/28/2018 • 4 minutes to read • Edit Online
IMPORTANT
COM assemblies might pose a security risk. Due to this risk and other considerations, COM assemblies were deprecated in
SQL Server 2008 Analysis Services (SSAS). COM assemblies might not be supported in future releases.
See Also
Multidimensional Model Assemblies Management
Defining Stored Procedures
Debugging Stored Procedures
5/16/2018 • 2 minutes to read • Edit Online
See Also
Multidimensional Model Assemblies Management
Defining Stored Procedures
Defining Stored Procedures
5/16/2018 • 2 minutes to read • Edit Online
TOPIC DESCRIPTION
Designing Stored Procedures Describes how to design assemblies for use with Analysis
Services.
Creating Stored Procedures Describes how to create assemblies for Analysis Services.
Accessing Query Context in Stored Procedures Describes how to access scope and context information with
assemblies.
Setting Security for Stored Procedures Describes how to configure security for assemblies in Analysis
Services.
See Also
Multidimensional Model Assemblies Management
Designing Stored Procedures
5/16/2018 • 2 minutes to read • Edit Online
Dependent Assemblies
All dependent assemblies must be loaded into an instance of Analysis Services to be found by the common
language runtime (CLR ). Analysis Services stores the dependent assemblies in the same folder as the main
assembly, so the CLR automatically resolves all function references to functions in those assemblies.
See Also
Multidimensional Model Assemblies Management
Defining Stored Procedures
Setting Security for Stored Procedures
5/16/2018 • 2 minutes to read • Edit Online
See Also
Multidimensional Model Assemblies Management
Defining Stored Procedures
Extending OLAP functionality
5/16/2018 • 2 minutes to read • Edit Online
In This Section
Extending OLAP through personalizations
Analysis Services Personalization Extensions
Defining Stored Procedures
Extending OLAP through personalizations
5/16/2018 • 2 minutes to read • Edit Online
Assemblies
Assemblies enable you to extend the business functionality of MDX and DMX. You build the functionality that you
want into a library, such as a dynamic link library (DLL ), then add the library as an assembly to an instance of
Analysis Services or to an Analysis Services database. The public methods in the library are then exposed as user-
defined functions to MDX and DMX expressions, procedures, calculations, actions, and client applications.
Personalized Extensions
SQL Server Analysis Services personalization extensions are the foundation of the idea of implementing a plug-in
architecture. Analysis Services personalization extensions are a simple and elegant modification to the existing
managed assembly architecture and are exposed throughout the Analysis Services
Microsoft.AnalysisServices.AdomdServer object model, Multidimensional Expressions (MDX) syntax, and schema
rowsets.
See Also
Multidimensional Model Assemblies Management
Analysis Services Personalization Extensions
Multidimensional Model Data Access (Analysis
Services - Multidimensional Data)
12/6/2018 • 6 minutes to read • Edit Online
Client Applications
Although Analysis Services provides interfaces that let you build or integrate multidimensional databases
programmatically, a more common approach is to use existing client applications from Microsoft and other
software vendors that have built-in data access to Analysis Services data.
The following Microsoft applications support native connections to multidimensional data.
Excel
Analysis Services multidimensional data is often presented using pivot tables and pivot chart controls in an Excel
workbook. PivotTables are suited to multidimensional data because the hierarchies, aggregations, and navigational
constructs in the model pair well with the data summary features of a PivotTable. An Analysis Services OLE DB
data provider is included in an Excel installation to make setting up data connections easier. For more information,
see Connect to or import data from SQL Server Analysis Services.
Reporting Services Reports
You can use Report Builder or Report Designer to create reports that consume Analysis Services databases that
contain analytical data. Both Report Builder and Report Designer include an MDX query designer that you can use
to type or design MDX statements that retrieve data from an available data source. For more information, see Data
Sources Supported by Reporting Services (SSRS ) and Analysis Services Connection Type for MDX (SSRS ).
PerformancePoint Dashboards
PerformancePoint Dashboards are used to create scorecards in SharePoint that communicate business
performance against predefined measures. PerformancePoint includes support for data connections to Analysis
Services multidimensional data. For more information, Create an Analysis Services data connection
(PerformancePoint Services).
SQL Server Data Tools
Model and report designers use SQL Server Data Tools to build solutions that include multidimensional models.
Deploying the solution to an Analysis Services instance is what creates the database that you subsequently
connect to from Excel, Reporting Services, and other business intelligence client applications.
SQL Server Data Tools is built on a Visual Studio shell and uses projects to organize and contain the model. For
more information, see Creating Multidimensional Models Using SQL Server Data Tools (SSDT).
SQL Server Management Studio
For database administrators, SQL Server Management Studio is an integrated environment for managing your
SQL Server instances, including instances of Analysis Services and multidimensional databases. For more
information, see SQL Server Management Studio and Connect to Analysis Services.
Query Languages
MDX is an industry standard query and calculation language used to retrieve data from OLAP databases. In
Analysis Services, MDX is the query language used to retrieve data, but also supports data definition and data
manipulation. MDX editors are built into SQL Server Management Studio, Reporting Services, and SQL Server
Data Tools. You can use the MDX editors to create ad hoc queries or reusable script if the data operation is
repeatable.
Some tools and applications, such as Excel, use MDX constructs internally to query an Analysis Services data
source. You can also use MDX programmatically, by enclosing MDX statement in an XMLA Execute request.
The following links provide more information about MDX:
Querying Multidimensional Data with MDX
Key Concepts in MDX (Analysis Services)
MDX Query Fundamentals (Analysis Services)
MDX Scripting Fundamentals (Analysis Services)
Programmatic Interfaces
If you are building a custom application that uses multidimensional data, your approach for accessing the data will
most likely fall into one of the following categories:
XMLA. Use XMLA when you require compatibility with a wide variety of operating systems and protocols.
XMLA offers the greatest flexibility, but often at the cost of improved performance and ease of
programming.
Client libraries. Use Analysis Services client libraries, such as ADOMD.NET, AMO, and OLE DB when you
want to access data programmatically from client applications that run on a Microsoft Windows operating
system. The client libraries wrap XMLA with an object model and optimizations that provide better
performance.
ADOMD.NET and AMO client libraries are for applications written in managed code. Use OLE DB for
Analysis Services if your application is written in native code.
The following table provides additional detail and links about the client libraries used for connecting Analysis
Services to a custom application.
INTERFACE DESCRIPTION
Analysis Services Management Objects (AMO) AMO is the primary object model for administering Analysis
Services instances and multidimensional databases in code.
For example, SQL Server Management Studio uses AMO to
support server and database administration. For more
information, see Developing with Analysis Management
Objects (AMO).
INTERFACE DESCRIPTION
Analysis Services OLE DB Provider (MSOLAP.dll) You can use the native OLE DB provider to access Analysis
Services programmatically from a non-managed API. For more
information, see Analysis Services OLE DB Provider (Analysis
Services - Multidimensional Data).
Schema Rowsets Schema rowset tables are data structures that contain
descriptive information about a multidimensional model that
is deployed on the server, as well as information about current
activity on the server. As a programmer, you can query
schema rowset tables in client applications to examine
metadata stored on, and retrieve support and monitoring
information from, an Analysis Services instance. You can use
schema rowsets with these programmatic interfaces: OLE DB,
OLE DB for Analysis Services, OLE DB for Data Mining, or
XMLA. For more information, see Analysis Services Schema
Rowsets.
Analysis Services Scripting Language (ASSL) ASSL is a descriptive term that applies to Analysis Services
extensions of the XMLA protocol. Whereas the Execute and
Discover methods are described by the XMLA protocol, ASSL
adds the following capability:
-XMLA script
-XMLA commands
See Also
Connect to Analysis Services
Developing with Analysis Services Scripting Language (ASSL )
Developing with XMLA in Analysis Services
Querying Multidimensional Data with MDX
5/16/2018 • 2 minutes to read • Edit Online
In This Section
TOPIC DESCRIPTION
Key Concepts in MDX (Analysis Services) You can use Multidimensional Expressions (MDX) to query
multidimensional data or to create MDX expressions for use
within a cube, but first you should understand SQL Server
Analysis Services dimension concepts and terminology.
MDX Query Fundamentals (Analysis Services) Multidimensional Expressions (MDX) enables you to query
multidimensional objects, such as cubes, and return
multidimensional cellsets that contain the cube's data. This
topic and its subtopics provide an overview of MDX queries.
MDX Scripting Fundamentals (Analysis Services) In SQL Server Analysis Services, a Multidimensional
Expressions (MDX) script is made up of one or more MDX
expressions or statements that populate a cube with
calculations.
To create MDX scripts, you can use Cube Designer in the SQL
Server Data Tools (SSDT).
See Also
MDX Syntax Elements (MDX)
MDX Language Reference (MDX)
Key Concepts in MDX (Analysis Services)
11/28/2018 • 10 minutes to read • Edit Online
NOTE
One aspect of data modeling is to formalize the patterns and relationships that already exist within the data itself. When
working with data that falls into a natural hierarchy, as is the case with countries-regions-cities, you can formalize that
relationship by creating an attribute relationship. An attribute relationship is a one-to-many relationship between
attributes, for example a relationship between a state and a city - a state has many cities, but a city belongs to just one
state. Creating attribute relationships in the model speeds up query performance, so it's a best practice to create them if
the data supports it. You can create an attribute relationship in Dimension Designer in SQL Server Data Tools. See Define
Attribute Relationships.
Inside Excel, model metadata shows up in the PivotTable field list. Compare the PivotTable above to the field list
below. Notice that the field list contains Sales Territory, Group, Country, Region (metadata), whereas the
PivotTable contains just the members (data values). Knowing what the icons look like can help you easily relate
the parts of a multidimensional model to a PivotTable in Excel.
Attribute Hierarchies
Almost without having to think about it, you know that values in a PivotTable go up or down as you expand and
collapse the levels along each axis, but what makes this so? The answer lies in attribute hierarchies.
Collapse all the levels and notice the grand totals for each Country Group and Calendar Year. This value is
derived from something called the (All) member within a hierarchy. The (All) member is the calculated value of
all members in an attribute hierarchy.
The (All) member for all Country Groups and Dates combined is $80,450,596.98
The (All) member for CY2008 is $16,038,062.60
The (All) member for Pacific is $1,594,335.38
Aggregations like this are pre-computed and stored in advance, which is part of the secret to fast query
performance of Analysis Services.
Expand the hierarchy, and eventually you get to the lowest level. This is called the leaf member. A leaf member
is a member of a hierarchy that has no children. In this example, Australia is the leaf member.
NOTE
BI developers often set properties on the attribute hierarchy to achieve certain behaviors in client applications, or gain
certain performance benefits. For example, you would set AttributeHierarchyEnabled=False on attributes for which the (All)
member doesn't make sense. Alternatively, perhaps you simply want to hide the (All) member, in which case you would set
AttributeHierarchyVisible=False. See Dimension Attribute Properties Reference for more details about properties.
Navigation Hierarchies
Within the PivotTable (at least in this example), row and column axes expand to show lower levels of attributes.
An expandable tree is achieved through navigation hierarchies that you create in a model. In the
AdventureWorks sample model, the Sales Territory dimension has a multi-level hierarchy that begins with a
Country Group, followed by Country, followed by Region.
As you can see, hierarchies are used to provide a navigation path in a PivotTable or other data summarization
objects. There are two basic types: balanced and unbalanced.
Balanced Hierarchies
Unbalanced Hierarchies
Key Attributes
Models are a collection of related objects that rely on keys and indexes to make the associations. Analysis
Services models are no different. For each dimension (recall it is equivalent to a table in a relational model),
there is a key attribute. The key attribute is used in foreign key relationships to the fact table (measure group).
All non-key attributes in the dimension are linked (directly or indirectly) to the key attribute.
Often, but not always, the key attribute is also the Granularity Attribute. Granularity refers to the level of detail
or precision within the data. Again, a common example offers the quickest path to understanding. Consider date
values: For daily sales, you need date values specified to the day; for quotas, quarterly might be sufficient, but if
your analytical data consists of race results from a sporting event, the grain might very well need to be
milliseconds. The level of precision in your data values is the grain.
Currency is another example: a financial application might track monetary values out to many decimal places,
whereas your local school's fund raiser might only need values to the nearest dollar. Understanding grain is
important because you want to avoid storing unnecessary data. Trimming milliseconds from a timestamp, or
pennies from a sales amount, can save storage and processing time when that level of detail is not relevant to
your analysis.
To set the granularity attribute, use the Dimension Usage tab in Cube Designer in SQL Server Data Tools. In the
AdventureWorks sample model, the key attribute of the Date dimension is the Date key. For Sales Orders, the
granularity attribute is equivalent to the key attribute. For Sales Targets, the level of granularity is quarterly, and
so the granularity attribute is set to Calendar Quarter, accordingly.
NOTE
If the granularity attribute and the key attribute are different, all non-key attributes must be linked, directly or indirectly, to
the granularity attribute. Within a cube, the granularity attribute defines a dimension's granularity.
Next Steps
Now that you have a grasp of important concepts and terminology, you can continue on to these additional
topics that further explain fundamental concepts in Analysis Services:
The Basic MDX Query (MDX)
The Basic MDX Script (MDX)
Multidimensional Modeling (Adventure Works Tutorial)
See Also
Cube Space
Tuples
Autoexists
Working with Members, Tuples, and Sets (MDX)
Visual Totals and Non Visual Totals
MDX Query Fundamentals (Analysis Services)
MDX Scripting Fundamentals (Analysis Services)
MDX Language Reference (MDX)
Multidimensional Expressions (MDX) Reference
Autoexists
10/26/2018 • 8 minutes to read • Edit Online
Cell Existence
The following cells always exist:
The (All) member, of every hierarchy, when crossed with members of other hierarchies in the same
dimension.
Calculated members when crossed with their non-calculated siblings, or with the parents or descendants of
their non-calculated siblings.
When you execute the previous query, the cell at the intersection of Aaron A. Allen and Female displays a null.
Similarly, the cell at the intersection of Abigail Clark and Male displays a null. These cells do not exist and cannot
contain a value, but cells that do not exist can appear in the result returned by a query.
When you use the Crossjoin (MDX) function to return the cross-product of attribute hierarchy members from
attribute hierarchies in the same dimension, auto-exists limits those tuples being returned to the set of tuples that
actually exist, rather than returning a full Cartesian product. For example, run and then examine the results from
the execution of the following query.
SELECT CROSSJOIN
(
{[Customer].[Country].[United States]},
[Customer].[State-Province].Members
) ON 0
FROM [Adventure Works]
WHERE Measures.[Internet Sales Amount]
NOTE
Notice that 0 is used to designate the column axis, which is shorthand for axis(0) - which is the column axis.
The previous query only returns cells for members from each attribute hierarchy in the query that exist with each
other. The previous query can also be written using the new * variant of the * (Crossjoin) (MDX) function.
SELECT
[Customer].[Country].[United States] *
[Customer].[State-Province].Members
ON 0
FROM [Adventure Works]
WHERE Measures.[Internet Sales Amount]
SELECT [Customer].[State-Province].Members
ON 0
FROM [Adventure Works]
WHERE (Measures.[Internet Sales Amount],
[Customer].[Country].[United States])
The cells values returned will be identical, although the metadata in the result set will be different. For example,
with the previous query, the Country hierarchy was moved to the slicer axis (in the WHERE clause) and therefore
does not appear explicitly in the result set.
Each of these three previous queries demonstrates the effect of the auto-exists behavior in SQL Server Analysis
Services.
{[Product].[Model Name].&[Mountain-200],
[Product].[Model Name].&[Road-250],
[Product].[Model Name].&[Mountain-100],
[Product].[Model Name].&[Road-650],
[Product].[Model Name].&[Touring-1000],
[Product].[Model Name].&[Road-550-W],
[Product].[Model Name].&[Road-350-W],
[Product].[Model Name].&[Road-150],
[Product].[Model Name].&[Touring-3000]
}'
Top10SellingProducts on 1
The obtained set of products seems to be the same as Preferred10Products; so, verifying the Preferred10Products
set:
with member [Measures].[PCT Discount] AS '[Measures].[Discount Amount]/[Measures].[Reseller Sales Amount]',
FORMAT_STRING = 'Percent'
{[Product].[Model Name].&[Mountain-200],
[Product].[Model Name].&[Road-250],
[Product].[Model Name].&[Mountain-100],
[Product].[Model Name].&[Road-650],
[Product].[Model Name].&[Touring-1000],
[Product].[Model Name].&[Road-550-W],
[Product].[Model Name].&[Road-350-W],
[Product].[Model Name].&[Road-150],
[Product].[Model Name].&[Touring-3000]
}'
Preferred10Products on 1
As per the following results, both sets (Top10SellingProducts, Preferred10Products) are the same
The following example will illustrate the concept of deep Autoexists. In the example we are filtering
Top10SellingProducts by [Product].[Product Line] attribute for those in [Mountain] group. Note that both
attributes (slicer and axis) belong to the same dimension, [Product].
with member [Measures].[PCT Discount] AS '[Measures].[Discount Amount]/[Measures].[Reseller Sales Amount]',
FORMAT_STRING = 'Percent'
Top10SellingProducts on 1
In the above result set we have seven newcomers to the list of Top10SellingProducts and Mountain-200,
Mountain-100, and HL Mountain Frame have moved to the top of the list. In the previous result set those three
values were interspersed.
This is called Deep Autoexists, because the Top10SellingProducts set is evaluated to meet the slicing conditions of
the query. Deep Autoexists means that all expressions will be evaluated to meet the deepest possible space after
applying the slicer expressions, the sub select expressions in the axis, and so on.
However, one might want to be able to do the analysis over the Top10SellingProducts as equivalent to
Preferred10Products, as in the following example:
with member [Measures].[PCT Discount] AS '[Measures].[Discount Amount]/[Measures].[Reseller Sales Amount]',
FORMAT_STRING = 'Percent'
{[Product].[Model Name].&[Mountain-200],
[Product].[Model Name].&[Road-250],
[Product].[Model Name].&[Mountain-100],
[Product].[Model Name].&[Road-650],
[Product].[Model Name].&[Touring-1000],
[Product].[Model Name].&[Road-550-W],
[Product].[Model Name].&[Road-350-W],
[Product].[Model Name].&[Road-150],
[Product].[Model Name].&[Touring-3000]
}'
Preferred10Products on 1
In the above results, the slicing gives a result that contains only those products from Preferred10Products that are
part of the [Mountain] group in [Product].[Product Line]; as expected, because Preferred10Products is a constant
expression.
This result set is also understood as Shallow Autoexists. This is because the expression is evaluated before the
slicing clause. In the previous example, the expression was a constant expression for illustration purposes in order
to introduce the concept.
Autoexists behavior can be modified at the session level using the Autoexists connection string property. The
following example begins by opening a new session and adding the Autoexists=3 property to the connection
string. You must open a new connection in order to do the example. Once the connection is established with the
Autoexist setting it will remain in effect until that connection is finished.
with member [Measures].[PCT Discount] AS '[Measures].[Discount Amount]/[Measures].[Reseller Sales Amount]',
FORMAT_STRING = 'Percent'
Top10SellingProducts on 1
The following result set now shows the shallow behavior of Autoexists.
Autoexists behavior can be modified by using the AUTOEXISTS=[1|2|3] parameter in the connection string; see
Supported XMLA Properties (XMLA) and ConnectionString for parameter usage.
See Also
Key Concepts in MDX (Analysis Services)
Cube Space
Tuples
Working with Members, Tuples, and Sets (MDX)
Visual Totals and Non Visual Totals
MDX Language Reference (MDX)
Multidimensional Expressions (MDX) Reference
Calculation Context
5/16/2018 • 3 minutes to read • Edit Online
NOTE
When cell coordinates for a particular attribute are specified on both the slicer axis and on another axis, the
coordinates specified in the function may take precedence in determining the members of the set on the axis. The
Filter (MDX) and Order (MDX) functions are examples of such functions - you can filter or order a result by attribute
members that are excluded from the calculation context by the WHERE clause, or by a SELECT statement in the FROM
clause.
3. The named sets and calculated members defined in the query or expression.
4. The tuples and sets specified on the row and column axes, utilizing the default member for attributes that do
not appear on the row, column, or slicer axis.
5. The cube or subcube cells on each axis, eliminating empty tuples on the axis and applying the HAVING
clause.
6. For more information, see Establishing Cube Context in a Query (MDX).
In the following query, the calculation context for the row axis is restricted by the Country attribute member and
the Calendar Year attribute member that are specified in the WHERE clause.
SELECT Customer.City.City.Members ON 0
FROM [Adventure Works]
WHERE (Customer.Country.France, [Date].[Calendar].[Calendar Year].[CY 2004],
Measures.[Internet Sales Amount])
However, if you modify this query by specifying the FILTER function on the row axis, and utilize a Calendar Year
attribute hierarchy member in the FILTER function, then the attribute member from the Calendar Year attribute
hierarchy that is used to provide the calculation context for the members of the set on the column axis can be
modified.
SELECT FILTER
(
Customer.City.City.Members,
([Date].[Calendar].[Calendar Year].[CY 2003],
Measures.[Internet Order Quantity]) > 75
) ON 0
FROM [Adventure Works]
WHERE (Customer.Country.France,
[Date].[Calendar].[Calendar Year].[CY 2004],
Measures.[Internet Sales Amount])
In the previous query, the calculation context for the cells in the tuples that appear on the column axis is filtered by
the CY 2003 member of the Calendar Year attribute hierarchy, even though the nominal calculation context for the
Calendar Year attribute hierarchy is CY 2004. Furthermore, it is filtered by the Internet Order Quantity measure.
However, once the members of the set on the column axis is set, the calculation context for the values for the
members that appear on the axis is again determined by the WHERE clause.
IMPORTANT
To increase query performance, you should eliminate members and tuples as early in the resolution process as possible. In
this manner, complex query time calculations on the final set of members operate on the fewest cells possible.
See Also
Establishing Cube Context in a Query (MDX)
MDX Query Fundamentals (Analysis Services)
Key Concepts in MDX (Analysis Services)
Calculated Members in Subselects and Subcubes
10/26/2018 • 4 minutes to read • Edit Online
Value Description
Using values of 1 or 2 in the SubQueries property allows calculated members to be used to filter the returning
subspace of subselects.
An example will help clarify the concept; first a calculated member must be created and then a subselect query
issued to show the above mentioned behavior.
The following sample creates a calculated member that adds [Seattle Metro] as a city to the [Geography].
[Geography] hierarchy under Washington state.
To run the example, the connection string must contain the SubQueries property with a value of 1 and all MDX
statements must be run in the same session.
IMPORTANT
If you're using Management Studio to test the queries, click the Options button on Connection Manager to access the
additional connection string properties pane, where you can enter subqueries=1 or 2 to allow calculated members in the
subspace.
First issue the following MDX expression:
Then issue the following MDX query to see calculated members allowed in subselects.
As said before, the ascendants of [Seattle Metro] do not exist in the returned subspace, when SubQueries=1, hence
[Geography].[Geography].allmembers only contains the calculated member.
If the example is run using SubQueries=2, in the connection string, the obtained results are:
As said before, when using SubQueries=2, the ascendants of [Seattle Metro] exist in the returned subspace but no
values exist for those members because there is no regular members to provide for the aggregations. Therefore,
NULL values are provided for all ascendant members of the calculated member in this example.
To understand the above behavior, it helps to understand that calculated members do not contribute to the
aggregations of their parents as regular members do; the former implies that filtering by calculated members alone
will lead to empty ascendants because there are no regular members to contribute to the aggregated values of the
resulting subspace. If you add regular members to the filtering expression then the aggregated values will come
from those regular members. Continuing with the above example, if the cities of Portland, in Oregon, and the city
of Spokane, in Washington, are added to the same axis where the calculated member appears; as shown in the next
MDX expression:
In the above results the aggregated values for [All Geographies], [United States], [Oregon] and [Washington] come
from aggregating over the descendants of &[Portland]&[OR ] and &[Spokane]&[WA]. Nothing comes from the
calculated member.
Remarks
Only global or session calculated members are allowed in the subselect or subcube expressions. Having query
calculated members in the MDX expression will raise an error when the subselect or subcube expression is
evaluated.
See Also
ConnectionString
Subselects in Queries
Supported XMLA Properties (XMLA)
Cube Space
5/16/2018 • 5 minutes to read • Edit Online
NOTE
This query uses the Members (Set) (MDX) function to return the set of members of the Gender attribute hierarchy on the
column axis, and crosses this set with the specified set of members from the Customer attribute hierarchy on the row axis.
When you execute the previous query, the cell at the intersection of Aaron A. Allen and Female displays a null.
Similarly, the cell at the intersection of Abigail Clark and Male displays a null. These cells do not exist and cannot
contain a value, but cells that do not exist can appear in the result returned by a query.
When you use the Crossjoin (MDX) function to return the cross-product of attribute hierarchy members from
attribute hierarchies in the same dimension, auto-exists limits those tuples being returned to the set of tuples that
actually exist, rather than returning a full Cartesian product. For example, run and then examine the results from
the execution of the following query.
SELECT CROSSJOIN
(
{[Customer].[Country].[United States]},
[Customer].[State-Province].Members
) ON 0
FROM [Adventure Works]
WHERE Measures.[Internet Sales Amount]
NOTE
Notice that 0 is used to designate the column axis, which is shorthand for axis(0) - which is the column axis.
The previous query only returns cells for members from each attribute hierarchy in the query that exist with each
other. The previous query can also be written using the new * variant of the * (Crossjoin) (MDX) function.
SELECT
[Customer].[Country].[United States] *
[Customer].[State-Province].Members
ON 0
FROM [Adventure Works]
WHERE Measures.[Internet Sales Amount]
SELECT [Customer].[State-Province].Members
ON 0
FROM [Adventure Works]
WHERE (Measures.[Internet Sales Amount],
[Customer].[Country].[United States])
The cells values returned will be identical, although the metadata in the result set will be different. For example,
with the previous query, the Country hierarchy was moved to the slicer axis (in the WHERE clause) and therefore
does not appear explicitly in the result set.
Each of these three previous queries demonstrates the effect of the auto-exists behavior in SQL Server Analysis
Services.
SELECT CROSSJOIN
(
{[Customer].[Country].[United States]},
[Customer].[Customer Geography].[State-Province].Members
)
ON 0
FROM [Adventure Works]
WHERE Measures.[Internet Sales Amount]
In the previous query, the Customer Geography user-defined hierarchy within the Customer dimension is used to
define the position in cube space that was previously defined by using an attribute hierarchy. The identical position
in cube space can be defined by using either attribute hierarchies or user-defined hierarchies.
NOTE
Notice that the WITH keyword is used with the CurrentMember (MDX) and Name (MDX) functions to create a calculated
member for use in the query. For more information, see The Basic MDX Query (MDX).
In the previous query, the name of the member of the Country attribute hierarchy that is associated with each
member of the State attribute hierarchy is returned. The expected Country member appears (because an attribute
relationship is defined between the City and Country attributes). However, if no attribute relationship were defined
between attribute hierarchies in the same dimension, the (All) member would be returned, as illustrated in the
following query.
In the previous query, the (All) member ("All Customers") is returned, because there is no relationship between
Education and City. Therefore, the (All) member of the Education attribute hierarchy would be the default member
of the Education attribute hierarchy used in any tuple involving the City attribute hierarchy where an Education
member is not explicitly provided.
Calculation Context
See Also
Key Concepts in MDX (Analysis Services)
Tuples
Autoexists
Working with Members, Tuples, and Sets (MDX)
Visual Totals and Non Visual Totals
MDX Language Reference (MDX)
Multidimensional Expressions (MDX) Reference
Subselects in Queries
10/26/2018 • 10 minutes to read • Edit Online
Subselects by example
Let's begin with an example of how subselects can help to produce the results we want to show. Assume that you
are requested to produce a table that shows the sales behavior, over years, for the top 10 products.
The result should look like the following table:
Product A
...
To do something like the above one could write the following MDX expression:
Which is very close to what we are looking for; except that the query returned 9 not 10 products and the All
Products total reflects the sum of all products not the sum of the returned Top 9 (in this case). Another attempt to
solve the problem is presented in the following MDX query:
That was very close to the desired result because it only missed the sum of the products. At this point one can start
tweaking the above MDX expression to add the missing line; however, that task could prove to be a cumbersome
one.
Another approach to solve the problem, would be to start thinking in terms of redefining the cube space over
which the MDX expression is resolved. What if the 'new' cube contains only data from the Top 10 products? That
cube then will have the All member adjusted to the Top 10 products only and now a simple query would resolve
our needs.
The following MDX expression uses a subselect statement to redefine the cube space to the Top 10 products and
produce the desired results:
The above results are the Top 10 products sold in France through the Internet channel.
Subselect statement
The BNF for the Subselect is:
The subselect is another Select statement where the axis specifications and the slicer specification filter the space of
the cube over which the outer select is evaluated.
When a member is specified in one of the axis or slicer clause then that member with its ascendants and
descendants are included in the sub cube space for the subselect; all non mentioned sibling members, in the axis or
slicer clause, and their descendants are filtered from the subspace. This way, the space of the outer select has been
limited to the existing members in the axis clause or slicer clause, with their ascendants and descendants as
mentioned before.
Because the All member of all non mentioned dimensions in axis or slicer clauses belongs to the space of the
select; then, all descendants to the All member on those dimensions are, also, part of the subselect space.
The All member, in all dimensions, in the subcube space, is re-evaluated to reflect the impact of the constrains of
the new space.
The following example will show what has been said above; the first MDX expression helps to display the unfiltered
values in the cube, the second MDX illustrates the effect of filtering in the Subselect clause:
In the above example Seattle is a child of Washington, Portland is a child of Oregon, Oregon and Washington are
children of United States and United States is a child of [Customer Geography].[All Customers]. All of the shown
members in this example have other siblings that contribute to the parent aggregate value; i.e. Spokane, Tacoma
and Everett are sibling cities of Seattle and they all contribute to Washington Internet Sales Amount. Reseller Sales
Amount value is independent of Customer Geography attribute; hence the All value is displayed in the results. The
next MDX expression illustrates the filtering effect of the subselect clause:
The results above show that only ascendants and descendants of Washington State are part of the subspace where
the outer select statement was evaluated; Oregon and Portland have been removed from the subcube because
Oregon and all the other sibling states were not mentioned in the subselect when Washington was mentioned.
The All member was adjusted to reflect the filtering on Washington; not only was adjusted in the [Customer
Geography] dimension but in all other dimensions that crossed with [Customer Geography]. All dimensions that
do not cross with [Customer Geography] remain in the subcube unaltered.
The following two MDX statements illustrate how the All member in other dimensions is adjusted to meet the
filtering effect of the subselect. The first query displays the unaltered results and the second shows the impact of
the filtering:
The above results show that All Products values have been adjusted to only values from Washington State, as
expected.
Subselects can be nested with no limit to how deep you can nest subselects, except available memory. The inner
most subselect defines the starting subspace over which filtering is applied and passed onto the next outer select.
An important thing to notice is the fact that nesting is not a commutative operation; so the order in which the
nesting is set my produce different results. The following examples should show the difference when choosing a
nesting order.
As you can see there are differences in the results between both sets. The first query answered the question of
which are the best selling products in the top 5 selling regions, the second query answered the question of where
are the largest sales of the top 5 selling products.
Remarks
Subselects have the following restrictions and limitations:
The WHERE clause does not filter the subspace.
The WHERE clause changes the default member in the sub cube only.
The NON EMPTY clause is not allowed in an axis clause; use a NonEmpty (MDX) function expression
instead.
The HAVING clause is not allowed in an axis clause; use a Filter (MDX) function expression instead.
By default calculated members are not allowed in subselects; however, this restriction can be changed, in a
per session basis, by assigning a value to the SubQueries connection string property in ConnectionString
or DBPROP_MSMD_SUBQUERIES property in Supported XMLA Properties (XMLA). See Calculated
Members in Subselects and Subcubes for a detailed explanation of the behavior of calculated members
depending on the values of SubQueries or DBPROP_MSMD_SUBQUERIES.
Tuples
5/16/2018 • 3 minutes to read • Edit Online
The previous example uniquely identifies the cell consisting of the Reseller Sales Amount member from the
Measures dimension and the default member from every attribute hierarchy in the cube. The default member is
the (All) member for every attribute hierarchy other than the Destination Currency attribute hierarchy. The default
member for the Destination Currency hierarchy is the US Dollar member (this default member is defined in the
MDX script for the Adventure Works cube).
IMPORTANT
The member of an attribute hierarchy in a tuple is also affected by relationships that are defined between attributes within a
dimension.
The following query returns the value for the cell referenced by the tuple specified in the previous example,
($80,450.596.98).
SELECT
Measures.[Reseller Sales Amount] ON COLUMNS
FROM [Adventure Works]
NOTE
When you specify an axis for a set (in this case composed of a single tuple) in a query, you must begin by specifying a set for
the column axis before specifying a set for the row axis. The column axis can also be referred to as axis (0) or simply 0. For
more information about MDX queries, see The Basic MDX Query (MDX).
SELECT
([Measures].[Reseller Sales Amount],[Date].[Calendar Year].[CY 2004]) ON COLUMNS
FROM [Adventure Works]
NOTE
When you explicitly specify a member in a tuple from more than one dimension, you must include the entire tuple in
parentheses. When only specifying a single member in a tuple, parentheses are optional.
The tuple in the query in the previous example specifies the return of the cube cell at the intersection of the
Reseller Sales Amount Measure of the Measures dimension and the CY 2004 member of the Calendar Year
attribute hierarchy in the Date dimension.
NOTE
An attribute member can be referred by either its member name or its member key. In the previous example, you could
replace the reference to [CY 2004] with &[2004].
See Also
Key Concepts in MDX (Analysis Services)
Cube Space
Autoexists
Working with Members, Tuples, and Sets (MDX)
Visual Totals and Non Visual Totals
5/16/2018 • 2 minutes to read • Edit Online
[Business Type].members on 1
[Business Type].members on 1
Non-Visual on rows
To produce a table that visually totals the columns but for row totals brings the true total of all [Category], the
following query should be issued:
select [Category].members on 0,
[Business Type].members on 1
When compared with the previous results, you can observe that the [All Resellers] row now adds up to the
displayed values for [Value Added Reseller] and [Warehouse] but that the [All Products] column shows the total
value for all products, including those not displayed.
See Also
Key Concepts in MDX (Analysis Services)
Autoexists
Working with Members, Tuples, and Sets (MDX)
MDX Query Fundamentals (Analysis Services)
The Basic MDX Query (MDX)
Restricting the Query with Query and Slicer Axes (MDX)
Establishing Cube Context in a Query (MDX)
Working with Members, Tuples, and Sets (MDX)
5/16/2018 • 3 minutes to read • Edit Online
Member Functions
MDX provides several functions for retrieving members from other MDX entities, such as from dimensions,
levels, sets, or tuples. For example, the FirstChild function is a function that acts upon a member and returns a
member.
To obtain the first child member of the Time dimension, you can explicitly state the member, as in the following
example.
You can also use the FirstChild function to return the same member, as in the following example.
For more information about MDX member functions, see MDX Function Reference (MDX).
Tuple Functions
MDX provides several functions that return tuples, and they can be used anywhere that a tuple is accepted. For
example, the Item (Tuple) (MDX) function can be used to extract the first tuple from set, which is very useful
when you know that a set is composed of a single tuple and you want to supply that tuple to a function that
requires a tuple.
The following example returns the first tuple from within the set of tuples on the column axis.
SELECT {
([Measures].[Reseller Sales Amount]
,[Date].[Calendar Year].[CY 2003]
)
, ([Measures].[Reseller Sales Amount]
,[Date].[Calendar Year].[CY 2004]
)
}.Item(0)
ON COLUMNS
FROM [Adventure Works]
For more information about tuple functions, see MDX Function Reference (MDX).
Set Functions
MDX provides several functions that return sets. Explicitly typing tuples and enclosing them in braces is not the
only way to retrieve a set. For more information about the members function to return a set, see Key Concepts in
MDX (Analysis Services). There are many additional set functions.
The colon operator lets you use the natural order of members to create a set. For example, the set shown in the
following example contains tuples for the 1st through the 4th quarter of calendar year 2002.
SELECT
{[Calendar Quarter].[Q1 CY 2002]:[Calendar Quarter].[Q4 CY 2002]}
ON 0
FROM [Adventure Works]
If you do not use the colon operator to create the set, you can create the same set of members by specifying the
tuples in the following example.
SELECT {
[Calendar Quarter].[Q1 CY 2002],
[Calendar Quarter].[Q2 CY 2002],
[Calendar Quarter].[Q3 CY 2002],
[Calendar Quarter].[Q4 CY 2002]
} ON 0
FROM [Adventure Works]
The colon operator is an inclusive function. The members on both sides of the colon operator are included in the
resulting set.
For more information about set functions, see MDX Function Reference (MDX).
Array Functions
An array function acts upon a set and returns an array. For more information about array functions, see MDX
Function Reference (MDX).
Hierarchy Functions
A hierarchy function returns a hierarchy by acting upon a member, level, hierarchy, or string. For more
information about hierarchy functions, see MDX Function Reference (MDX).
Level Functions
A level function returns a level by acting upon a member, level, or string. For more information about level
functions, see MDX Function Reference (MDX).
Logical Functions
A logical function acts upon a MDX expression to return information about the tuples, members, or sets in the
expression. For example, the IsEmpty (MDX) function evaluates whether an expression has returned an empty
cell value. For more information about logical functions, see MDX Function Reference (MDX).
Numeric Functions
A numeric function acts upon a MDX expression to return a scalar value. For example, the Aggregate (MDX)
function returns a scalar value calculated by aggregating measures over the tuples in a specified set. For more
information about numeric functions, see MDX Function Reference (MDX).
String Functions
A string function acts upon a MDX expression to return a string. For example, the UniqueName (MDX) function
returns a string value containing the unique name of a dimension, hierarchy, level, or member. For more
information about string functions, see MDX Function Reference (MDX).
See Also
Key Concepts in MDX (Analysis Services)
MDX Query Fundamentals (Analysis Services)
MDX Function Reference (MDX)
MDX Query Fundamentals (Analysis Services)
12/6/2018 • 2 minutes to read • Edit Online
In This Section
TOPIC DESCRIPTION
The Basic MDX Query (MDX) Provides basic syntax information for the MDX SELECT
statement.
Restricting the Query with Query and Slicer Axis (MDX) Describes what query and slicer axes are and how to specify
them.
Establishing Cube Context in a Query (MDX) Provides a description of the purpose of the FROM clause in
an MDX SELECT statement.
Building Named Sets in MDX (MDX) Describes the purpose of named sets in MDX, and the
techniques needed to create and use them in MDX queries.
Building Calculated Members in MDX (MDX) Provides information about calculated members in MDX,
including the techniques needed to create and use them in
MDX expressions.
Building Cell Calculations in MDX (MDX) Details the process of creating and using calculated cells.
Creating and Using Property Values (MDX) Details the process of creating and using dimension, level,
member, and cell properties.
Manipulating Data (MDX) Describes the basics behind manipulating data using
drillthrough and rollup, and also describes pass order and
solve order in MDX.
Using Variables and Parameters (MDX) Describes how to use variables and parameters within MDX
queries.
See Also
Multidimensional Expressions (MDX) Reference
MDX Query - The Basic Query
11/28/2018 • 4 minutes to read • Edit Online
NOTE
For more detailed information about the various clauses of the SELECT statement, see SELECT Statement (MDX).
The MDX SELECT statement supports optional syntax, such as the WITH keyword, the use of MDX functions to
create calculated members for inclusion in an axis or slicer axis, and the ability to return the values of specific cell
properties as part of the query. For more information about the MDX SELECT statement, see SELECT Statement
(MDX).
Comparing the Syntax of the MDX SELECT Statement to SQL
The syntax format for the MDX SELECT statement is similar to that of SQL syntax. However, there are several
fundamental differences:
MDX syntax distinguishes sets by surrounding tuples or members with braces (the { and } characters.) For
more information about member, tuple, and set syntax, see Working with Members, Tuples, and Sets
(MDX).
MDX queries can have 0, 1, 2 or up to 128 query axes in the SELECT statement. Each axis behaves in
exactly the same way, unlike SQL where there are significant differences between how the rows and the
columns of a query behave.
As with an SQL query, the FROM clause names the source of the data for the MDX query. However, the
MDX FROM clause is restricted to a single cube. Information from other cubes can be retrieved on a value-
by-value basis by using the LookupCube function.
The WHERE clause describes the slicer axis in an MDX query. It acts as something like an invisible, extra
axis in the query, slicing the values that appear in the cells in the result set; unlike the SQL WHERE clause it
does not directly affect what appears on the rows axis of the query. The functionality of the SQL WHERE
clause is available through other MDX functions such as the FILTER function.
SELECT
{ [Measures].[Sales Amount],
[Measures].[Tax Amount] } ON COLUMNS,
{ [Date].[Fiscal].[Fiscal Year].&[2002],
[Date].[Fiscal].[Fiscal Year].&[2003] } ON ROWS
FROM [Adventure Works]
WHERE ( [Sales Territory].[Southwest] )
In this example, the query defines the following result set information:
The SELECT clause sets the query axes as the Sales Amount and Tax Amount members of the Measures
dimension, and the 2002 and 2003 members of the Date dimension.
The FROM clause indicates that the data source is the Adventure Works cube.
The WHERE clause defines the slicer axis as the Southwest member of the Sales Territory dimension.
Notice that the query example also uses the COLUMNS and ROWS axis aliases. The ordinal positions for these
axes could also have been used. The following example shows how the MDX query could have been written to
use the ordinal position of each axis:
SELECT
{ [Measures].[Sales Amount],
[Measures].[Tax Amount] } ON 0,
{ [Date].[Fiscal].[Fiscal Year].&[2002],
[Date].[Fiscal].[Fiscal Year].&[2003] } ON 1
FROM [Adventure Works]
WHERE ( [Sales Territory].[Southwest] )
For more detailed examples, see Specifying the Contents of a Query Axis (MDX)and Specifying the Contents of a
Slicer Axis (MDX).
See Also
Key Concepts in MDX (Analysis Services)
SELECT Statement (MDX)
MDX Query - EXISTING Keyword
10/9/2018 • 2 minutes to read • Edit Online
Syntax
Existing Set_Expression
Arguments
Set_Expression
A valid Multidimensional Expressions (MDX) set expression.
Remarks
By default, sets are evaluated within the context of the cube that contains the members of the set. The Existing
keyword forces a specified set to be evaluated within the current context instead.
Example
The following example returns the count of the resellers whose sales have declined over the previous time period,
based on user-selected State-Province member values evaluated using the Aggregate function. The Hierarchize
(MDX) and DrilldownLevel (MDX) functions are used to return values for declining sales for product categories in
the Product dimension. The Existing keyword forces the set in the Filter function to be evaluated in the current
context - that is, for the Washington and Oregon members of the State-Province attribute hierarchy.
WITH MEMBER Measures.[Declining Reseller Sales] AS
Count
(Filter
(Existing
(Reseller.Reseller.Reseller)
, [Measures].[Reseller Sales Amount] <
([Measures].[Reseller Sales Amount]
,[Date].Calendar.PrevMember
)
)
)
MEMBER [Geography].[State-Province].x AS
Aggregate
( {[Geography].[State-Province].&[WA]&[US]
, [Geography].[State-Province].&[OR]&[US] }
)
SELECT NON EMPTY HIERARCHIZE
(AddCalculatedMembers
(
{DrillDownLevel
({[Product].[All Products]}
)
}
)
) DIMENSION PROPERTIES PARENT_UNIQUE_NAME ON COLUMNS
FROM [Adventure Works]
WHERE
( [Geography].[State-Province].x
, [Date].[Calendar].[Calendar Quarter].&[2003]&[4]
,[Measures].[Declining Reseller Sales]
)
See Also
Count (Set) (MDX)
AddCalculatedMembers (MDX)
Aggregate (MDX)
Filter (MDX)
Properties (MDX)
DrilldownLevel (MDX)
Hierarchize (MDX)
MDX Function Reference (MDX)
MDX Query and Slicer Axes - Restricting the Query
11/28/2018 • 2 minutes to read • Edit Online
See Also
Working with Members, Tuples, and Sets (MDX)
MDX Query Fundamentals (Analysis Services)
MDX Query and Slicer Axes - Specify the Contents
of a Query Axis
11/27/2018 • 3 minutes to read • Edit Online
Each query axis has a number: zero (0) for the x-axis, 1 for the y-axis, 2 for the z-axis, and so on. In the syntax for
the <SELECT query axis clause> , the Integer_Expression value specifies the axis number. An MDX query can
support up to 128 specified axes, but very few MDX queries will use more than 5 axes. For the first 5 axes, the
aliases COLUMNS, ROWS, PAGES, SECTIONS, and CHAPTERS can instead be used.
An MDX query cannot skip query axes. That is, a query that includes one or more query axes must not exclude
lower-numbered or intermediate axes. For example, a query cannot have a ROWS axis without a COLUMNS axis,
or have COLUMNS and PAGES axes without a ROWS axis.
However, you can specify a SELECT clause without any axes (that is, an empty SELECT clause). In this case, all
dimensions are slicer dimensions, and the MDX query selects one cell.
In the query axis syntax previously shown, each Set_Expression value specifies the set that defines the contents of
the query axis. For more information about sets, see Working with Members, Tuples, and Sets (MDX).
Examples
The following simple SELECT statement returns the measure Internet Sales Amount on the Columns axis, and
uses the MDX MEMBERS function to return all the members from the Calendar hierarchy on the Date dimension
on the Rows axis:
SELECT {[Measures].[Internet Sales Amount]} ON COLUMNS,
{[Date].[Calendar].MEMBERS} ON ROWS
FROM [Adventure Works]
The two following queries return exactly the same results but demonstrate the use of axis numbers rather than
aliases:
The NON EMPTY keyword, used before the set definition, is an easy way to remove all empty tuples from an axis.
For example, in the examples we've seen so far there is no data in the cube from August 2004 onwards. To remove
all rows from the cellset that have no data in any column, simply add NON EMPTY before the set on the Rows
axis definition as follows:
NON EMPTY can be used on all axes in a query. Compare the results of the following two queries, the first of
which does not use NON EMPTY and the second of which does on both axes:
The HAVING clause can be used to filter the contents of an axis based on a specific criteria; it is less flexible than
other methods that can achieve the same results, such as the FILTER function, but it is simpler to use. Here is an
example that returns only those dates where Internet Sales Amount is greater than $15,000:
SELECT {[Measures].[Internet Sales Amount]}
ON COLUMNS,
NON EMPTY
{[Date].[Calendar].[Date].MEMBERS}
HAVING [Measures].[Internet Sales Amount]>15000
ON ROWS
FROM [Adventure Works]
See Also
Specifying the Contents of a Slicer Axis (MDX)
MDX Query and Slicer Axes - Specify the Contents
of a Slicer Axis
5/16/2018 • 2 minutes to read • Edit Online
In the slicer axis syntax shown, Set_Expression can take either a tuple expression, which is treated as a set for the
purposes of evaluating the clause, or a set expression. If a set expression is specified, MDX will try to evaluate the
set, aggregating the result cells in every tuple along the set. In other words, MDX will try to use the Aggregate
function on the set, aggregating each measure by its associated aggregation function. Also, if the set expression
cannot be expressed as a crossjoin of attribute hierarchy members, MDX treats cells that fall outside of the set
expression for the slicer as null for evaluation purposes.
IMPORTANT
Unlike the WHERE clause in SQL, the WHERE clause of an MDX SELECT statement never directly filters what is returned on
the Rows axis of a query. To filter what appears on the Rows or Columns axis of a query, you can use a variety of MDX
functions, for example FILTER, NONEMPTY and TOPCOUNT.
Examples
The following query does not include a WHERE clause, and returns the value of the Internet Sales Amount
measure for all Calendar Years:
does not change what is returned on Rows or Columns in the query; it changes the values returned for each cell.
In this example, the query is sliced so that it returns the value of Internet Sales Amount for all Calendar Years but
only for Customers who live in the United States.Multiple members from different hierarchies can be added to the
WHERE clause. The following query shows the value of Internet Sales Amount for all Calendar Years for
Customers who live in the United States and who bought Products in the Category Bikes:
If you want to use multiple members from the same hierarchy, you need to include a set in the WHERE clause. For
example, the following query shows the value of Internet Sales Amount for all Calendar Years for Customers who
bought Products in the Category Bikes and live in either the United States or the United Kingdom:
As mentioned above, using a set in the WHERE clause will implicitly aggregate values for all members in the set.
In this case, the query shows aggregated values for the United States and the United Kingdom in each cell.
MDX Query and Slicer Axes - Using Axes in a Simple
Example
5/16/2018 • 2 minutes to read • Edit Online
The Cube
A cube, named TestCube, has two simple dimensions named Route and Time. Each dimension has only one user
hierarchy, named Route and Time respectively. Because the measures of the cube are part of the Measures
dimension, this cube has three dimensions in all.
The Query
The query is to provide a matrix in which the Packages measure can be compared across routes and times.
In the following MDX query example, the Route and Time hierarchies are the query axes, and the Measures
dimension is the slicer axis. The Members function indicates that MDX will use the members of the hierarchy or
level to construct a set. The use of the Members function means that you do not have to explicitly state each
member of a specific hierarchy or level in an MDX query.
SELECT
{ Route.nonground.Members } ON COLUMNS,
{ Time.[1st half].Members } ON ROWS
FROM TestCube
WHERE ( [Measures].[Packages] )
The Results
The result is a grid that identifies the value of the Packages measure at each intersection of the COLUMNS and
ROWS axis dimensions. The following table shows how this grid would look.
AIR SEA
1st quarter 60 50
2nd quarter 45 45
See Also
Specifying the Contents of a Query Axis (MDX)
Specifying the Contents of a Slicer Axis (MDX)
Establishing Cube Context in a Query (MDX)
5/16/2018 • 2 minutes to read • Edit Online
NOTE
The SCOPE and CALCULATE statements also let you manage cube context from within an MDX script. For more
information, see MDX Scripting Fundamentals (Analysis Services).
In this syntax, notice that it is the <SELECT subcube clause> clause that describes the cube or subcube on which the
SELECT statement is executed.
A simple example of a FROM clause would be one that runs against the entire Adventure Works sample cube.
Such a FROM clause would have the following format:
For more information about the FROM clause in the MDX SELECT statement, see SELECT Statement (MDX).
See Also
MDX Query Fundamentals (Analysis Services)
Building Subcubes in MDX (MDX)
11/27/2018 • 2 minutes to read • Edit Online
The CREATE SUBCUBE syntax is fairly simple. The Subcube_Identifier parameter identifies the cube on which the
subcube will be based. The Subcube_Expression parameter selects the part of the cube that will become the
subcube
After you create a subcube, that subcube becomes the context for all MDX queries until either the session closes or
you run the DROP SUBCUBE statement.
What a Subcube Contains
Although the CREATE SUBCUBE statement is fairly simple to use, the statement itself does not explicitly show all
the members that become part of a subcube. In defining a subcube, the following rules apply:
If you include the (All) member of a hierarchy, you include every member of that hierarchy.
If you include any member, you include that member's ascendants and descendants.
If you include every member from a level, you include all members from the hierarchy. Members from other
hierarchies will be excluded if those members do not exist with members from the level (for example, an
unbalanced hierarchy such as a city that does not contain customers).
A subcube will always contain every (All) member from the cube.
Additionally, aggregate values within the subcube are visually totaled. For example, a subcube contains USA , WA ,
and OR . The aggregate value for USA will be the sum of {WA,OR} because WA and OR are the only states defined
by the subcube. All other states will be ignored.
Also, explicit references to cells outside the subcube return cell values that are evaluated in the context of the whole
cube. For example, you create a subcube that is limited to the current year. You then use the ParallelPeriod function
to compare the current year to the previous year. The difference in values will be returned even though the
previous year's value lies outside the subcube.
Finally, if the original context is not overwritten, set functions evaluated in a subselect are evaluated in the context
of the subselect. If the context is overwritten, set functions are evaluated in the context of the whole cube.
Having created a subcube for the session, any subsequent queries will be against the subcube, not the whole cube.
For example, you run the following query. This query will only return members from accounts 4200 and 4300.
SELECT [Account].[Account].Members ON 0, Measures.Members ON 1 FROM Budget
See Also
Establishing Cube Context in a Query (MDX)
MDX Query Fundamentals (Analysis Services)
MDX Named Sets - Building Named Sets
5/16/2018 • 2 minutes to read • Edit Online
See Also
SELECT Statement (MDX)
CREATE SET Statement (MDX)
MDX Query Fundamentals (Analysis Services)
MDX Named Sets - Creating Query-Scoped Named
Sets
5/16/2018 • 2 minutes to read • Edit Online
NOTE
For more information about named sets, see Building Named Sets in MDX (MDX).
In the syntax for the WITH keyword, the Set_Identifier parameter contains the alias for the named set. The
Set_Expression parameter contains the set expression to which the named set alias refers.
To make the previous MDX query easier to maintain, you can create a named set for the query by using the WITH
keyword. The following code shows how to use the WITH keyword to create a named set, [ChardonnayChablis] ,
and how the named set makes the SELECT statement shorter and easier to maintain.
SELECT
[ChardonnayChablis] ON COLUMNS,
{Measures.[Unit Sales]} ON ROWS
FROM Sales
SELECT
[ChardonnayChablis] ON COLUMNS,
{Measures.[Unit Sales]} ON ROWS
FROM Sales
See Also
SELECT Statement (MDX)
Creating Session-Scoped Named Sets (MDX)
MDX Named Sets - Creating Session-Scoped Named
Sets
5/16/2018 • 2 minutes to read • Edit Online
NOTE
For more information about named sets, see Building Named Sets in MDX (MDX).
In the CREATE SET syntax, the cube name parameter contains the name of the cube that contains the members for
the named set. If the cube name parameter is not specified, the current cube will be used as the cube that contains
the member for the named set. Also, the Set_Identifier parameter contains the alias for the named set, and the
Set_Expression parameter contains the set expression to which the named set alias will refer.
By using the CREATE SET statement to define the SetCities_2_3 named set, this named set remains available for
the length of the current MDX session. The following example is a valid query that would return City 2 and City 3
members, and that could be run anytime after you create the SetCities_2_3 named set and before the session
closes.
See Also
Creating Query-Scoped Named Sets (MDX)
MDX Calculated Members - Building Calculated
Members
5/16/2018 • 2 minutes to read • Edit Online
See Also
CREATE MEMBER Statement (MDX)
MDX Function Reference (MDX)
SELECT Statement (MDX)
MDX Calculated Members - Query-Scoped
Calculated Members
5/16/2018 • 2 minutes to read • Edit Online
NOTE
For more information about calculated members, see Building Calculated Members in MDX (MDX).
[ WITH <SELECT WITH clause> [ , <SELECT WITH clause> ... ] ] SELECT [ * | ( <SELECT query axis clause> [ ,
<SELECT query axis clause> ... ] ) ]FROM <SELECT subcube clause> [ <SELECT slicer axis clause> ][ <SELECT cell
property list clause> ]
<SELECT WITH clause> ::=
( [ CALCULATED ] MEMBER <CREATE MEMBER body clause>) | <CREATE MEMBER body clause> ::= Member_Identifier AS
'MDX_Expression'
[ <CREATE MEMBER property clause> [ , <CREATE MEMBER property clause> ... ] ]
<CREATE MEMBER property clause> ::=
( MemberProperty_Identifier = Scalar_Expression )
In the syntax for the WITH keyword, the Member_Identifier value is the fully qualified name of the calculated
member. This fully qualified name includes the dimension or level to which the calculated member is associated.
The MDX_Expression value returns the value of the calculated member after the expression value has been
evaluated. The values of intrinsic cell properties for a calculated member can be optionally specified by supplying
the name of the cell property in the MemberProperty_Identifier value and the value of the cell property in the
Scalar_Expression value.
You can also create calculated members at any point within a hierarchy. For example, the following MDX query
defines the [BigSeller] calculated member for a hypothetical Sales cube. This calculated member determines
whether a specified store has at least 100.00 in unit sales for beer and wine. However, the query creates the
[BigSeller] calculated member not as a child member of the [Product] dimension, but instead as a child
member of the [Beer and Wine] member.
WITH
MEMBER [Product].[Beer and Wine].[BigSeller] AS
IIf([Product].[Beer and Wine] > 100, "Yes","No")
SELECT
{[Product].[BigSeller]} ON COLUMNS,
Store.[Store Name].Members ON ROWS
FROM Sales
Calculated members do not have to depend only on existing members in a cube. Calculated member can also be
based on other calculated members defined in the same MDX expression. For example, the following MDX query
uses the value created in the first calculated member, [Measures].[Special Discount] , to generate the value of the
second calculated member, [Measures].[Special Discounted Amount] .
WITH
MEMBER [Measures].[Special Discount] AS
[Measures].[Discount Percentage] * 1.5,
FORMAT_STRING = 'Percent'
SELECT
{[Measures].[Special Discount], [Measures].[Special Discounted Amount]} on COLUMNS,
NON EMPTY [Product].[Product].MEMBERS ON Rows
FROM [Adventure Works]
WHERE [Product].[Category].[Bikes]
See Also
MDX Function Reference (MDX)
SELECT Statement (MDX)
Creating Session-Scoped Calculated Members (MDX)
MDX Calculated Members - Session-Scoped
Calculated Members
5/16/2018 • 2 minutes to read • Edit Online
NOTE
For more information about calculated members, see Building Calculated Members in MDX (MDX).
In the syntax for the CREATE MEMBER statement, the fully-qualified-member-name value is the fully qualified
name of the calculated member. The fully qualified name includes the dimension or level to which the calculated
member is associated. The expression value returns the value of the calculated member after the expression
value has been evaluated,.
See Also
Creating Query-Scoped Calculated Members (MDX)
MDX Cell Calculations - Build Cell Calculations
5/16/2018 • 2 minutes to read • Edit Online
See Also
ALTER CUBE Statement (MDX)
CREATE CELL CALCULATION Statement (MDX)
Creating Query-Scoped Cell Calculations (MDX)
MDX Query Fundamentals (Analysis Services)
MDX Cell Calculations - Query-Scoped Cell
Calculations
5/16/2018 • 2 minutes to read • Edit Online
The CellCalc_Identifier value is the name of the calculated cells. The String_Expression value contains a list of
orthogonal, single-dimensional MDX set expressions. Each of these set expressions must resolve to one of the
categories listed in the following table.
CATEGORY DESCRIPTION
Empty set An MDX set expression that resolves into an empty set. In this
case, the scope of the calculated cell is the whole cube.
Single member set An MDX set expression that resolves into a single member.
Set of level members An MDX set expression that resolves into the members of a
single level. An example of such a set expression is the
Level_Expression.Members MDX function. To include
calculated members, use the Level_Expression.AllMembers
MDX function. For more information, see AllMembers (MDX).
Set of descendants An MDX set expression that resolves into the descendants of
a specified member. An example of such a set expression is the
Descendants(Member_Expression, Level_Expresion,
Desc_Flag) MDX function. For more information, see
Descendants (MDX).
If the String_Expression argument does not describe a dimension, MDX assumes that all members are included
for the purposes of constructing the calculation subcube. Therefore, if the String_Expression argument is NULL,
the calculated cells definition applies to the whole cube.
The MDX_Expression argument contains an MDX expression that evaluates to a cell value for all the cells defined in
the String_Expression argument.
Additional Considerations
MDX processes the calculation condition, specified by the CONDITION property, only once. This single
processing provides increased performance for the evaluation of multiple calculated cells definitions, especially
with overlapping calculated cells across cube passes.
When this single processing occurs depends on the creation scope of the calculated cells definition:
If created at global scope, as part of a cube, MDX process the calculation condition when the cube is
processed. If cells are modified in the cube in any way, and the cells are included in the calculation subcube
of a calculated cells definition, the calculation condition may not be accurate until the cube is reprocessed.
Cell modification can occur from writebacks, for example. The calculation condition is reprocessed when the
cube is reprocessed.
If created at session scope, MDX process the calculation condition when the statement is issued during the
session. As with calculated cells definitions created globally, if the cells are modified, the calculation
condition may not be accurate for the calculated cells definition.
If created at query scope, MDX processes the calculation condition when the query runs. The cell
modification issue applies here, also, although data latency issues are minimal because of the low
processing time of MDX query execution.
On the other hand, MDX processes the calculation formula whenever an MDX query is issued against the cube
involving cells included in the calculated cells definition. This processing occurs regardless of the creation scope.
See Also
CREATE CELL CALCULATION Statement (MDX)
MDX Cell Calculations - Session-Scoped Calculated
Cells
5/16/2018 • 2 minutes to read • Edit Online
IMPORTANT
This syntax has been deprecated. You should use MDX assignments should instead. For more information on assignments,
see The Basic MDX Script (MDX).
To create calculated cells that are available to all queries in the same session, you can use either the CREATE CELL
CALCULATION statement or the ALTER CUBE statement. Both statements have the same result.
Use the following syntax to use the CREATE CELL CALCULATION statement to define a session-scoped calculated
cell:
Use the following syntax to use the ALTER CUBE statement to define a session-scoped calculated cell:
ALTER CUBE Cube_Identifier CREATE CELL CALCULATION
FOR String_Expression AS 'MDX_Expression'
[ <CREATE CELL CALCULATION property clause> [ , <CREATE CELL CALCULATION property clause> ... ] ]
The String_Expression value contains a list of orthogonal, single-dimensional MDX set expressions, each of which
must resolve to one of the categories of sets that are listed in the following table.
CATEGORY DESCRIPTION
Empty set An MDX set expression that resolves into an empty set. In this
case, the scope of the calculated cell is the whole cube.
Single member set An MDX set expression that resolves into a single member.
Set of level members An MDX set expression that resolves into the members of a
single level. An example of this is the
Level_Expression.Members MDX function. To include
calculated members, use the Level_Expression.AllMembers
MDX function.
Set of descendants An MDX set expression that resolves into the descendants of
a specified member. An example of this is the
Descendants(Member_Expression, Level_Expression,
Desc_Flag) MDX function.
See Also
Building Cell Calculations in MDX (MDX)
MDX Building Measures
5/16/2018 • 2 minutes to read • Edit Online
WARNING
Measures can only be defined in tabular models; if your database is set in multidimensional mode, creating a measure will
generate an error
To create a measure that is defined as part of an MDX query, and therefore whose scope is limited to the query,
you use the WITH keyword. You can then use the measure within an MDX SELECT statement. Using this
approach, the calculated member created by using the WITH keyword can be changed without disturbing the
SELECT statement. However, in MDX you reference the measure in a different way than when in DAX expressions;
to reference the measure you name it as a member of the [Measures] dimension, see the following MDX example:
with measure 'Sales Territory'[Total Sales Amount] = SUM('Internet Sales'[Sales Amount]) + SUM('Reseller
Sales'[Sales Amount])
select measures.[Total Sales Amount] on columns
,NON EMPTY [Date].[Calendar Year].children on rows
from [Model]
2001 11331808.96
2002 30674773.18
2003 41993729.72
2004 25808962.34
See Also
CREATE MEMBER Statement (MDX)
MDX Function Reference (MDX)
SELECT Statement (MDX)
MDX Member Properties
12/10/2018 • 2 minutes to read • Edit Online
NOTE
In MicrosoftSQL Server, member properties are know as attribute relationships. For more information, see Attribute
Relationships.
SELECT [<axis_specification>
[, <axis_specification>...]]
FROM [<cube_specification>]
[WHERE [<slicer_specification>]]
The <axis_specification> clause includes an optional <dim_props> clause, as shown in the following syntax:
NOTE
For more information about the <set> and <axis_name> values, see Specifying the Contents of a Query Axis (MDX).
The <dim_props> clause lets you query dimension, level, and member properties using the PROPERTIES
keyword. The following syntax shows the formatting of the <dim_props> clause:
The breakdown of the <property> syntax varies depending on the property that you are querying:
Context sensitive intrinsic member properties must be preceded with the name of the dimension or level.
However, non-context sensitive intrinsic member properties cannot be qualified by the dimension or level
name. For more information about how to use the PROPERTIES keyword with intrinsic member
properties, see Intrinsic Member Properties (MDX).
User-defined member properties should be preceded by the name of the level in which they reside. For
more information about how to use the PROPERTIES keyword with user-defined member properties, see
User-Defined Member Properties (MDX).
See Also
Creating and Using Property Values (MDX)
MDX Member Properties - Intrinsic Member
Properties
12/10/2018 • 9 minutes to read • Edit Online
NOTE
As a provider that is compliant with the OLAP section of the OLE DB specification dated March 1999 (2.6), Microsoft SQL
Server Analysis Services supports the intrinsic member properties listed in this topic.
Providers other than SQL ServerAnalysis Services may support additional intrinsic member properties. For more information
about the intrinsic member properties supported by other providers, refer to the documentation that comes with those
providers.
Regardless of whether the intrinsic member property is context sensitive or not, the following usage rules apply:
You can specify only those intrinsic member properties that relate to dimension members that are
projected on the axis.
You can mix requests for context sensitive member properties in the same query with non-context sensitive
intrinsic member properties.
You use the PROPERTIES keyword to query for the properties.
The following sections describe both the various context sensitive and non-context sensitive intrinsic member
properties available in SQL Server Analysis Services, and how to use the PROPERTIES keyword with each type
of property.
PROPERTY DESCRIPTION
Key The value of the member key in the original data type.
MEMBER_KEY is for backward-compatibility. MEMBER_KEY
has the same value as KEY0 for non-composite keys, and
MEMBER_KEY property is null for composite keys.
KEYx The key for the member, where x is the zero-based ordinal of
the key. KEY0 is available for composite and non-composite
keys, but primarily used for composite keys.
For a level member property, you can precede the name of the property with just the level name or, for additional
specification, both the dimension and level name. The following example shows the appropriate syntax:
DIMENSION PROPERTIES [Dimension.]Level.Property_name
To illustrate, you would like to return all the names of each referenced member in the [Sales] dimension. To
return these names, you would use the following statement in a Multidimensional Expressions (MDX) query:
DIMENSION PROPERTIES [Sales].Name
NOTE
Columns in the MEMBERS schema rowset support the intrinsic member properties listed in the following table. For more
information about the MEMBERS schema rowset, see MDSCHEMA_MEMBERS Rowset.
PROPERTY DESCRIPTION
CHILDREN_CARDINALITY The number of children that the member has. This can be an
estimate, so you should not rely on this to be the exact count.
Providers should return the best estimate possible.
KEYx The key for the member, where x is the zero-based ordinal of
the key. KEY0 is available for composite and non-composite
keys.
LEVEL_NUMBER The distance of the member from the root of the hierarchy.
The root level is zero.
LEVEL_UNIQUE_NAME The unique name of the level to which the member belongs.
For providers that generate unique names by qualification,
each component of this name is delimited.
MEMBER_KEY The value of the member key in the original data type.
MEMBER_KEY is for backward-compatibility. MEMBER_KEY
has the same value as KEY0 for non-composite keys, and
MEMBER_KEY property is null for composite keys.
MEMBER_TYPE The type of the member. This property can have one of the
following values:
MDMEMBER_TYPE_REGULAR
MDMEMBER_TYPE_ALL
MDMEMBER_TYPE_FORMULA
MDMEMBER_TYPE_MEASURE
MDMEMBER_TYPE_UNKNOWN
MEMBER_UNIQUE_NAME The unique name of the member. For providers that generate
unique names by qualification, each component of this name
is delimited.
PARENT_LEVEL The distance of the member's parent from the root level of
the hierarchy. The root level is zero.
Notice that this syntax does not allow the property to be qualified by a dimension or level. The property cannot be
qualified because an intrinsic member property that is not context sensitive applies to all members of an axis.
For example, an MDX statement that specifies the DESCRIPTION intrinsic member property would have the
following syntax:
DIMENSION PROPERTIES DESCRIPTION
This statement returns the description of each member in the axis dimension. If you tried to qualify the property
with a dimension or level, as in Dimension .DESCRIPTION or Level .DESCRIPTION , the statement would not validate.
Example
The following examples show MDX queries that return intrinsic properties.
Example 1: Use context-sensitive intrinsic properties in query
The following example returns parent ID, key, and name for each product category. Notice how the properties are
exposed as measures. This lets you view the properties in a cellset when you run the query, rather than the
Member Properties dialog in SSMS. You might run a query like this to retrieve member metadata from a cube
that is already deployed.
WITH
MEMBER [Measures].[Parent Member ID] AS
[Product].[Product Categories].CurrentMember.Parent.PROPERTIES("ID")
MEMBER [Measures].[Parent Member Key] AS
[Product].[Product Categories].CurrentMember.Parent.PROPERTIES("KEY")
MEMBER [Measures].[Parent Member Name] AS
[Product].[Product Categories].CurrentMember.Parent.PROPERTIES("Name")
SELECT
{[Measures].[Parent Member ID], [Measures].[Parent Member Key], [Measures].[Parent Member Name] } on COLUMNS,
[Product].[Product Categories].AllMembers on ROWS
FROM [Adventure Works]
WITH
MEMBER Measures.CategoryCaption AS Product.Category.CurrentMember.MEMBER_CAPTION
MEMBER Measures.SpanishCategoryCaption AS Product.Category.CurrentMember.Properties("LCID3082")
MEMBER Measures.FrenchCategoryCaption AS Product.Category.CurrentMember.Properties("LCID1036")
SELECT
{ Measures.CategoryCaption, Measures.SpanishCategoryCaption, Measures.FrenchCategoryCaption } ON 0
,[Product].[Category].MEMBERS ON 1
FROM [Adventure Works]
See Also
PeriodsToDate (MDX)
Children (MDX)
Hierarchize (MDX)
Count (Set) (MDX)
Filter (MDX)
AddCalculatedMembers (MDX)
DrilldownLevel (MDX)
Properties (MDX)
PrevMember (MDX)
Using Member Properties (MDX)
MDX Function Reference (MDX)
MDX Member Properties - User-Defined Member
Properties
5/16/2018 • 2 minutes to read • Edit Online
The PROPERTIES keyword appears after the set expression of the axis specification. For example, the following
MDX query the PROPERTIES keyword retrieves the List Price and Dealer Price user-defined member
properties and appears after the set expression that identifies the products sold in January:
SELECT
CROSSJOIN([Ship Date].[Calendar].[Calendar Year].Members,
[Measures].[Sales Amount]) ON COLUMNS,
NON EMPTY Product.Product.MEMBERS
DIMENSION PROPERTIES
Product.Product.[List Price],
Product.Product.[Dealer Price] ON ROWS
FROM [Adventure Works]
WHERE ([Date].[Month of Year].[January])
For more information about building calculated members, see Building Calculated Members in MDX (MDX).
See Also
Using Member Properties (MDX)
Properties (MDX)
MDX Cell Properties - Using Cell Properties
11/27/2018 • 4 minutes to read • Edit Online
SELECT [<axis_specification>
[, <axis_specification>...]]
FROM [<cube_specification>]
[WHERE [<slicer_specification>]]
[<cell_props>]
The following syntax shows the format of the <cell_props> value and how this value uses the CELL
PROPERTIES keyword along with one or more intrinsic cell properties:
PROPERTY DESCRIPTION
PROPERTY DESCRIPTION
MDACTION_TYPE_URL
MDACTION_TYPE_HTML
MDACTION_TYPE_STATEMENT
MDACTION_TYPE_DATASET
MDACTION_TYPE_ROWSET
MDACTION_TYPE_COMMANDLINE
MDACTION_TYPE_PROPRIETARY
MDACTION_TYPE_REPORT
MDACTION_TYPE_DRILLTHROUGH
FONT_FLAGS The bitmask detailing effects on the font. The value is the
result of a bitwise OR operation of one or more of the
following constants:
MDFF_BOLD = 1
MDFF_ITALIC = 2
MDFF_UNDERLINE = 4
MDFF_STRIKEOUT = 8
UPDATEABLE A value that indicates whether the cell can be updated. This
property can have one of the following values:
CELL_UPDATE_NOT_ENABLED_FORMULA (0x10000001)
The cell cannot be updated because the cell has a calculated
member among its coordinates; the cell was retrieved with a
set in the where clause. A cell can be updated even though a
formula affects, or a calculated cell is on, the value of a cell (is
somewhere along the aggregation path). In this scenario, the
final value of the cell may not be the updated value, because
the calculation will affect the result
CELL_UPDATE_NOT_ENABLED_NONSUM_MEASURE
(0x10000002) The cell cannot be updated because non-sum
measures (count, min, max, distinct count, semi-additive) can
not be updated.
CELL_UPDATE_NOT_ENABLED_NACELL_VIRTUALCUBE
(0x10000003) The cell cannot be updated because the cell
does not exist as it is at the intersection of a measure and a
dimension member unrelated to the measure's measure
group.
CELL_UPDATE_NOT_ENABLED_CALCLEVEL (0x10000006)
Reserved for future use.
PROPERTY DESCRIPTION
CELL_UPDATE_NOT_ENABLED_CANNOTUPDATE
(0x10000007) The cell cannot be updated because of internal
reasons.
CELL_UPDATE_NOT_ENABLED_INVALIDDIMENSIONTYPE
(0x10000009) The cell cannot be updated because update is
not supported in mining model, indirect, or data mining
dimensions.
Only the CELL_ORDINAL, FORMATTED_VALUE, and VALUE cell properties are required. All cell properties,
intrinsic or provider-specific, are defined in the PROPERTIES schema rowset, including their data types and
provider support. For more information about the PROPERTIES schema rowset, see MDSCHEMA_PROPERTIES
Rowset.
By default, if the CELL PROPERTIES keyword is not used, the cell properties returned are VALUE,
FORMATTED_VALUE, and CELL_ORDINAL (in that order). If the CELL PROPERTIES keyword is used, only
those cell properties explicitly stated with the keyword are returned.
The following example demonstrates the use of the CELL PROPERTIES keyword in an MDX query:
SELECT
{[Measures].[Reseller Gross Profit]} ON COLUMNS,
{[Reseller].[Reseller Type].[Reseller Name].Members} ON ROWS
FROM [Adventure Works]
CELL PROPERTIES VALUE, FORMATTED_VALUE, FORMAT_STRING, FORE_COLOR, BACK_COLOR
Cell properties are not returned for MDX queries that return flattened rowsets; in this case, each cell is represented
as if only the FORMATTED_VALUE cell property were returned.
See Also
MDX Query Fundamentals (Analysis Services)
MDX Cell Properties - FORMAT_STRING Contents
11/28/2018 • 12 minutes to read • Edit Online
String Values
A format expression for strings can have one section or two sections separated by a semicolon (;).
USAGE RESULT
Two sections The first section applies to string data, whereas the second
section applies to null values and zero-length strings ("").
The characters described in the following table can appear in the format string for character strings.
CHARACTER DESCRIPTION
Numeric Values
A user-defined format expression for numbers can have anywhere from one to four sections separated by
semicolons. If the format argument contains one of the named numeric formats, only one section is allowed.
USAGE RESULT
Two sections The first section applies to positive values and zeros, the
second to negative values.
Three sections The first section applies to positive values, the second to
negative values, and the third to zeros.
Four sections The first section applies to positive values, the second to
negative values, the third to zeros, and the fourth to null
values.
The following example has two sections. The first section defines the format for positive values and zeros, and the
second section defines the format for negative values.
"$#,##0;($#,##0)"
If you include semicolons with nothing between them, the missing section prints using the format of the positive
value. For example, the following format displays positive and negative values using the format in the first section
and displays "Zero" if the value is zero:
"$#,##0;;\Z\e\r\o"
The following table identifies the characters that can appear in the format string for numeric formats.
CHARACTER DESCRIPTION
If the number has fewer digits than there are zeros (on either
side of the decimal) in the format string, the formatted value
displays leading or trailing zeros.
The number sign (#) placeholder works like the zero (0) digit
placeholder except that leading and trailing zeros are not
displayed if the number has the same or fewer digits than
there are # characters on either side of the decimal separator
in the format expression.
"ABC" Displays the string inside the double quotation marks (" ").
Fixed Displays at least one digit to the left and two digits to the
right of the decimal separator.
Percent Displays the number multiplied by 100 with a percent sign (%)
appended to the right. Always displays two digits to the right
of the decimal separator.
Date Values
The following table identifies characters that can appear in the format string for date/time formats.
CHARACTER DESCRIPTION
General Date Displays a date and/or time. For real numbers, displays a date
and time, for example, 4/3/93 05:34 PM. If there is no
fractional part, displays only a date, for example, 4/3/93. If
there is no integer part, displays a time only, for example,
05:34 PM. The format of the date display is determined by
your system settings.
Long Date Displays a date according to your system's long date format.
Medium Date Displays a date using the medium date format appropriate for
the language version of the host application.
Short Date Displays a date using your system's short date format.
Long Time Displays a time using your system's long time format; includes
hours, minutes, and seconds.
Medium Time Displays a time in the 12-hour format using hours and
minutes and the AM/PM designator.
Short Time Displays a time using the 24-hour format, for example, 17:45.
See Also
LANGUAGE and FORMAT_STRING on FORMATTED_VALUE
Using Cell Properties (MDX)
Creating and Using Property Values (MDX)
MDX Query Fundamentals (Analysis Services)
MDX Cell Properties - FORE_COLOR and
BACK_COLOR Contents
5/16/2018 • 2 minutes to read • Edit Online
See Also
Using Cell Properties (MDX)
MDX Cell Properties - FORMATTED_VALUE Property
5/16/2018 • 6 minutes to read • Edit Online
FORMATTED_VALUE constructed
The FORMATTED_VALUE property is constructed by using the value from the VALUE property and applying the
format template specified in the FORMAT_STRING property to that value. In addition, whenever the formatting
value is a named formatting literal the LANGUAGE property specification modifies the output of
FORMAT_STRING to follow the language usage for the named formatting. Named formatting literals are all
defined in a way that can be localized. For example, "General Date" is a specification that can be localized, as
opposed to the following template "YYYY-MM-DD hh:nn:ss", which states that the date is to be presented as defined
by the template regardless of the language specification.
If there is a conflict between the FORMAT_STRING template and the LANGUAGE specification, the
FORMAT_STRING template overrides the LANGUAGE specification. For example, if FORMAT_STRING="$ #0"
and LANGUAGE=1034 (Spain), and VALUE=123.456 then FORMATTED_VALUE="$ 123" instead of
FORMATTED_VALUE="€ 123", the expected format is in Euros, because the value of the format template
overrides the language specified.
Examples
The following examples show the output obtained when LANGUAGE is used in conjunction with
FORMAT_STRING.
The first example explains formatting numerical values; the second example explains formatting date and time
values.
For each example the Multidimensional Expressions (MDX) code is given.
with
The results, transposed, when the above MDX query was run using SQL Server Management Studio over a server
and client with locale 1033 are as follows:
with
The results, transposed, when the above MDX query was run using SQL Server Management Studio over a server
and client with locale 1033 are as follows: