<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5650243067310933543</id><updated>2012-02-12T14:07:00.720+01:00</updated><category term='Denali'/><category term='Seminar'/><category term='DTS'/><category term='Selfservice BI'/><category term='SQL'/><category term='Governance'/><category term='MDM'/><category term='Linstedt'/><category term='Best practices'/><category term='migration'/><category term='XML'/><category term='SQLServer'/><category term='Powerpivot'/><category term='Oracle'/><category term='Business Intelligence'/><category term='TOGAF'/><category term='SSMS'/><category term='C#'/><category term='Quipu'/><category term='Kimball'/><category term='certification'/><category term='Data'/><category term='Inmon'/><category term='Datavault'/><category term='SSAS'/><category term='SSRS'/><category term='Geocoding'/><category term='Performance management'/><category term='T-SQL'/><category term='SSIS'/><category term='datawarehouse'/><category term='MDX'/><title type='text'>BI Future Blog</title><subtitle type='html'>Information about Datawarehouse, Business intelligence, Master Data Management and SQL Server.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default?start-index=101&amp;max-results=100'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>158</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-1864263423237472622</id><published>2012-02-08T12:04:00.000+01:00</published><updated>2012-02-10T09:51:20.989+01:00</updated><title type='text'>SSAS: optimizing processing query using reference dimension relationship</title><content type='html'>&lt;b&gt;&lt;span style="font-size: large;"&gt;Introduction&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;span style="font-family: inherit;"&gt;In one of my former posts titled "&lt;span style="background-color: white; color: #222222;"&gt;&lt;a href="http://bifuture.blogspot.com/2012/01/ssas-select-facts-with-reference-and.html"&gt;Select Facts with Reference and Many2Many relationships&lt;/a&gt;" I blogged about the usage of reference dimension relationships in cubes. In my current clientsituation i'm experiencing a major slowdown while processing the cube. Some investigation learned that the reference relationsshiop seems to be the problem. In this blogpost i'll explain the problem, a solution (by replacing the load query) and a conclusion.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;b&gt;The problem&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;I'll be using the labsituation that i've describedin my former blogpost&amp;nbsp;"&lt;span style="background-color: white; color: #222222;"&gt;&lt;a href="http://bifuture.blogspot.com/2012/01/ssas-select-facts-with-reference-and.html"&gt;Select Facts with Reference and Many2Many relationships&lt;/a&gt;". In this blogpost i've shown how to build a reference dimension relationsship and a many2many relationsship. For this partiular problem i'll focus on the reference dimension &amp;nbsp;relationsship because this is experiencing performance slowdon at the client i'm currently operating.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-gKM9yCqL-SM/Ty7MJX47xuI/AAAAAAAABOU/jSvXlcWFIJI/s1600/initial+situation.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="216" src="http://1.bp.blogspot.com/-gKM9yCqL-SM/Ty7MJX47xuI/AAAAAAAABOU/jSvXlcWFIJI/s400/initial+situation.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style="background-color: white; color: #222222;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="background-color: white; color: #222222;"&gt;Suppose i've the following situation (see diagram below). In this situation i've three reference relationsships: Customer, Department and Date. These dimensions are the normal dimensions of the Orders fact. Because we want to influence the numbers on the OrderLines fact we have to create a Reference Dimension relationship.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #222222;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-x2y3JN-J2xY/TygqDP0larI/AAAAAAAABOE/c3iK05BM_xw/s1600/reference+relationship.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="196" src="http://3.bp.blogspot.com/-x2y3JN-J2xY/TygqDP0larI/AAAAAAAABOE/c3iK05BM_xw/s400/reference+relationship.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The problem is that i'm experiencing a slowdown in performance during processing &amp;nbsp;the cube because of the usage of the reference dimension relationsshipin the cube. This (the processing query) will result in the following load query of the cube:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;SELECT&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;[dbo_tblFactOrderlines].[OrderLines_Count] AS [dbo_tblFactOrderlinesOrderLines_Count0_0],&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;[dbo_tblFactOrderlines].[Product_ID] AS [dbo_tblFactOrderlinesProduct_ID0_1],&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;[dbo_tblFactOrderlines].[Category_ID] AS [dbo_tblFactOrderlinesCategory_ID0_2],&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;[dbo_tblFactOrderlines].[Orders_ID] AS [dbo_tblFactOrderlinesOrders_ID0_3],&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;[dbo_tblFactOrders_4].[Customer_ID] AS [dbo_tblFactOrdersCustomer_ID4_0],&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;[dbo_tblFactOrders_5].[Department_ID] AS [dbo_tblFactOrdersDepartment_ID6_0],&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;[dbo_tblFactOrders_6].[Date_ID] AS [dbo_tblFactOrdersDate_ID8_0]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;FROM [dbo].[tblFactOrderlines] AS [dbo_tblFactOrderlines],&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;[dbo].[tblFactOrders] AS [dbo_tblFactOrders_4],&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;[dbo].[tblFactOrders] AS [dbo_tblFactOrders_5],&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;[dbo].[tblFactOrders] AS [dbo_tblFactOrders_6]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;strong&gt;&amp;nbsp; WHERE&amp;nbsp;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;strong&gt;&amp;nbsp; (&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;strong&gt;&amp;nbsp; &amp;nbsp;([dbo_tblFactOrderlines].[Orders_ID] &amp;nbsp; = &amp;nbsp;[dbo_tblFactOrders_4].[Orders_ID])&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;strong&gt;&amp;nbsp; &amp;nbsp; AND &amp;nbsp;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;strong&gt;&amp;nbsp; &amp;nbsp;([dbo_tblFactOrderlines].[Orders_ID] &amp;nbsp; = &amp;nbsp;[dbo_tblFactOrders_5].[Orders_ID])&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;strong&gt;&amp;nbsp; &amp;nbsp; AND &amp;nbsp;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;strong&gt;&amp;nbsp; &amp;nbsp;([dbo_tblFactOrderlines].[Orders_ID] &amp;nbsp; = &amp;nbsp;[dbo_tblFactOrders_6].[Orders_ID])&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;strong&gt;&amp;nbsp; )&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;As you can see that for every "Reference Dimension" relationship an extra join is created to the same table (?!). The WHERE clause uses 3 joins for Customer, Department and Date. At my client i'm having 5 joins and it takes now about 15 minutes to load a specific measuregroup. When i replace the 5 joins with 1 join the processingtime drops drammatically, from 11 minutes to 35 seconds.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;The solution&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;I've replaced the OrderLines tabel in the datasource view by the following view&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;DROP VIEW vwOrderLinesCube&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;GO&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;CREATE VIEW vwOrderLinesCube AS&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;SELECT&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;[OL].[OrderLines_Count] AS [OrderLines_Count],&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;[OL].[Product_ID] AS [Product_ID],&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;[OL].[Category_ID] AS [Category_ID],&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;[O].[Orders_ID] AS [Orders_ID],&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;[O].[Customer_ID] AS [Customer_ID],&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;[O].[Department_ID] AS [Department_ID],&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;[O].[Date_ID] AS [Date_ID]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;FROM [dbo].[tblFactOrders] AS [O]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;INNER JOIN [dbo].[tblFactOrderlines] OL ON [O].[Orders_id] = [OL].[Orders_id]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;So i&amp;nbsp; had to draw some extra lines in the datasource view and that is a drawback of the solution, unfortunately. The model is now less intuitive and less clear. Too bad...&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-MDEMXdL3B5c/Tyg0NYOM-wI/AAAAAAAABOM/iuNNBcftC-k/s1600/dsv.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="250" src="http://1.bp.blogspot.com/-MDEMXdL3B5c/Tyg0NYOM-wI/AAAAAAAABOM/iuNNBcftC-k/s400/dsv.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;With this new setup the following processing query is executed:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;SELECT&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;[dbo_tblFactOrderlines].[OrderLines_Count] AS [dbo_tblFactOrderlinesOrderLines_Count0_0],&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;[dbo_tblFactOrderlines].[Product_ID] AS [dbo_tblFactOrderlinesProduct_ID0_1],&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;[dbo_tblFactOrderlines].[Category_ID] AS [dbo_tblFactOrderlinesCategory_ID0_2],&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;[dbo_tblFactOrderlines].[Orders_ID] AS [dbo_tblFactOrderlinesOrders_ID0_3],&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;[dbo_tblFactOrderlines].[Customer_ID] AS [dbo_tblFactOrderlinesCustomer_ID0_4],&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;[dbo_tblFactOrderlines].[Department_ID] AS [dbo_tblFactOrderlinesDepartment_ID0_5],&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;[dbo_tblFactOrderlines].[Date_ID] AS [dbo_tblFactOrderlinesDate_ID0_6]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;FROM [dbo].[vwOrderLinesCube] AS [dbo_tblFactOrderlines]&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now you can see that the three joins has been replaced by the view, which contains now the one and only join to the Orders table.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;Conclusion&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;Mainly this solution is needed when the processing time takes longer because of the usage of the reference dimension relationsship in the cube design. In my opinion because of bad design of the load quey. Too bad but sometimes you have to use the pragmatic solution.&lt;br /&gt;&lt;br /&gt;Greetz,&lt;br /&gt;Hennie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-1864263423237472622?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/1864263423237472622/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2012/02/ssas-optimizing-processing-query-using.html#comment-form' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/1864263423237472622'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/1864263423237472622'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2012/02/ssas-optimizing-processing-query-using.html' title='SSAS: optimizing processing query using reference dimension relationship'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-gKM9yCqL-SM/Ty7MJX47xuI/AAAAAAAABOU/jSvXlcWFIJI/s72-c/initial+situation.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-1806111758438162018</id><published>2012-01-28T09:55:00.000+01:00</published><updated>2012-01-28T09:58:39.820+01:00</updated><title type='text'>SSAS : Error with many-to-many dimension and level of granularity</title><content type='html'>&lt;span style="font-size: large;"&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/span&gt; &lt;br /&gt;In this blogpost a brief explanation of an error i've encountered during a implementation of a 'many2many relationship' in a SSAS cube.&amp;nbsp;Although i haven't found the rootcause of this problem i do want to share with you the solution. I did only found one relevant website of &lt;a href="http://sqlserverpedia.com/blog/sql-server-bloggers/data-modeling-tip-when-using-many-to-many-bridge-tables-in-ssas/"&gt;Melissa Coates&lt;/a&gt;&amp;nbsp;with the same sort of problem. So hopefully this will help the MS BI community a bit futher. &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&lt;strong&gt;&lt;span style="font-size: large;"&gt;Problem&lt;/span&gt;&lt;/strong&gt; &lt;br /&gt;In my &lt;a href="http://bifuture.blogspot.com/2012/01/ssas-select-facts-with-reference-and.html"&gt;former post&lt;/a&gt; i've worked out an example with Referenced Dimension relationship and a Many2Many relationship. As you have seen in this blogpost everything worked fine but when i implemented this solution at my client i got the following error(off course i replaced the names used at the client with the names used in the example) : &lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;em&gt;&lt;span style="color: red;"&gt;&lt;b&gt;Errors in the metadata manager. &lt;/b&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color: red;"&gt;&lt;i&gt;&lt;b&gt;The 'Category' many-to-many dimension in the 'Orders' measure group requires that the granularity of the 'OrdersDD' dimension is lower than that of the 'OrderLines' measure group&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size: large;"&gt;Solution&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style="color: black;"&gt;The situation at the client is much more complex than&amp;nbsp;the labsituation that i've descibed in the blogpost. I have about 15 measure groups and about 75 dimensions. So debugging the problem is hard to do.&amp;nbsp;&lt;/span&gt;I had a couple options to debug this problem:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Downgrade the complete solution to a certain level where the problem is more manageable. Break everything out of the solution that is not needed for understanding the problem. Off course use a copy of your development environment ;-).&lt;/li&gt;&lt;li&gt;Trail and error. In this approach you tweak the solution a bit and see whether the error disappears.&lt;/li&gt;&lt;li&gt;Reproduce error in labsituation. As already said, í've created a labsituation where everythings works fine. A manner could be to change some settings in the project and see whether the error appears. &lt;/li&gt;&lt;/ol&gt;I decided to take a gamble on option 2 and found a solution very quickly, very fortunately!!&lt;br /&gt;&lt;br /&gt;The solution was to change the Fact dimensionship relationship of the OrdersDD dimension with the Orders Measure group to a regular dimension relationship.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size: large;"&gt;Conclusion&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style="color: black;"&gt;A short post about a problem i've encountered during implementation of a many2many relationship in a SSAS Cube. I've presented a solution that helped solving the error. Currently testing whether everything works fine but everythings seems working very fine.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: black;"&gt;Greetz,&lt;/span&gt;&lt;br /&gt;Hennie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-1806111758438162018?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/1806111758438162018/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2012/01/ssas-error-with-many-to-many-dimension.html#comment-form' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/1806111758438162018'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/1806111758438162018'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2012/01/ssas-error-with-many-to-many-dimension.html' title='SSAS : Error with many-to-many dimension and level of granularity'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-7542023731434820587</id><published>2012-01-24T08:38:00.000+01:00</published><updated>2012-01-24T08:55:16.559+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSAS'/><category scheme='http://www.blogger.com/atom/ns#' term='SQLServer'/><title type='text'>SSAS : Select Facts with Reference and Many2Many relationships</title><content type='html'>&lt;b&gt;Introduction&lt;/b&gt;&lt;br /&gt;In this blogpost i'll explain how to connect two starschemas with each other and how to setup the cube in SSAS&amp;nbsp; in case you want to use the dimensions of the two facts selecting the measures in both facts. In other words, suppose i've two facts that have a 1:N relation (eg. Orders and OrderLines) and there are a couple of dimensions (eg. Customer, Department, Date, Product and Category). And, sometimes because of naming conventions (?) a referenced dimension relationship is automatically created between&amp;nbsp; a 1 fact and a N fact. This will enable selecting the measures of the N fact with the dimensions of the 1 fact. Using a Many-2-Many (M2M) relationship will enhance selecting measures in the 1 fact with the dimensions of the N fact.&lt;br /&gt;&lt;br /&gt;The blogpost is ended with leasons learned part and conclusions.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The problem&lt;/b&gt;&lt;br /&gt;Let's elaborate this example to a lab situation. Suppose i've the following situation:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-ngQyi0w50Pk/TxxNvRSlYuI/AAAAAAAABM8/KGgW58L40Bs/s1600/ReferenceDimensionN1+selection.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="260" nfa="true" src="http://4.bp.blogspot.com/-ngQyi0w50Pk/TxxNvRSlYuI/AAAAAAAABM8/KGgW58L40Bs/s320/ReferenceDimensionN1+selection.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;There are two starschemas: Orders and Orderlines (OrderDetails) and they have a 1: N relationship. OrderDD is the connecting dimension that actually is a 'fact dimension' in SSAS (not materialized but could be if you want). Physically there is an Order_id attribute in the Orderlines tables present to enhance the Fact dimension relationship in the cube in SSAS.&lt;br /&gt;&lt;br /&gt;The Order Fact has three real dimensions : Customer, Department and Date and Order Lines has a Category and a Product dimension.&lt;br /&gt;&lt;br /&gt;Mostly, the problem is that by default relationships are not created automatically, meaning that using the dimensions doesn't have effect on the facts of both starschemas (when you browse the cube). There are additional steps needed to enable this. This will be explained in this blogpost. &lt;br /&gt;&lt;br /&gt;There are two possible directions to influence the measures on both facts:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Selecting measures of the N fact (eg. Orderlines) with dimensions&amp;nbsp; (eg. Customer, Department or Date) of the 1 fact (eg. Orders).&lt;/li&gt;&lt;li&gt;Selecting measures of the 1 fact (eg. orders) with the dimensions (eg. Categroy or Product) of the N fact (eg.Orderlines)&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;In the solution described below i'll start with an initial setup where there is no relationship, only the Fact&amp;nbsp; dimension OrdersDD, then i'll add an extra relationship 'Referenced Relationship' and finally the end solution with the 'Referenced Relationship' and the 'Many2Many relationship', together. &lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;b&gt;Solution&lt;/b&gt;&lt;br /&gt;In this solution i've identified 3 steps:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Possible initial situation.&lt;/li&gt;&lt;li&gt;Reference dimension relationship solution&lt;/li&gt;&lt;li&gt;Endsolution with Reference and Many2Many relationship&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&amp;nbsp;1) Suppose you build a cube on the described starschema, the following structure could be the result. Could because because of namingconventions a 'reference dimension' relationships is sometimes automatically gernerated (see also step 2). &lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-_PpUCFhImq4/TxxOgKdrx0I/AAAAAAAABNM/jiBTsp4md1s/s1600/startsolution.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="156" nfa="true" src="http://1.bp.blogspot.com/-_PpUCFhImq4/TxxOgKdrx0I/AAAAAAAABNM/jiBTsp4md1s/s320/startsolution.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;If the cube is browsed you can observe that the selection with dimension "Customer" selects the measures of the orders fact but not the orderlines measures. The OrderLines count is not controlled by the dimension "Customer".&amp;nbsp; For every dimension value the same (total value) is shown. This is not possible by default.&lt;br /&gt;&lt;br /&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-N4qh_9ZRouw/TxxP0FgALtI/AAAAAAAABNU/O-SzMZkkTA4/s1600/Referenced+relationship+problem.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="213" nfa="true" src="http://2.bp.blogspot.com/-N4qh_9ZRouw/TxxP0FgALtI/AAAAAAAABNU/O-SzMZkkTA4/s320/Referenced+relationship+problem.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The other way around, selecting measures of the Orders fact by the dimensions that belongs to the&amp;nbsp; Orderline fact shows also the same problem. For every dimension value the same (total value) is shown.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-OQ_9ZA5RPIU/TxxP24mGSmI/AAAAAAAABNc/aNV5KQAEhPg/s1600/Mant2Many+relationship+problem.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="207" nfa="true" src="http://3.bp.blogspot.com/-OQ_9ZA5RPIU/TxxP24mGSmI/AAAAAAAABNc/aNV5KQAEhPg/s320/Mant2Many+relationship+problem.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;2) In step 2 of the solution the reference dimension relationship is set up with the customer, Department en Date dimension. The OrdersDD functions as an intermediate dimension that directs the cube to relate the information from the Orders to the OrderLines starschema.&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-L72pX50VNgI/TxxNcXAJobI/AAAAAAAABM0/XljZl88uKx4/s1600/DimensionusageTab.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="171" nfa="true" src="http://4.bp.blogspot.com/-L72pX50VNgI/TxxNcXAJobI/AAAAAAAABM0/XljZl88uKx4/s320/DimensionusageTab.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;br /&gt;Below a screendump and it shows that the dimensionvalues has an imnpact on the measures on both starschemas : Orders and Orderlines.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-PA3GZZlORC4/TxxSG37SVuI/AAAAAAAABNk/NgOgFCTApQU/s1600/Referenced+dimension+solution.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="244" src="http://4.bp.blogspot.com/-PA3GZZlORC4/TxxSG37SVuI/AAAAAAAABNk/NgOgFCTApQU/s320/Referenced+dimension+solution.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Selecting values in the Orders starsschema with the product dimension still shows incorrect values.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-2c2yPOmcIHc/TxxSZ3LvlZI/AAAAAAAABNs/CzlqIECzxOg/s1600/Many2many+relationship+still+problem.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="221" src="http://1.bp.blogspot.com/-2c2yPOmcIHc/TxxSZ3LvlZI/AAAAAAAABNs/CzlqIECzxOg/s320/Many2many+relationship+still+problem.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;3) In this final step i've added the Many2Many relationship to the cube. The Product and Category dimension now has a Many2Many relationship with Order.&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-hfLOUWWqN-w/TxxOI_tThQI/AAAAAAAABNE/skWmemrptGs/s1600/Endsolution.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="163" nfa="true" src="http://4.bp.blogspot.com/-hfLOUWWqN-w/TxxOI_tThQI/AAAAAAAABNE/skWmemrptGs/s320/Endsolution.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;The dimensions of the Orders starschema has an impact on the measures of OrderLines.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-nFuYyIPsaQk/TxxTGSaH7WI/AAAAAAAABN0/qQsPQP9NMVE/s1600/endsolution2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="233" src="http://2.bp.blogspot.com/-nFuYyIPsaQk/TxxTGSaH7WI/AAAAAAAABN0/qQsPQP9NMVE/s320/endsolution2.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;And now the dimensions of the OrderLines starschema has an impact on the measures of&amp;nbsp; the Orders starschema. &lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-sc6ztEbomEk/TxxTHMWuX9I/AAAAAAAABN8/UcAZ0CfZfcQ/s1600/endsolution+M2m.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="215" src="http://2.bp.blogspot.com/-sc6ztEbomEk/TxxTHMWuX9I/AAAAAAAABN8/UcAZ0CfZfcQ/s320/endsolution+M2m.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;br /&gt;In this solution i've shown how to connect two starschemas (with a 1:N relation) and how to tune the cube in a way that all dimensions has an impact on the measures on both starschemas. The steps that are needed are:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Create a common dimension (physical or by a fact dimension relationship)&amp;nbsp; that reprensent the 1:N relation between the starschemas.&lt;/li&gt;&lt;li&gt;Create a reference dimension relationship for the dimensions that belong to the 1 Fact (Orders).&lt;/li&gt;&lt;li&gt;Create a Many2Many relationship for the dimensions that belong to the N Fact (OrderLines)&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Greetz,&lt;br /&gt;Hennie&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-7542023731434820587?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/7542023731434820587/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2012/01/ssas-select-facts-with-reference-and.html#comment-form' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/7542023731434820587'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/7542023731434820587'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2012/01/ssas-select-facts-with-reference-and.html' title='SSAS : Select Facts with Reference and Many2Many relationships'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-ngQyi0w50Pk/TxxNvRSlYuI/AAAAAAAABM8/KGgW58L40Bs/s72-c/ReferenceDimensionN1+selection.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-4648391269135260772</id><published>2012-01-17T20:12:00.003+01:00</published><updated>2012-01-18T09:02:34.439+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQLServer'/><title type='text'>Could not update the metadata that indicates database AdventureWorks2008R2 is enabled for Change Data Capture</title><content type='html'>&lt;span style="font-size: large;"&gt;&lt;b&gt;Introduction&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;Currently investigating the CDC in SQL Server 2012 RC0 Denali and i ran into an error, which i want to discuss with you. The error happens when i want to turn on CDC. In this blogpost i'll present the error, a cause of the problem, a solution and conclusion.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;The error&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;The error occurs when i want to execute the following statement:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;EXEC sys.sp_cdc_enable_db&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It returns this error:&lt;br /&gt;&lt;br /&gt;&lt;i style="color: red;"&gt;Could not update the metadata that indicates database AdventureWorks2008R2 is enabled for Change Data Capture. The failure occurred when executing the command 'SetCDCTracked(Value = 1)'. The error returned was 15517: 'Cannot execute as the database principal because the principal "dbo" does not exist, this type of principal cannot be impersonated, or you do not have permission.'. Use the action and error to determine the cause of the failure and resubmit the request.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;Cause of the problem&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;I've downloaded the RC0 databases from the Microsoft site and restored them on my SQL Server 2012 RC0 Denali VM. Then, i executed this stored procedure:&amp;nbsp;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;sys.sp_cdc_enable_db&lt;/span&gt;. In this article, &lt;a href="http://support.microsoft.com/kb/913423"&gt;http://support.microsoft.com/kb/913423&lt;/a&gt;, more information is available. This error message is shown when you are trying to enable CDC on a SQL Server 2008 R2 database for which the owner is not "sa". According to the article, this problem occurs when all the following conditions are true:&lt;br /&gt;• You back up a database from an instance of SQL Server 2005 (e.g. SQLSErver 2008 R2 database). Then, you restore the database to an instance of SQL Server 2005 that is installed on another computer. &lt;br /&gt;• The statement or the module is executed as the dbo (database owner) user.&lt;br /&gt;• The owner of the database is a domain user or a SQL Server authorization login. &lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-iEuXh2EFh_I/TxXG9dqffEI/AAAAAAAABMc/4jWW04jHcJA/s1600/DB+properties+Owner+1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="358" src="http://1.bp.blogspot.com/-iEuXh2EFh_I/TxXG9dqffEI/AAAAAAAABMc/4jWW04jHcJA/s400/DB+properties+Owner+1.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;Solution&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;Execute the following statements: &lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;USE AdventureWorks2008R2&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;EXEC sp_changedbowner 'sa'&lt;/div&gt;&lt;br /&gt;and the database owner changes to sa:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-hp-fi9UCego/TxXG9zNx3ZI/AAAAAAAABMg/4FNqO94qQMY/s1600/DB+properties+Owner+sa.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="358" src="http://4.bp.blogspot.com/-hp-fi9UCego/TxXG9zNx3ZI/AAAAAAAABMg/4FNqO94qQMY/s400/DB+properties+Owner+sa.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-iEuXh2EFh_I/TxXG9dqffEI/AAAAAAAABMc/4jWW04jHcJA/s1600/DB+properties+Owner+1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;And the stored procedure&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt; sys.sp_cdc_enable_db&lt;/span&gt; executes successfully.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;Conclusion&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;In this blogpost a problem is identified with databaseownership of the database and a solution is presented.&lt;br /&gt;&lt;br /&gt;Greetz,&lt;br /&gt;Hennie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-4648391269135260772?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/4648391269135260772/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2012/01/could-not-update-metadata-that.html#comment-form' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/4648391269135260772'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/4648391269135260772'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2012/01/could-not-update-metadata-that.html' title='Could not update the metadata that indicates database AdventureWorks2008R2 is enabled for Change Data Capture'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-iEuXh2EFh_I/TxXG9dqffEI/AAAAAAAABMc/4jWW04jHcJA/s72-c/DB+properties+Owner+1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-2545725166815008746</id><published>2012-01-15T10:10:00.000+01:00</published><updated>2012-01-15T10:27:32.780+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TOGAF'/><category scheme='http://www.blogger.com/atom/ns#' term='Business Intelligence'/><category scheme='http://www.blogger.com/atom/ns#' term='datawarehouse'/><category scheme='http://www.blogger.com/atom/ns#' term='Data'/><title type='text'>BI and Enterprise Architecture (EA)</title><content type='html'>&lt;span style="font-size: large;"&gt;&lt;b&gt;Introduction&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;In some linkedin groups I was reading about that BI should be a Enterprise Architecture (EA) implementation for organizations and i was curious what is meant by that. What is an Enterprise Architecture implementation and how can BI be a part of it? So in order to understand more about the implementation of a Enterprise Architecture i decided to study TOGAF. Currently studying for the Foundation certification (level 1) and it's a huge book (sigh!).&amp;nbsp; It takes a lot of time to understand the methodology, the phases, terminology, keywords, etc. But interesting though!&lt;br /&gt;&lt;br /&gt;TOGAF is well-known Enterprise Architecture Framework and can be seen as a tool for assisting in acceptance, production, use and maintanance of enterprise architecture. In this blogpost i'm trying to translate the TOGAF framework to a plan to implement BI as an Enterprise Architecture.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;b&gt;Enterprise Architecture according to TOGAF&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;So what is an Enterprise Architecture? What is an Enterprise? What is a Architecture?&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Definition Enterprise:&lt;/b&gt; "&lt;i&gt;Collections of organizations that has a common set of goals&lt;/i&gt;". &amp;nbsp;Organizations are getting smaller and are functioning in neworkorganizations. Think about an airliner that farms out the luggage handling or ticket selling. Therefore in case of network organizations you should look beyond the boundaries of an organization.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Definition Architecture&lt;/b&gt; (ISO) : "&lt;i&gt;The fundamental organization of a system, embodied in its components, their relationships to each other and the environment and the principles governing its design and evolution&lt;/i&gt;".&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://searchcio.techtarget.com/definition/enterprise-architecture"&gt;Defintion Enterprise Architecture (SearchIO):&lt;/a&gt; &lt;/b&gt;"&lt;i&gt;An enterprise architecture (EA) is a conceptual blueprint that defines the structure andoperation of an organization. The intent of an enterprise architecture is to determine how anorganization can most effectively achieve its current and future objectives&lt;/i&gt;."&lt;br /&gt;&lt;br /&gt;TOGAF makes also a distinction between an architecture and a solution. The distinction is that a architecture is like a blueprint of the organization and a solution is like an instance of the architecture. You could compare these between a logical model and physical model (in my opinion). &lt;br /&gt;&lt;br /&gt;There are four points of views regarding TOGAF :&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;Business perspective&lt;/i&gt;. The business perspective defines the processes andstandards by which the business operates on a day-to-day basis.&lt;/li&gt;&lt;li&gt;&lt;i&gt;Application perspective.&lt;/i&gt; The application perspective definesthe interactions among the processes and standards used by the organization. &lt;/li&gt;&lt;li&gt;&lt;i&gt;Informationperspective&lt;/i&gt;.The informationperspective defines and classifies the raw data (such as document files, databases, images,presentations, and spreadsheets) that the organization requires in order to efficiently operate.&lt;/li&gt;&lt;li&gt;&lt;i&gt;Technology perspective&lt;/i&gt;. The technology perspective defines the hardware, operating systems, programming, and networkingsolutions used by the organization. &lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;/ul&gt;In an Enterprise Architecture framework all of these viewpoints are worked out: a baseline is created, a target architecture, gap analysis, a roadmap, review and an implementation is executed.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;b&gt;Translate TOGAF to BI (or BI to TOGAF)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;Generally spoken, there is low interest in BI projects regarding working from within an Enterprise Architecture viewpoint. In&amp;nbsp; most of my projects done the solution is targeted at a certain area of interest: for instance finance. Another issue is that BI projects are under time pressure meaning that BI projects are driven by need for a solution for more or less a specific problem and clients wants it fast.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-92WSMGDoxk4/TwsvGzzmRzI/AAAAAAAABMU/iB30ZuDfgDU/s1600/TOGAF+four+domains.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="178" src="http://2.bp.blogspot.com/-92WSMGDoxk4/TwsvGzzmRzI/AAAAAAAABMU/iB30ZuDfgDU/s400/TOGAF+four+domains.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;I don't think about BI as an holistic Enterprise Architecture approach but more as part of the Enterprise Architecture. The ideal situation would be that BI is part of a Enterprise Architecture Program where BI should be adopted at all kind of different levels of the enterprise internally and externally &amp;nbsp;(think about the network organisations).&lt;br /&gt;&lt;br /&gt;Where is BI positioned in TOGAF? You need to understand the business perspective (baseline and target) and you need to understand how BI could aid the target business perspective in such a way that it can benefit from BI. And BI is much about data and there the data perspective is also specific area of interest in case of BI.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;The BI Enterprise Architecture can be positioned on the business perspective and on the data pespective of the TOGAF Framework. The BI Enterprise Architect must understand both perspectives and should be aware and understand the overall Enterprise Architecture picture (baseline and target in order to make a flexible, easy to replace building and easy to maintain (BI?) architecture and solution building blocks (ABB and SBB).&lt;br /&gt;&lt;br /&gt;Make sure business intelligence is a core part of your Enterprise Architecture Planning!&lt;br /&gt;&lt;br /&gt;Greetz,&lt;br /&gt;Hennie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-2545725166815008746?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/2545725166815008746/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2011/12/bi-and-enterprise-architecture-ea.html#comment-form' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/2545725166815008746'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/2545725166815008746'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2011/12/bi-and-enterprise-architecture-ea.html' title='BI and Enterprise Architecture (EA)'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-92WSMGDoxk4/TwsvGzzmRzI/AAAAAAAABMU/iB30ZuDfgDU/s72-c/TOGAF+four+domains.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-5586900029330845409</id><published>2012-01-08T21:25:00.000+01:00</published><updated>2012-01-13T13:13:28.373+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Business Intelligence'/><category scheme='http://www.blogger.com/atom/ns#' term='SSIS'/><category scheme='http://www.blogger.com/atom/ns#' term='SQLServer'/><title type='text'>SQL Server Data Quality Services Cliensing component</title><content type='html'>&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;b&gt;Introduction&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In a &lt;a href="http://bifuture.blogspot.com/2011/12/data-quality-services-dqs-in-sql-server.html"&gt;former post&lt;/a&gt; I already introduced the DQS Quality Client and the installation of DQS of &amp;nbsp;SQL Server 2012 &amp;nbsp;RC0 Denali. The main advantage of DQS lies in the usage of the SSIS DQS component&amp;nbsp; "DQS Cleansing" in SQL Server Integration Services. You can implement the DQS component in an ETL process in order to cleanse the information from source systems.&lt;br /&gt;&lt;br /&gt;James Beresford investigated already the performance of the DQS component and it seems that usage of the component cost quite some performance and therefore you shouldn't use it on a large tables (yet?). &lt;br /&gt;&lt;br /&gt;You can find more info, here:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.bimonkey.com/2011/09/sql-server-data-quality-services-ssis/"&gt;Blog BIMonkey (part I)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.bimonkey.com/2011/12/sql-server-data-quality-services-in-sql2012-rc0-part-1/"&gt;Blog BIMonkey (part II)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://blogs.msdn.com/b/dqs/archive/2011/07/18/using-the-ssis-dqs-cleansing-component.aspx"&gt;Using the SSIS DQS Cleansing Component&amp;nbsp;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;This blogpost is based on SQL Server 2012 RC0 Denali.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;DQS Cleansing component&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;In this blogpost i'll discover the DQS SSIS component. I'll show you the steps that i took in order to build a SSIS package with the DQS Cleansing component. The first thing i did was creating a package and a drop the DQS Cleansing component on the pane.&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://1.bp.blogspot.com/-H2T7GiR6jZI/TwSm5suB9bI/AAAAAAAABJw/cxdBXcV-tO4/s1600/DQS+cliening.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="183" src="http://1.bp.blogspot.com/-H2T7GiR6jZI/TwSm5suB9bI/AAAAAAAABJw/cxdBXcV-tO4/s320/DQS+cliening.png" width="320" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;An input stream and an output stream is needed.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://3.bp.blogspot.com/-BnIMiwP3BJY/TwSocmTJ8sI/AAAAAAAABJ8/48ADEuI3oDc/s1600/DQS+Cleansing+Transformation+Editor.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="293" src="http://3.bp.blogspot.com/-BnIMiwP3BJY/TwSocmTJ8sI/AAAAAAAABJ8/48ADEuI3oDc/s320/DQS+Cleansing+Transformation+Editor.png" width="320" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;With the source- and the destination assistent you can create a source and destination adapter. When i double click on the server for connecting to the Knowledge base an error occurs.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://2.bp.blogspot.com/-zVF_hjjM514/TwSor1l3YTI/AAAAAAAABKQ/saOgZ9inIVQ/s1600/Error+while+selecting+Servername.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="221" src="http://2.bp.blogspot.com/-zVF_hjjM514/TwSor1l3YTI/AAAAAAAABKQ/saOgZ9inIVQ/s320/Error+while+selecting+Servername.png" width="320" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;I tried some some potential solutions like reopening the component and reopening the package. This didn't help. So i decided to reboot SQL Server instance and the error disappeared.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://2.bp.blogspot.com/-eAtkR1cTGmc/TwSpAT7-V2I/AAAAAAAABKY/ZZq_reFuuSQ/s1600/Select+servername.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="126" src="http://2.bp.blogspot.com/-eAtkR1cTGmc/TwSpAT7-V2I/AAAAAAAABKY/ZZq_reFuuSQ/s320/Select+servername.png" width="320" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;Connection succeeded:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://3.bp.blogspot.com/-I6qjg4OZjj8/TwSpO9yCX6I/AAAAAAAABKk/fVBtAt5pTBA/s1600/Server+Local.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="294" src="http://3.bp.blogspot.com/-I6qjg4OZjj8/TwSpO9yCX6I/AAAAAAAABKk/fVBtAt5pTBA/s320/Server+Local.png" width="320" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;Something is wrong here. After some adjustments and clicking the test connection button i ran in an error, again. The error below is shown when the test connection button in the connection manager is pressed. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://4.bp.blogspot.com/-fFJ2FgVfT-s/TwSs00lKINI/AAAAAAAABKw/NcpxF0Afwyc/s1600/Error+DQS+connection+manager.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="252" src="http://4.bp.blogspot.com/-fFJ2FgVfT-s/TwSs00lKINI/AAAAAAAABKw/NcpxF0Afwyc/s320/Error+DQS+connection+manager.png" width="320" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;Again, I restarted the SQL Server service and now it seems to be working again. Next,&amp;nbsp; i'm setting up the mapping.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://3.bp.blogspot.com/-VfgPEUqIeGI/TwSxNExLk_I/AAAAAAAABLA/3bSzZm7hQLI/s1600/Tab+Mapping.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="293" src="http://3.bp.blogspot.com/-VfgPEUqIeGI/TwSxNExLk_I/AAAAAAAABLA/3bSzZm7hQLI/s320/Tab+Mapping.png" width="320" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;Below the tab with some checkboxes.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://2.bp.blogspot.com/-0mNGxo-Pno8/TwSxMWqCN6I/AAAAAAAABK8/CsisCNn-c1U/s1600/Tab+advanced.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="294" src="http://2.bp.blogspot.com/-0mNGxo-Pno8/TwSxMWqCN6I/AAAAAAAABK8/CsisCNn-c1U/s320/Tab+advanced.png" width="320" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;In the destination adaptersome fields are not listed in the SSIS pipeline.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://2.bp.blogspot.com/-P33ykzhBHLM/TwSx2oPLQ_I/AAAAAAAABLQ/HJ1L3AdyntI/s1600/OLEDB+destination.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://2.bp.blogspot.com/-yVif9XjWLwk/TwSydRW4-eI/AAAAAAAABLs/ulbhpR0ydto/s1600/OLEDB+destination.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="313" src="http://2.bp.blogspot.com/-yVif9XjWLwk/TwSydRW4-eI/AAAAAAAABLs/ulbhpR0ydto/s320/OLEDB+destination.png" width="320" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;I remembered that on the advanced tab there were some checkboxes: Confidence and Reason. I enabled this checkboxes.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://1.bp.blogspot.com/-BRPdNtrNiPc/TwSycXWhfWI/AAAAAAAABLg/JKqsMNutt1w/s1600/Enable+confidence+and+reason.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="295" src="http://1.bp.blogspot.com/-BRPdNtrNiPc/TwSycXWhfWI/AAAAAAAABLg/JKqsMNutt1w/s320/Enable+confidence+and+reason.png" width="320" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;Now these fields are selectable in the Destination adapater.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://3.bp.blogspot.com/-GlffL_UwXj8/TwSybsAjtLI/AAAAAAAABLc/JeM-OhIxr0w/s1600/Result+Conf+and+reason+check.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="313" src="http://3.bp.blogspot.com/-GlffL_UwXj8/TwSybsAjtLI/AAAAAAAABLc/JeM-OhIxr0w/s320/Result+Conf+and+reason+check.png" width="320" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;Below you can see the new progress icons. Nice!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://1.bp.blogspot.com/-QOfAH3YXC6M/TwS0-kekksI/AAAAAAAABME/VI3NLN3Qt98/s1600/new+progress+flow.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://1.bp.blogspot.com/-QOfAH3YXC6M/TwS0-kekksI/AAAAAAAABME/VI3NLN3Qt98/s320/new+progress+flow.png" width="228" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Finished and succeeded&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://1.bp.blogspot.com/-0Rt4TcFRyyQ/TwSyzcGi4UI/AAAAAAAABL4/x3k5awpN_5s/s1600/success.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://1.bp.blogspot.com/-0Rt4TcFRyyQ/TwSyzcGi4UI/AAAAAAAABL4/x3k5awpN_5s/s320/success.png" width="310" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;And below you can see the result of this little exercise.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-ijvlu-X5CW8/TwS1czDs72I/AAAAAAAABMM/sS4503Ghn-g/s1600/result+DQS+cleansing+component.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="110" src="http://3.bp.blogspot.com/-ijvlu-X5CW8/TwS1czDs72I/AAAAAAAABMM/sS4503Ghn-g/s320/result+DQS+cleansing+component.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;This seems an useful component of SSIS but when i read the blogs of James Beresford i'm getting less enthusiastic. The main reason is the perfomance of the DQS component. He calculates that for instance 1 million rows will take about 4 hours of loading and that is not acceptable in my opinion. In &lt;a href="http://www.bimonkey.com/2012/01/sql-server-data-quality-services-in-sql2012-rc0-part-2/"&gt;an other blogpost&lt;/a&gt; he states that performance can be optimized by parallelism but it's still not very usable for large tables (dimensions).&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;In my current project i'm working with a 2 million customer table (dimension) and this seems too large for this DQS SSIS component. So James advices to use the DQS for midsized tables. In my assumption this is like around 100 K - 500K rows.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;There is some work to do for the development team:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;The error connecting to the Server.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;Hopefully they can improve the performance to higher level&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Greetz,&lt;br /&gt;Hennie&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-5586900029330845409?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/5586900029330845409/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2012/01/sql-server-data-quality-services-dqs.html#comment-form' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/5586900029330845409'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/5586900029330845409'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2012/01/sql-server-data-quality-services-dqs.html' title='SQL Server Data Quality Services Cliensing component'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-H2T7GiR6jZI/TwSm5suB9bI/AAAAAAAABJw/cxdBXcV-tO4/s72-c/DQS+cliening.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-1314671545353549091</id><published>2011-12-21T22:00:00.000+01:00</published><updated>2011-12-21T22:00:01.208+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Best practices'/><category scheme='http://www.blogger.com/atom/ns#' term='SSAS'/><category scheme='http://www.blogger.com/atom/ns#' term='SQLServer'/><category scheme='http://www.blogger.com/atom/ns#' term='Selfservice BI'/><title type='text'>SSAS : Change management in ten steps</title><content type='html'>&lt;span style="font-size: large;"&gt;&lt;b&gt;Introduction&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;In my current project i'm&amp;nbsp;developing a&amp;nbsp;cube. In this Self Service BI project&amp;nbsp;i'm cooperating with Self Service BI teams, IT and end users, in order to build successful dashboards, trends and statusreports. Because of the different&amp;nbsp;progress of the teams, &amp;nbsp;the client wants a partial deployment of the cube. Therefore, I had a challenge because it isn't possible to deploy a cube partially easily, unfortunately. So far i haven't found anything that could do this. No 3rd party software seems to be available. So i had to come up with a pragmatic solution.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;b&gt;Situation&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;/span&gt;Suppose you have the following situation. There are a couple of stars in a development, acceptance and production environment (this is my current situation). The stars in the diagram below represents starschemas. The blue stars were equal between the different environments at a certain moment (t0). So the first blue star in the development area is equal to first blue star in the acceptance area and is equal to the first star in the production environment. So at one point in time the blue stars were equal. But, as time went on, some dimensions were added to the stars in the development area, new stars were created and some measures changed (t1). These are represented by the red lines. The red lines indicates&amp;nbsp;a change or is new in relation to the initial situation. The diagram below is snapshot at some point in time. Some dimensions were transferred to the acceptance area, a new star has been developed in the dvelopment area and production is still equal to initial situation.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-wcfeDbJY01A/Tuj5U-hExNI/AAAAAAAABIk/uZP4i1-svVE/s1600/OAP+Street.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="291" oda="true" src="http://4.bp.blogspot.com/-wcfeDbJY01A/Tuj5U-hExNI/AAAAAAAABIk/uZP4i1-svVE/s400/OAP+Street.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;So how are you going to manage this? Well with caution, i can tell you.&amp;nbsp;As said earlier the problem is the cube. The cube file is an XML file and an idea could be transferring pieces of the XML file (snippets) but in my opinion a 'big' risk and you need a thorough understanding of the structure of the XML file. I decided to solve this with manual actions and some features of BIDS helper. Below i'm going to show you how i did this.&lt;br /&gt;&lt;br /&gt;I'm not using all the fancy stuff of a SSAS cube. I've created stars with facts and dimensions, measures (with measure groups, some calculations in the cube and a some security roles. In the solution below i'll focus on the facts, dimensions and the measures.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;b&gt;Solution&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;Below are the steps written that was needed for a successful implementation of&amp;nbsp;a piece&amp;nbsp;of a cube in new environment. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;1. Compare the database with database diff tool (SQL compare, Apex).&lt;/b&gt;&lt;br /&gt;In case you didn't keep track of changes in a source control software you can use a diff tool to compare databases and move the different parts to the new environment. Copy the change script into a separate folder and create a deployment script. This will be used when the code of the acceptance environment is transferred to production.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;2. Load the tables in the acceptance environment.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;3. Start SSAS and refresh the datasource view.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;4. &lt;/b&gt;&lt;b&gt;Copy the dimensionfiles form the SSAS project&amp;nbsp;&lt;/b&gt;&lt;br /&gt;After refreshing the datasourceview copy the dimensionfiles in the development environment and&amp;nbsp;add (add exisiting item) &amp;nbsp;them to the SSAS project in the acceptance environment. The dimensions are just files in&amp;nbsp;he SSAS&amp;nbsp;project.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-Rcfx3X97VqY/TukCAnu0nWI/AAAAAAAABJM/Bfzuhw8rJTQ/s1600/Dimensionfiles+copy.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" oda="true" src="http://2.bp.blogspot.com/-Rcfx3X97VqY/TukCAnu0nWI/AAAAAAAABJM/Bfzuhw8rJTQ/s1600/Dimensionfiles+copy.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The case that dimensions are stored in separate files is a big advantage because&amp;nbsp;manual creating dmension in the SSAS project&amp;nbsp;will&amp;nbsp;very likely lead to errors. One error and a report will not work.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;5. Manually change the relations in the dimension usage tab&lt;/b&gt;.&lt;br /&gt;Make the appropriate changes. Experience&amp;nbsp;learn that this an erroneous process because when a lot of dimensions and measuregroups are present it's difficult to overview the whole project. In the beginning you have to work iterative with the BIDShelper 'Printer friendly Dimension Usage' export. This explained in the following paragraph.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;6. Use BIDSHelper and especially the option 'Printer Friendly Dimension Usage&lt;/b&gt;'.&lt;br /&gt;This option prints a definition of the cube. You can find this in the context menu when you click on a cube.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-rFkgVM0UVMU/TukBxPVW3AI/AAAAAAAABI0/1io_ztRTohs/s1600/Printer+Firenly+dimension+uasge.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" oda="true" src="http://4.bp.blogspot.com/-rFkgVM0UVMU/TukBxPVW3AI/AAAAAAAABI0/1io_ztRTohs/s320/Printer+Firenly+dimension+uasge.png" width="191" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;It will show the following window.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-1ffudfNMi7M/TukB3wcjguI/AAAAAAAABI8/4CQ2-e-gL_Y/s1600/Dimension+usage+printer+friendly.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="172" oda="true" src="http://4.bp.blogspot.com/-1ffudfNMi7M/TukB3wcjguI/AAAAAAAABI8/4CQ2-e-gL_Y/s320/Dimension+usage+printer+friendly.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;And very useful is the export to excel. This enhances the comparison between two SSAS projects in the Development and Acceptanceenvironment.&lt;/div&gt;&lt;div align="left" class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-vN7Eu5fio-Y/TukB9POwwDI/AAAAAAAABJE/MnrPyi_fneY/s1600/Export+to+excel.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="172" oda="true" src="http://4.bp.blogspot.com/-vN7Eu5fio-Y/TukB9POwwDI/AAAAAAAABJE/MnrPyi_fneY/s320/Export+to+excel.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;7. There is also a 'Smart Diff'&amp;nbsp;&amp;nbsp;option available.&lt;/b&gt; This option compares two .cube files and analyzes the differences. You need to install Visual Studio Team System 2008 Team explorer (384 MB!) to get this working (in my case).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-Nf1vMvZ1EcY/TukBuTVjh7I/AAAAAAAABIs/Ydv0EO52iCw/s1600/Smartdiff+VS.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" oda="true" src="http://2.bp.blogspot.com/-Nf1vMvZ1EcY/TukBuTVjh7I/AAAAAAAABIs/Ydv0EO52iCw/s320/Smartdiff+VS.png" width="195" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Below a screendump of a comparison between two cubes.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-NBUz2m5jXy0/TukG1Z0Ym0I/AAAAAAAABJU/g6z6OFMHt54/s1600/Smartdiff.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="190" oda="true" src="http://3.bp.blogspot.com/-NBUz2m5jXy0/TukG1Z0Ym0I/AAAAAAAABJU/g6z6OFMHt54/s320/Smartdiff.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Look for changes in the measures:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-OUptkKEUcFM/Tu5G1NjxmgI/AAAAAAAABJc/NG-ntgpkJSw/s1600/smartdiff+measures.png" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="101" src="http://4.bp.blogspot.com/-OUptkKEUcFM/Tu5G1NjxmgI/AAAAAAAABJc/NG-ntgpkJSw/s400/smartdiff+measures.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;8. Compare the dimensions in SSAS too&lt;/b&gt;&lt;br /&gt;We ran in one problem that a report didn't work in the acceptance environment but did work in the development environment. Checked the cube again, try to debug the report and we were getting strange errors. Then i remembered that&amp;nbsp; i changed the hierarchies in the existing dimensions (and we didn't moved them to the acceptance environment). So compare all dimensions of a star too with Smartdiff.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;9. Process!&lt;/b&gt;&lt;br /&gt;If the comparison of the cubes between development and production is successful the cube is ready for processing. Hopefully the process will succeed now. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;10. Move from acceptance to production&lt;/b&gt;&lt;br /&gt;When all scripts are gathered and are stored in a proper place, collect them and execute it on a production environment. Load the tables again and deploy the acceptance project on production and process the cube. Don't forget to set the right datasource connectionstrings. If you have a large cube deploy the cube to a test cube (in production) first. This way you can test whether the process of the cube&amp;nbsp;is successful and this will not interfere with the productioncube. An option could be renaming the cube in order to minimize the downtime (didn't test this).&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;Conclusion&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;In this blogpost i've explained a &lt;i&gt;partial&lt;/i&gt; deployment of SSAS cube from the development environment into the acceptance environment and production environment. This a manual process and there is no standard functionality available to deploy a cube partially. Most of the steps can be done by copying databasecode, dimension files and refreshing the datasourceview. The main problem is updating the cube, itself. That is a labour-intensive process.&lt;br /&gt;&lt;br /&gt;I do realize that the method is not 100% accurate but for my current project it is sufficient for now.&lt;br /&gt;&lt;br /&gt;If you have remarks about this approach let me know.&lt;br /&gt;&lt;br /&gt;Greetz,&lt;br /&gt;&lt;br /&gt;Hennie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-1314671545353549091?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/1314671545353549091/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2011/12/ssas-change-management-in-ten-steps.html#comment-form' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/1314671545353549091'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/1314671545353549091'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2011/12/ssas-change-management-in-ten-steps.html' title='SSAS : Change management in ten steps'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-wcfeDbJY01A/Tuj5U-hExNI/AAAAAAAABIk/uZP4i1-svVE/s72-c/OAP+Street.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-8006438738145967282</id><published>2011-12-17T21:30:00.000+01:00</published><updated>2012-01-13T13:13:59.058+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Denali'/><category scheme='http://www.blogger.com/atom/ns#' term='SQLServer'/><title type='text'>Installation of SQL Server 2012 RC0</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;b&gt;Introduction&lt;/b&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;In my former post about the installation of SQL Server 2012 CTP1 (Denali) i wrote down a walkthrough of the installation process of SQL Server 2012 CTP1 (Denali) . In this post i'll&amp;nbsp; blog about the same walkthrough but for RC0. I'll show you some differences, an error and how to solve this error.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;b&gt;Installation&amp;nbsp;&lt;/b&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;The installation starts with downloading the software from Microsoft. Copy this in a folder and execute SQLFull_x86_ENU_Install.exe.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;img border="0" height="42" mda="true" src="http://3.bp.blogspot.com/-lKRSTbslG4Q/TuJvx63hRyI/AAAAAAAABAs/vmVGEOQme68/s320/RC0+install+part+0.png" width="320" /&gt;&lt;/div&gt;&lt;br /&gt;After clicking on the .exe file the extraction starts&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-dIcfZWXeo5E/TuJv1EPzSVI/AAAAAAAABA0/J7-hk41OhvY/s1600/RC0+install+part+1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="86" mda="true" src="http://2.bp.blogspot.com/-dIcfZWXeo5E/TuJv1EPzSVI/AAAAAAAABA0/J7-hk41OhvY/s320/RC0+install+part+1.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The content of the folder created:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-RePbMjJc5zs/TuJv7MBhOvI/AAAAAAAABA8/lMfmGoG0bHk/s1600/RC0+install+part+2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="139" mda="true" src="http://1.bp.blogspot.com/-RePbMjJc5zs/TuJv7MBhOvI/AAAAAAAABA8/lMfmGoG0bHk/s320/RC0+install+part+2.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Starting setup will show this window:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-IZVG4YNN4ck/TuJv8kHfGWI/AAAAAAAABBE/oHdtXwdxOFI/s1600/RC0+install+part+3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="286" mda="true" src="http://4.bp.blogspot.com/-IZVG4YNN4ck/TuJv8kHfGWI/AAAAAAAABBE/oHdtXwdxOFI/s320/RC0+install+part+3.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Click on installation.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-KROwYVa6tWU/TuJwELzDRYI/AAAAAAAABBU/vkTb9QZrBIk/s1600/RC0+install+part+4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="286" mda="true" src="http://4.bp.blogspot.com/-KROwYVa6tWU/TuJwELzDRYI/AAAAAAAABBU/vkTb9QZrBIk/s320/RC0+install+part+4.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The next window appears.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-JfHIJvzdqGg/TuJwFrD-CDI/AAAAAAAABBc/-YEFO9W0GfI/s1600/RC0+install+part+5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240" mda="true" src="http://4.bp.blogspot.com/-JfHIJvzdqGg/TuJwFrD-CDI/AAAAAAAABBc/-YEFO9W0GfI/s320/RC0+install+part+5.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Press ok.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-3IGb4eeJaeE/TuJwHnJoAwI/AAAAAAAABBk/yyjsPtVbl5E/s1600/RC0+install+part+6.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="239" mda="true" src="http://1.bp.blogspot.com/-3IGb4eeJaeE/TuJwHnJoAwI/AAAAAAAABBk/yyjsPtVbl5E/s320/RC0+install+part+6.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The next window.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-R82ZEHldk7k/TuJwJYxfecI/AAAAAAAABBs/DNmGpjtbUc4/s1600/RC0+install+part+7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240" mda="true" src="http://3.bp.blogspot.com/-R82ZEHldk7k/TuJwJYxfecI/AAAAAAAABBs/DNmGpjtbUc4/s320/RC0+install+part+7.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The set up role window.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-tKqlDEsipxM/TuJwLUNMbvI/AAAAAAAABB0/rdWUF1Ncc04/s1600/RC0+install+part+8.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240" mda="true" src="http://2.bp.blogspot.com/-tKqlDEsipxM/TuJwLUNMbvI/AAAAAAAABB0/rdWUF1Ncc04/s320/RC0+install+part+8.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Clicking on the features. Select all.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-b8jiSxinlKE/TuJwNXePDTI/AAAAAAAABB8/0xGz6xQr_aQ/s1600/RC0+install+part+9.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="236" mda="true" src="http://2.bp.blogspot.com/-b8jiSxinlKE/TuJwNXePDTI/AAAAAAAABB8/0xGz6xQr_aQ/s320/RC0+install+part+9.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;And when i press the following error occurs. The installation of CTP1 wasn't that big and it seems that there is about 2 GB more software now than CTP1.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-DB1RQl_F-3M/TuJwOcz6-EI/AAAAAAAABCE/6ir9IyzV9bU/s1600/RC0+install+part+10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="236" mda="true" src="http://4.bp.blogspot.com/-DB1RQl_F-3M/TuJwOcz6-EI/AAAAAAAABCE/6ir9IyzV9bU/s320/RC0+install+part+10.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Enlarge the disk in VM and off we go..&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-CUIpvh-1D4s/TuJwP9yfIQI/AAAAAAAABCM/eqloCtGfT-M/s1600/RC0+install+part+11.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240" mda="true" src="http://1.bp.blogspot.com/-CUIpvh-1D4s/TuJwP9yfIQI/AAAAAAAABCM/eqloCtGfT-M/s320/RC0+install+part+11.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Server configuration window:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-UBXW_80-kro/TuJwR82cK9I/AAAAAAAABCU/v5G15-QIi7E/s1600/RC0+install+part+12.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240" mda="true" src="http://1.bp.blogspot.com/-UBXW_80-kro/TuJwR82cK9I/AAAAAAAABCU/v5G15-QIi7E/s320/RC0+install+part+12.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;Then an error happens.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-Vk01tN4bWq8/TuJwWyvohDI/AAAAAAAABCk/c-h89To5t9E/s1600/RC0+install+part+13.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="89" mda="true" src="http://3.bp.blogspot.com/-Vk01tN4bWq8/TuJwWyvohDI/AAAAAAAABCk/c-h89To5t9E/s320/RC0+install+part+13.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;On &lt;a href="http://sqlblog.com/blogs/aaron_bertrand/archive/2011/11/19/sql-server-2012-a-couple-of-notes-about-installing-rc0.aspx"&gt;Aaron Bertrand's blog&lt;/a&gt; i understand that the distributed replay controller and client is the problem because it needs an Active Directory to verify the account. The account i've entered was a local account and I don't have AD installed. Below the error:&lt;br /&gt;&lt;br /&gt;&lt;div align="left"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;SQL Server Setup has encountered the following error: There was a failure to validate setting CTLRUSERS in validaton function ValidateUsers. Error code 0x85640004. &lt;/span&gt;&lt;/div&gt;&lt;div align="left"&gt;&lt;br /&gt;So i corrected the error by deselecting the replay controller and client&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-5cNjk7Xsjco/TuJwYgcTJgI/AAAAAAAABCs/4S-E8b5Jcbs/s1600/RC0+install+part+14.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240" mda="true" src="http://3.bp.blogspot.com/-5cNjk7Xsjco/TuJwYgcTJgI/AAAAAAAABCs/4S-E8b5Jcbs/s320/RC0+install+part+14.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;And now we seems to have more success&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/--IdrMWHOZSY/TuJxAOYB24I/AAAAAAAABC0/2Gsdy6ZV_q4/s1600/RC0+install+part+15.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" mda="true" src="http://4.bp.blogspot.com/--IdrMWHOZSY/TuJxAOYB24I/AAAAAAAABC0/2Gsdy6ZV_q4/s320/RC0+install+part+15.png" width="275" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The installation process starts and succeeded&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-zcn8xefK9_s/TuJz_zcH_cI/AAAAAAAABC8/FRMofSmnALY/s1600/RC0+install+part+16.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240" mda="true" src="http://1.bp.blogspot.com/-zcn8xefK9_s/TuJz_zcH_cI/AAAAAAAABC8/FRMofSmnALY/s320/RC0+install+part+16.png" width="320" /&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Nothing news about the installation, only there is an error when the reply software is selected and a lot more space is needed in contrast with CTP1.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Hennie&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-8006438738145967282?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/8006438738145967282/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2011/12/installation-of-sql-server-2012-rc0.html#comment-form' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/8006438738145967282'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/8006438738145967282'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2011/12/installation-of-sql-server-2012-rc0.html' title='Installation of SQL Server 2012 RC0'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-lKRSTbslG4Q/TuJvx63hRyI/AAAAAAAABAs/vmVGEOQme68/s72-c/RC0+install+part+0.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-3312093541926540668</id><published>2011-12-12T19:06:00.000+01:00</published><updated>2011-12-12T21:18:09.758+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Denali'/><category scheme='http://www.blogger.com/atom/ns#' term='SSIS'/><category scheme='http://www.blogger.com/atom/ns#' term='SQLServer'/><title type='text'>Data Quality Services (DQS) in SQL Server 2012 (Denali) RC0</title><content type='html'>&lt;span style="font-size: large;"&gt;&lt;b&gt;Introduction&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;One subject that I'm interested in is Data Quality Services together with the features like Master Data Services. In this blogpost i'll try to discover the basics of DQS. I investigated this feature in CTP1 already&amp;nbsp;but it wasn't ready yet, unfortunately. In CTP 3 (and RC0) the DQS seems more and more a finished product and i think it's time to discover some of the features in this post.&lt;br /&gt;&lt;br /&gt;DQS is all about the quality of data in databases. The reason why this is a interesting feature, is that it can be used in a ETL for a datawarehouse. If a source system has a lack of good dataquality, DQS can improve the quality of data during the load into the datawarehouse.&lt;br /&gt;&lt;br /&gt;On &lt;a href="http://blogs.msdn.com/b/dqs/archive/2011/07/17/installing-and-configuring-data-quality-services.aspx"&gt;MSDN&lt;/a&gt; i learn that DQS contains three technical components:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;DQS Server.&lt;/b&gt;&amp;nbsp; Two databases :&lt;/li&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;DQS_MAIN&lt;/b&gt;. DQS_MAIN db contains all the DQS stored procedures, its engine and the published knowledge bases. &lt;/li&gt;&lt;li&gt;&lt;b&gt;DQS_PROJECTS&lt;/b&gt;. The DQS_PROJECTS db contains all the data quality projects information.&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;b&gt;DQS client.&lt;/b&gt; The DQS client is a standalone application that enables you to connect to a DQS server, providing you with a GUI to perform your data-cleansing tasks, as well as other administrative tasks related to DQS.&lt;/li&gt;&lt;li&gt;&lt;b&gt;DQS Cleansing SSIS&lt;/b&gt;. The DQS Cleansing SSIS component enables you to integrate the DQS functionality into an SSIS data flow, for batch execution.&lt;/li&gt;&lt;/ul&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;Installation&lt;/span&gt;&lt;/b&gt; &lt;br /&gt;&lt;br /&gt;&lt;b&gt;1. Install DQS Server &lt;/b&gt;&lt;br /&gt;The first thing we have to execute is installing the Data Quality Server. The installer seems to be available in the start menu. A more obvious place would be the installer of SQL Server 2012 but perhaps this is a temporary solution.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-kSlQHN-l8j4/TuT41ld6mlI/AAAAAAAABDU/lOjKPk6-z1I/s1600/DQS1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-kSlQHN-l8j4/TuT41ld6mlI/AAAAAAAABDU/lOjKPk6-z1I/s1600/DQS1.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;A master key is needed for installing.&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-XtEHrkGnhLI/TuT4W-p5G4I/AAAAAAAABDE/R6A1jEyF814/s1600/DQS2+Master+key.png" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="197" src="http://4.bp.blogspot.com/-XtEHrkGnhLI/TuT4W-p5G4I/AAAAAAAABDE/R6A1jEyF814/s400/DQS2+Master+key.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;And a succes is reported:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-E1xs1BJTIq8/TuT7KTIg7qI/AAAAAAAABDc/Ie-mEImqEFg/s1600/DQS3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="233" src="http://2.bp.blogspot.com/-E1xs1BJTIq8/TuT7KTIg7qI/AAAAAAAABDc/Ie-mEImqEFg/s400/DQS3.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Let's start the&amp;nbsp; SQL Server Management Studio and see whether the databases have been installed:&lt;br /&gt;&lt;br /&gt;And.....&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-PaN5Fsz49-4/TuUBsysSVYI/AAAAAAAABDk/SFEp4_qcW9E/s1600/DQS4+Three+DBs.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-PaN5Fsz49-4/TuUBsysSVYI/AAAAAAAABDk/SFEp4_qcW9E/s1600/DQS4+Three+DBs.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;There seems to be another database present : DQS_STAGING_DATA. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;2. Grant DQS roles&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;According to the video i need to grant a user administrator rights.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-kqDAufYRuXU/TuUDgS4FsYI/AAAAAAAABDs/JAcQA5LbvyY/s1600/DQS5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="298" src="http://1.bp.blogspot.com/-kqDAufYRuXU/TuUDgS4FsYI/AAAAAAAABDs/JAcQA5LbvyY/s400/DQS5.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;3. Turn on TCP/IP with configuration tool&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;No window available.&lt;br /&gt;&lt;br /&gt;For installing this on a VM step 2 and 3 are not necessary.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;b&gt;Using DQS client&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;Now its time to use the DQS client. As said earlier, the DQS client is a stand alone application that can be used by power users to create a knowledge base and business rules to check the dataquality.&lt;br /&gt;&lt;b&gt;1. DQS Client&lt;/b&gt;&lt;br /&gt;First thing we have to do is starting the DQS client.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;/b&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-YAoWzNNzhok/TuUFFxjHj5I/AAAAAAAABD0/XHPdCD-c53g/s1600/DQS6+Client.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="192" src="http://2.bp.blogspot.com/-YAoWzNNzhok/TuUFFxjHj5I/AAAAAAAABD0/XHPdCD-c53g/s320/DQS6+Client.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Click on the Connect button and the&amp;nbsp;following window is presented: &lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&amp;nbsp;&lt;a href="http://1.bp.blogspot.com/-IG8lzP0xLC0/TuUFSWGxuhI/AAAAAAAABD8/0ObEyI50xxw/s1600/DQS7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="281" src="http://1.bp.blogspot.com/-IG8lzP0xLC0/TuUFSWGxuhI/AAAAAAAABD8/0ObEyI50xxw/s400/DQS7.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&amp;nbsp;There are three areas that are interesting:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Knowledge base Management. This is a important part of the DQS infrastructure. In this area we define the rules when the data is validated.&lt;/li&gt;&lt;li&gt;Data Quality projects. Create a new DQS project.&lt;/li&gt;&lt;li&gt;Administration. This covers Activity Monitoring and Configuration and is used for monitoring the usage of the knowledge base and connecting to 3rd party reference databases.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;b&gt;2. Open a Knowledge base&lt;/b&gt;&lt;br /&gt;Let's take a look whether this a pre installed Knowledge base.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-0rTmgL5XNwQ/TuUGyqPylcI/AAAAAAAABEE/FoUPcYdHgOo/s1600/DQS7.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="281" src="http://1.bp.blogspot.com/-0rTmgL5XNwQ/TuUGyqPylcI/AAAAAAAABEE/FoUPcYdHgOo/s400/DQS7.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Here you can see an example of a table with domain values that should be converted to the right country.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-EvQkQuIhWTg/TuUIaVKxZ-I/AAAAAAAABEM/qPybWSChzvs/s1600/DQS9.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="224" src="http://4.bp.blogspot.com/-EvQkQuIhWTg/TuUIaVKxZ-I/AAAAAAAABEM/qPybWSChzvs/s320/DQS9.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Okay let's try to create our own new knowledge base and for this test i'll be creating a domain&amp;nbsp;list of two dutch places : Amsterdam and Utrecht.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-n2P0Ni2vlqk/TuUKMru9krI/AAAAAAAABEc/1fJmJDD5oYI/s1600/DQS11.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="281" src="http://2.bp.blogspot.com/-n2P0Ni2vlqk/TuUKMru9krI/AAAAAAAABEc/1fJmJDD5oYI/s400/DQS11.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&amp;nbsp;And the following window appears:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-z5O6Nbch4As/TuUJdrs4OqI/AAAAAAAABEU/EVTKwpLqsok/s1600/DQS10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="281" src="http://1.bp.blogspot.com/-z5O6Nbch4As/TuUJdrs4OqI/AAAAAAAABEU/EVTKwpLqsok/s400/DQS10.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Once the above step is completed we will proceed with&amp;nbsp;the Domain Management Section. We need to create a new domain.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-ip4240UKx-Y/TuUK-FRMuBI/AAAAAAAABEs/cOy3kKyipgs/s1600/DQS12.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="281" src="http://1.bp.blogspot.com/-ip4240UKx-Y/TuUK-FRMuBI/AAAAAAAABEs/cOy3kKyipgs/s400/DQS12.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&amp;nbsp;Enter a Domainname. The window below is more extended than the CTP3.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-t-SUcbojYDU/TuUK8cdN3rI/AAAAAAAABEk/_bDZuRk1fm8/s1600/DQS13.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="310" src="http://4.bp.blogspot.com/-t-SUcbojYDU/TuUK8cdN3rI/AAAAAAAABEk/_bDZuRk1fm8/s320/DQS13.png" width="320" /&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Press Ok and the following window appears. &lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-PUa82C_dnrw/TuULdPbGYkI/AAAAAAAABE0/ipmTgsEV4p0/s1600/DQS14.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="257" src="http://2.bp.blogspot.com/-PUa82C_dnrw/TuULdPbGYkI/AAAAAAAABE0/ipmTgsEV4p0/s400/DQS14.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Create a new domain&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-B50W12RvSTc/TuUO6eZl0iI/AAAAAAAABG0/_5N55-fWdVA/s1600/DQS15.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="256" src="http://1.bp.blogspot.com/-B50W12RvSTc/TuUO6eZl0iI/AAAAAAAABG0/_5N55-fWdVA/s400/DQS15.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;Enter the values. There is a distinction between the valid value and the incorrect values that needs to be converted to correct value. For instance 'Ams' is converted to 'Amsterdam'.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-emUn7h1e71U/TuUO5gN5uCI/AAAAAAAABGs/52DJ7yJ7-XU/s1600/DQS16.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="256" src="http://4.bp.blogspot.com/-emUn7h1e71U/TuUO5gN5uCI/AAAAAAAABGs/52DJ7yJ7-XU/s400/DQS16.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;You need to publish this to the DQS Server.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-S3F-ZRtIxA0/TuUOwrP8XMI/AAAAAAAABGk/EefNQzDI1t8/s1600/DQS17.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="257" src="http://2.bp.blogspot.com/-S3F-ZRtIxA0/TuUOwrP8XMI/AAAAAAAABGk/EefNQzDI1t8/s400/DQS17.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Succeeded as the window shows:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-n_d8QVSMLjU/TuUOu7sb3AI/AAAAAAAABGc/fWwp1WT4mrM/s1600/DQS18.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="257" src="http://1.bp.blogspot.com/-n_d8QVSMLjU/TuUOu7sb3AI/AAAAAAAABGc/fWwp1WT4mrM/s400/DQS18.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The new knowledge base is present in Recent Knowledge base window&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-o72ES48ZDyo/TuUOuWdYR2I/AAAAAAAABGU/6gP-EqIlcts/s1600/DQS19.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://3.bp.blogspot.com/-o72ES48ZDyo/TuUOuWdYR2I/AAAAAAAABGU/6gP-EqIlcts/s320/DQS19.png" width="251" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;When this is finished it's possible to create a DQS project. This seems an extra possibility for the poweruser to correct some values for themselves. As stated earlier, there is also a DQS SSIS component that can be used for quality checks in the ETL proces.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-RfFAW4l-fc4/TuURW5KvrHI/AAAAAAAABHM/XhXu_57lvOo/s1600/DQS19.5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="318" src="http://4.bp.blogspot.com/-RfFAW4l-fc4/TuURW5KvrHI/AAAAAAAABHM/XhXu_57lvOo/s320/DQS19.5.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;Give the project a proper name:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-81ZasWo1pLI/TuURgX-8P9I/AAAAAAAABHU/muF95jn6nIA/s1600/DQS20+New+DQS+Project.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="257" src="http://1.bp.blogspot.com/-81ZasWo1pLI/TuURgX-8P9I/AAAAAAAABHU/muF95jn6nIA/s400/DQS20+New+DQS+Project.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Define the DQS project in more detail like where is the source file and where do you want to store the results:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-iPI_2rHy2WA/TuURPMQZfPI/AAAAAAAABG8/jF1i7r3MXbk/s1600/DQS23.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="256" src="http://4.bp.blogspot.com/-iPI_2rHy2WA/TuURPMQZfPI/AAAAAAAABG8/jF1i7r3MXbk/s400/DQS23.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;This is the source table:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-USCh0_S09Uw/TuURUmETi8I/AAAAAAAABHE/HCqdbwYuoB8/s1600/DQS22.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-USCh0_S09Uw/TuURUmETi8I/AAAAAAAABHE/HCqdbwYuoB8/s1600/DQS22.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;This is the window when all information is entered.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-R_QHEjOMw0M/TuUSoF-OfII/AAAAAAAABIE/VDrQEhdgkxM/s1600/DQS23.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="256" src="http://1.bp.blogspot.com/-R_QHEjOMw0M/TuUSoF-OfII/AAAAAAAABIE/VDrQEhdgkxM/s400/DQS23.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Next.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-dhxi0laeldI/TuUSm7qt4xI/AAAAAAAABH8/dxRtbaufICc/s1600/DQS24.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="257" src="http://4.bp.blogspot.com/-dhxi0laeldI/TuUSm7qt4xI/AAAAAAAABH8/dxRtbaufICc/s400/DQS24.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;After pressing the start button the following window appears.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-3pq_S0c3iQk/TuUSk0SRkkI/AAAAAAAABH0/ESGkinhEba0/s1600/DQS25.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="171" src="http://3.bp.blogspot.com/-3pq_S0c3iQk/TuUSk0SRkkI/AAAAAAAABH0/ESGkinhEba0/s400/DQS25.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Categorizing the values.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-89NtL1AUk3M/TuUTdubwusI/AAAAAAAABIc/AfL_C_Is-PQ/s1600/DQS26.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="204" src="http://4.bp.blogspot.com/-89NtL1AUk3M/TuUTdubwusI/AAAAAAAABIc/AfL_C_Is-PQ/s320/DQS26.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;And here are the results:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-XANcTewrpyU/TuUTciUZSgI/AAAAAAAABIU/6O4Yzlz_twQ/s1600/DQS27.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="257" src="http://1.bp.blogspot.com/-XANcTewrpyU/TuUTciUZSgI/AAAAAAAABIU/6O4Yzlz_twQ/s400/DQS27.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;And the table in SQL Server shows the following information:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-x1HxriMv6CU/TuUTb-seRLI/AAAAAAAABIM/0Fu4u6HZe3A/s1600/dqs28.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="140" src="http://3.bp.blogspot.com/-x1HxriMv6CU/TuUTb-seRLI/AAAAAAAABIM/0Fu4u6HZe3A/s400/dqs28.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;Conclusion&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;DQS seems a great tool in the Self Service BI approach. The poweruser can maintain the knowledge base with little help of IT and the ETL developer can use this DQS functionality in the ETL process. This will aid the dataquality of the data. So the ETL developer will be more responsible for building the ETL package and the poweruser is content responsible.&lt;br /&gt;&lt;br /&gt;In one of the following blogposts i'll investigate the SSIS DQS component.&lt;br /&gt;&lt;br /&gt;Hennie&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-3312093541926540668?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/3312093541926540668/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2011/12/data-quality-services-dqs-in-sql-server.html#comment-form' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/3312093541926540668'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/3312093541926540668'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2011/12/data-quality-services-dqs-in-sql-server.html' title='Data Quality Services (DQS) in SQL Server 2012 (Denali) RC0'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-kSlQHN-l8j4/TuT41ld6mlI/AAAAAAAABDU/lOjKPk6-z1I/s72-c/DQS1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-2275614080810953041</id><published>2011-11-27T14:11:00.000+01:00</published><updated>2011-11-28T10:54:28.876+01:00</updated><title type='text'>Handling NULL in dimensions and measures</title><content type='html'>A small post about 'Unknown' and 'Not Available'&amp;nbsp;values in datawarehouse solutions. I've a requirement of my customer about this issue. The customer wants to see whether a value of a field in the sourcetable is empty (= NULL) or&amp;nbsp;whether the value is not present in the dimension. There is a distinction between the two types of mismatching. The same problem is there with measures. They also want to see whether a measure value is NULL or whether it has a valid value. This way it's possible to monitor the dataquality of the source in a more sophisticated manner. &lt;br /&gt;&lt;br /&gt;Normally you create one 'empty' row in your dimension called 'Unknown' (for handling NULLs and false dimension key lookups) and this a good solution under normal circumstances.But as said in my introduction, a more refined solution is needed. In my opinion the following distinction can be made:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Dimension.&lt;/li&gt;&lt;ul&gt;&lt;li&gt;-2 , "Not available" like in NULL. There is no value present in the source. In case of date dimension use a value like 1898, 1899&amp;nbsp;or 2098,2099 as a default value for unknown and/or not avaliable dates. In some sourcesystems i've seen that a '' (two single quotes) is implemented. You could include this check in the same logic for the "Not available" code too.&lt;/li&gt;&lt;li&gt;-1 , "Unknown" when the application key is not present in the dimension application lookup field. In this case there is a value present but it is not (yet) present in the dimension.&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Measure.&lt;/li&gt;&lt;ul&gt;&lt;li&gt;When not filled in, use 0 because this won't bother aggregations like summing.&lt;/li&gt;&lt;li&gt;Use an extra indicatorfield &amp;lt;field&amp;gt;_AvailableYN&amp;nbsp;to indicate whether the measure is available or not (NULL). Create a DD dimension and drop this field in here.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;Below a diagram is shown about a dimension lookup scenario. One NOT AVAILABLE and one UNKNOWN scenario.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-p8w5MKEslwo/TtIPSuu9sEI/AAAAAAAABAU/6Qqeo2sy8Lw/s1600/difference+unknown+not+available.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="252" src="http://3.bp.blogspot.com/-p8w5MKEslwo/TtIPSuu9sEI/AAAAAAAABAU/6Qqeo2sy8Lw/s400/difference+unknown+not+available.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;When the column in the sourcetable is NULL it will insert a -2 into the fact table. When a value is present in the column in the source but the dimension lookup failed an unknown value (-1) is inserted in the fact table.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Powerusers should be aware of these&amp;nbsp;choices when they build reports.If they are used to 'UNKNOWN' values, now they have include some logic for the NOT AVAILABLE values in the reports too.&lt;br /&gt;&lt;br /&gt;An interesting article about dummy values can be downloaded &lt;a href="http://www.olap.it/Articoli/Dealing%20with%20Missing%20Values.pdf"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Greetz,&lt;br /&gt;Hennie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-2275614080810953041?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/2275614080810953041/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2011/11/handling-null-in-dimensions-and.html#comment-form' title='2 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/2275614080810953041'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/2275614080810953041'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2011/11/handling-null-in-dimensions-and.html' title='Handling NULL in dimensions and measures'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-p8w5MKEslwo/TtIPSuu9sEI/AAAAAAAABAU/6Qqeo2sy8Lw/s72-c/difference+unknown+not+available.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-1267113359226730961</id><published>2011-11-11T21:44:00.000+01:00</published><updated>2011-11-11T21:44:30.311+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSAS'/><category scheme='http://www.blogger.com/atom/ns#' term='SQLServer'/><category scheme='http://www.blogger.com/atom/ns#' term='SSRS'/><title type='text'>SSRS : Adding process date of a cube to your report</title><content type='html'>&lt;b&gt;Introduction&amp;nbsp;&lt;/b&gt;&lt;br /&gt;In this blogpost i'll explain how to&amp;nbsp;add a date to your report when a cube is processed. I've a requirement of my customer that they want to show a date on the report when the cube is processed. In this blogpost i'll use a query that can be used for determining the date&amp;nbsp;when the cube is processed.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The problem&lt;/b&gt;&lt;br /&gt;The problem is that using the query :&lt;br /&gt;&lt;br /&gt;SELECT LAST_DATA_UPDATE FROM $System.MDSCHEMA_CUBES WHERE CUBE_NAME = '&amp;lt;cube&amp;gt;'&lt;br /&gt;&lt;br /&gt;can't be done in a standard manner, like using MDX queries in the MDX query window in reporting services&lt;br /&gt;&lt;br /&gt;Below i'll show the&amp;nbsp;failed attemps and a successful attempt.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Attempt 1 : Query designer &lt;/i&gt;&lt;br /&gt;I'll show what happens when i try to add the query to the MDX query designer. First step is to open the query designer in the report and press the designbutton:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-m6rkPPvy5mA/TrEfg-4HulI/AAAAAAAAA-U/rhbNNBKXbUY/s1600/design.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="230" src="http://1.bp.blogspot.com/-m6rkPPvy5mA/TrEfg-4HulI/AAAAAAAAA-U/rhbNNBKXbUY/s320/design.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;The next step is going to&amp;nbsp;Query mode and add the query to window. When Ok is pressed the following error occurs:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-ogqk36DRFVc/TrEfihyJHQI/AAAAAAAAA-c/FwPC26Dfolg/s1600/error+designer.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="238" src="http://3.bp.blogspot.com/-ogqk36DRFVc/TrEfihyJHQI/AAAAAAAAA-c/FwPC26Dfolg/s320/error+designer.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;So this a blind alley!&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Attempt 2 : Expression&lt;/i&gt;&lt;br /&gt;The next attempt i tried was using the expression button and that seems to work&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-ksNPiRed1sk/TrElNY2G4_I/AAAAAAAAA_Y/DWUckp61MsI/s1600/dataset2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://2.bp.blogspot.com/-ksNPiRed1sk/TrElNY2G4_I/AAAAAAAAA_Y/DWUckp61MsI/s320/dataset2.png" width="310" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;And resulting in a value:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-GOxB3r2nyq8/TrEjGtknjZI/AAAAAAAAA-8/rL7695uxcDc/s1600/sucesss.png" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-GOxB3r2nyq8/TrEjGtknjZI/AAAAAAAAA-8/rL7695uxcDc/s1600/sucesss.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-pWDYrrGlWXU/TrEgWalnQFI/AAAAAAAAA-k/87kJlHagbFM/s1600/goDMX.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;But when i try to open de expression designer again:&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-MWwHCJ1K75s/TrEl1w2opaI/AAAAAAAAA_s/0hUtPVlBzRQ/s1600/dataset2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://3.bp.blogspot.com/-MWwHCJ1K75s/TrEl1w2opaI/AAAAAAAAA_s/0hUtPVlBzRQ/s320/dataset2.png" width="310" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-ksNPiRed1sk/TrElNY2G4_I/AAAAAAAAA_Y/DWUckp61MsI/s1600/dataset2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;An error occurs:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-OCYMLuWCZi4/TrElMnPjDzI/AAAAAAAAA_Q/3rffkKogk_w/s1600/cannot+find+cue.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="58" src="http://4.bp.blogspot.com/-OCYMLuWCZi4/TrElMnPjDzI/AAAAAAAAA_Q/3rffkKogk_w/s320/cannot+find+cue.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;And i have to select a cube:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/--0Ns41wdfE4/TrElMUBn1jI/AAAAAAAAA_I/G22JtFTgSak/s1600/Cubeselection.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://3.bp.blogspot.com/--0Ns41wdfE4/TrElMUBn1jI/AAAAAAAAA_I/G22JtFTgSak/s320/Cubeselection.png" width="269" /&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&amp;nbsp;And again an error occurs &lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-lhDF7KDcNv0/TrElLwA_IvI/AAAAAAAAA_E/U74F2E0Jc7U/s1600/Erroragain.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="238" src="http://4.bp.blogspot.com/-lhDF7KDcNv0/TrElLwA_IvI/AAAAAAAAA_E/U74F2E0Jc7U/s320/Erroragain.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Again a blind alley....&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;The solution&amp;nbsp;&lt;/b&gt;&lt;br /&gt;An solution i've found is descibed below. Go to the query designer and press the DMX editor:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-pWDYrrGlWXU/TrEgWalnQFI/AAAAAAAAA-k/87kJlHagbFM/s1600/goDMX.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-pWDYrrGlWXU/TrEgWalnQFI/AAAAAAAAA-k/87kJlHagbFM/s1600/goDMX.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Go to the designer button and press on it:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-KUTow2SA7J8/TrEhHB61FnI/AAAAAAAAA-s/8MpbbNVte6A/s1600/DMX+Design.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="238" src="http://1.bp.blogspot.com/-KUTow2SA7J8/TrEhHB61FnI/AAAAAAAAA-s/8MpbbNVte6A/s320/DMX+Design.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Copy the query in it and press OK.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-FsTp0JqVJaE/TrEi5uZbrjI/AAAAAAAAA-0/uiVWRLzpR08/s1600/Query+designer.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="238" src="http://3.bp.blogspot.com/-FsTp0JqVJaE/TrEi5uZbrjI/AAAAAAAAA-0/uiVWRLzpR08/s320/Query+designer.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;And we have a working last cube processed date:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-GOxB3r2nyq8/TrEjGtknjZI/AAAAAAAAA-8/rL7695uxcDc/s1600/sucesss.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-GOxB3r2nyq8/TrEjGtknjZI/AAAAAAAAA-8/rL7695uxcDc/s1600/sucesss.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;br /&gt;I don't understand how and why but it seems to work and i've implemented this in my reports. But i've to say it's a bit strange.&lt;br /&gt;&lt;br /&gt;Greetz,&lt;br /&gt;&lt;br /&gt;Hennie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-1267113359226730961?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/1267113359226730961/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2011/11/ssrs-adding-process-date-of-cube-to.html#comment-form' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/1267113359226730961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/1267113359226730961'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2011/11/ssrs-adding-process-date-of-cube-to.html' title='SSRS : Adding process date of a cube to your report'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-m6rkPPvy5mA/TrEfg-4HulI/AAAAAAAAA-U/rhbNNBKXbUY/s72-c/design.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-4242492353639474225</id><published>2011-11-05T20:49:00.000+01:00</published><updated>2011-11-06T12:16:20.149+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSAS'/><category scheme='http://www.blogger.com/atom/ns#' term='SQLServer'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>SSAS : Selecting facts with reference dimension</title><content type='html'>&lt;b&gt;Introduction&lt;/b&gt;&lt;br /&gt;In this blogpost i'll explain a problem i have at a customer. This problem is about relations between stars, facts&amp;nbsp;and dimensions. To be more specific: selecting values of a fact with a (non conformed) dimension that is not directly linked with the fact but to another fact. In this blogpost i'll try to explain some backgrounds, the problem, a&amp;nbsp;solution and finally some conclusions about what&amp;nbsp;i have encountered during this investigation.&lt;br /&gt;&lt;br /&gt;This is the&amp;nbsp;second blogpost about this issue in a serie of 3. In this blogpost i'll describe a solution that is a better solution than i've described in &lt;a href="http://bifuture.blogspot.com/2011/10/ssas-selecting-facts-withe-different.html"&gt;a former post&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The problem&lt;/b&gt;&lt;br /&gt;In this section i'll decribe the problem&amp;nbsp; in more detail. There is a wish from my customer about selecting values of a fact with a dimension that belongs to another fact. This is not a conformed dimension and i think&amp;nbsp;this is the cause of the problem. As i'm reading the book "The Microsoft data warehouse toolkit, second edition" about conformed dimensions it says : "In order to combine information from two facts it is&amp;nbsp;requirement to have a common dimension with the same keys. This is called drilled accross".&lt;br /&gt;&lt;br /&gt;Suppose i've the following situation (SQL Server tables):&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-bgt1flmokcc/TrP2F1u8UCI/AAAAAAAABAM/Mnkgz67gEiM/s1600/SSAS+solutions2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="216" src="http://2.bp.blogspot.com/-bgt1flmokcc/TrP2F1u8UCI/AAAAAAAABAM/Mnkgz67gEiM/s320/SSAS+solutions2.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-k4m63Cm3aVQ/TrP1f24m-II/AAAAAAAABAE/5S3BITroEso/s1600/SSAS+solution.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The Type dimension is not a conformed dimension because it is only shared by one&amp;nbsp;fact and not more facts. A key of FactA is also present in FactB and therefore a dashed line is drawn. This will be the base for drawing connectin the Type dimension with FactB.&lt;br /&gt;&lt;br /&gt;The diagram above typically descibes a situation as a 1:n relation between facts, for instance order (FactA) and orderlines (FactB). For this purpose a degenerated dimension table is created, which is a 1:1 dimension of FactA (order) and a 1:n with FactB (orderlines) A date dimension is also included. &lt;br /&gt;&lt;br /&gt;Now, the problem&amp;nbsp;is about selecting FactB records with the Type dimension.This can't be done by standard operating of the SSAS engine, unfortunately.&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;In SQL query:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;img border="0" height="132" rda="true" src="http://1.bp.blogspot.com/-C1XjV_JW144/TqQTo4K1SSI/AAAAAAAAA58/_1zfXov-YN0/s400/Results.png" width="400" /&gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;The solution&lt;/b&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;span class="Apple-style-span" style="background-color: white; color: #222222; line-height: 18px;"&gt;On the&amp;nbsp;&lt;/span&gt;&lt;a href="http://social.msdn.microsoft.com/Forums/en-US/sqlanalysisservices/thread/18d0b668-0831-45e2-9293-df5978249a28" style="background-color: white; color: #2288bb; line-height: 18px; text-align: left; text-decoration: none;"&gt;MSDN forum&lt;/a&gt;&lt;span class="Apple-style-span" style="background-color: white; color: #222222; line-height: 18px; text-align: left;"&gt;&amp;nbsp;i was pointed&amp;nbsp;to usage of the reference dimension. The referenced dimension is one of the six different types of relationships as i can see on the MSDN page regarding&amp;nbsp;&lt;/span&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms175669.aspx" style="background-color: white; color: #2288bb; line-height: 18px; text-align: left; text-decoration: none;"&gt;Referenced dimension&lt;/a&gt;&lt;span class="Apple-style-span" style="background-color: white; color: #222222; line-height: 18px; text-align: left;"&gt;. The first lines about a referenced dimension: "&lt;/span&gt;&lt;i style="background-color: white; color: #222222; line-height: 18px; text-align: left;"&gt;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."&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;i&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&lt;/i&gt;&lt;br /&gt;So i decided to implement a reference dimension in a different way than i have descibed in &lt;a href="http://bifuture.blogspot.com/2011/10/ssas-selecting-facts-withe-different.html"&gt;my former post&lt;/a&gt;. Now i've removed the materialized DD dimension table in SQL Server and use a direct relation from FactA to FactB. &lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-8A1YGGgNDDA/TqpkPAnmR_I/AAAAAAAAA60/KT1J2t_-_AA/s1600/Solution+2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="223" ida="true" src="http://4.bp.blogspot.com/-8A1YGGgNDDA/TqpkPAnmR_I/AAAAAAAAA60/KT1J2t_-_AA/s320/Solution+2.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;The cube structure is shown in the screenshot below. As you can see now there is a&amp;nbsp;direct relaltion between FactA and FactB. Field FK_FactA_DDkey is present in both fact tables FactA and FactB and is set as a foreign key in FactB.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-XZULDQXzmIg/TqrGx8SjWDI/AAAAAAAAA8E/baaE6lMVnCE/s1600/cubestructure.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240" ida="true" src="http://3.bp.blogspot.com/-XZULDQXzmIg/TqrGx8SjWDI/AAAAAAAAA8E/baaE6lMVnCE/s320/cubestructure.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Below a screenshot from the dimension usage tab of the cube. Here you can see the usage of the reference dimension relationship. The DimType is connected with the FactB because of the reference dimension FactA DD.&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-Vw1R4hLp-l4/TqrG1CQGw6I/AAAAAAAAA8M/PW9jWTEK0dA/s1600/dimensionusagesolution2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="105" ida="true" src="http://4.bp.blogspot.com/-Vw1R4hLp-l4/TqrG1CQGw6I/AAAAAAAAA8M/PW9jWTEK0dA/s320/dimensionusagesolution2.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Below the "Define relationship" window that pops up when a you click on the box of the intersection of measure group and the Type dimension on the cubestructure tab.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-MUlfI2My7-g/TrPuNgzW7cI/AAAAAAAAA_0/jiDOv2FL3lE/s1600/Reference+dimesnion+window.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="212" src="http://3.bp.blogspot.com/-MUlfI2My7-g/TrPuNgzW7cI/AAAAAAAAA_0/jiDOv2FL3lE/s320/Reference+dimesnion+window.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;In order to get the reference dimension relationship working, I had to add the FK Type Key to Fact A DD dimensio too. &lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-LXAaAsisl2s/TrPuqI2E6kI/AAAAAAAAA_8/MJTxAhk32Jo/s1600/AddFKTypeKey+to+the+DD+dim.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-LXAaAsisl2s/TrPuqI2E6kI/AAAAAAAAA_8/MJTxAhk32Jo/s1600/AddFKTypeKey+to+the+DD+dim.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;And the results are:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-iN5SKhP5DMc/Tqr4ARRGiwI/AAAAAAAAA8U/RdaIvz3ARKA/s1600/resultssolution2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="195" ida="true" src="http://4.bp.blogspot.com/-iN5SKhP5DMc/Tqr4ARRGiwI/AAAAAAAAA8U/RdaIvz3ARKA/s320/resultssolution2.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Correct again!&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;br /&gt;In contrast with the first solution i've described in the blogpost titled: "&lt;a href="http://bifuture.blogspot.com/2011/10/ssas-selecting-facts-withe-different.html"&gt;SSAS: Selecting facts with different dimensionality&lt;/a&gt;" this is a neat solution without a extra physical SQL table, the FactDD dimension. Because of this implemented solution, dimensions from FactA can benefit of the reference relationship between FactA and FactB and therefore a powerful solution it is.&lt;br /&gt;&lt;br /&gt;Advantages :&lt;br /&gt;&lt;ul&gt;&lt;li&gt;No materialized table used and therefore:&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Less maintenance.&lt;/li&gt;&lt;li&gt;Less storage.&lt;/li&gt;&lt;li&gt;Less joining.&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Easy to build.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;ul&gt;&lt;/ul&gt;&lt;i&gt;Disadvantage&lt;/i&gt;s&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Perhaps that the cube structure is a bit different than the physical tables and less debug opportunities(?).&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Greetz,&lt;br /&gt;Hennie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-4242492353639474225?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/4242492353639474225/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2011/11/ssas-selecting-facts-with-reference.html#comment-form' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/4242492353639474225'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/4242492353639474225'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2011/11/ssas-selecting-facts-with-reference.html' title='SSAS : Selecting facts with reference dimension'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-bgt1flmokcc/TrP2F1u8UCI/AAAAAAAABAM/Mnkgz67gEiM/s72-c/SSAS+solutions2.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-7118070591891973494</id><published>2011-10-30T19:34:00.002+01:00</published><updated>2011-11-06T12:15:48.301+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSAS'/><category scheme='http://www.blogger.com/atom/ns#' term='SQLServer'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>SSAS: Selecting facts with different dimensionality</title><content type='html'>&lt;b&gt;Introduction&lt;/b&gt;&lt;br /&gt;Back from holiday&amp;nbsp;and all together with going live at a customer it has been quite busy the last month. But for now there is some more time to blog about certain issues.&amp;nbsp;In this blogpost i'll explain a problem i have at a customer. This problem is about relations between stars, facts&amp;nbsp;and dimensions. To be more specific: selecting values of a fact with a (non conformed) dimension that belongs to a another fact. In this blogpost i'll try to explain some backgrounds, the problem, a&amp;nbsp;solution and finally some conclusions about what&amp;nbsp;i have encountered during this investigation.&lt;br /&gt;&lt;br /&gt;This is the first blogpost about this issue in a serie of 3. In this blogpost i'll descibe a solution that is a nice solution but in the &lt;a href="http://bifuture.blogspot.com/2011/11/ssas-selecting-facts-with-reference.html"&gt;next blogpost&lt;/a&gt; i am describing an even better solution. &lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;b&gt;The problem&lt;/b&gt;&lt;br /&gt;In this section i'll decribe the problem&amp;nbsp; in more detail. There is a wish from my customer about selecting values of a fact with a dimension that belongs to another fact. This is not a conformed dimension (related) and that is the cause of the problem as i' ve read in the book "The Microsoft data warehouse toolkit, second edition" about conformed dimensions it says : "In order to combine information from two facts it is&amp;nbsp;requirement to have a common dimension with the same keys. This is called drilled accross". In other words there are dimensions that are unrelated to a measuregroup&lt;br /&gt;&lt;br /&gt;Suppose i've the following situation (SQL Server tables):&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-wjpyQvKoHbM/TqQOGD94qaI/AAAAAAAAA5s/CaRbaIQ-j4E/s1600/starmodel.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240" rda="true" src="http://2.bp.blogspot.com/-wjpyQvKoHbM/TqQOGD94qaI/AAAAAAAAA5s/CaRbaIQ-j4E/s320/starmodel.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The Type dimension is not a conformed dimension because it is only shared by one&amp;nbsp;fact and not more facts (there are more rules, offcourse). The FactA DD dimension is a shared dimension and therefore a conformed dimension.&lt;br /&gt;&lt;br /&gt;The diagram above typically descibes a situation between a 1 : N relation between facts, for instance order (FactA) and orderlines (FactB). For this purpose a degenerated dimension table is created, which is a 1:1 dimension of FactA (order) and a 1 : N with FactB (orderlines). FactB also contains the same technical key as FactA for this degenerated dimension (FactA DD). A date dimension is also included. &lt;br /&gt;&lt;br /&gt;Now the problem&amp;nbsp;is about selecting FactB records with the Type dimension.This can't be done by standard operating of the SSAS engine, unfortunately.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;b&gt;Setting up the lab situation&lt;/b&gt;&lt;br /&gt;In order to study this situation i've created a small labsituation in SQL Server.&amp;nbsp; Below you can see the script i've used.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;--FactA (eg. Order)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[FactA]') AND type in (N'U'))&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;DROP TABLE [dbo].[FactA]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;GO&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;CREATE TABLE [dbo].[FactA](&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;[FactAID] [int] IDENTITY(1,1) NOT NULL,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;[FK_Date_Key] [int] NOT NULL,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;[FK_Type_Key] [int] NOT NULL,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;[FK_FactA_DDKey] [int] NOT NULL,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;[FactACount] [int] NOT NULL&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;) ON [PRIMARY]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;GO&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;--FactB&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[FactB]') AND type in (N'U'))&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;DROP TABLE [dbo].[FactB]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;GO&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;CREATE TABLE [dbo].[FactB](&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;[FactBID] [int] IDENTITY(1,1) NOT NULL,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;[FK_Date_Key] [int] NOT NULL,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;[FK_FactA_DDKey] [int] NOT NULL,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;[FactBCount] [int] NOT NULL&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;) ON [PRIMARY]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;GO&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;--DimDate&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DimDate]') AND type in (N'U'))&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;DROP TABLE [dbo].[DimDate]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;GO&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;CREATE TABLE [dbo].[DimDate](&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;[Date_dim_key] [int] NULL,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;[Date_Year] [int] NULL&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;) ON [PRIMARY]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;GO&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;--DimType&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DimType]') AND type in (N'U'))&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;DROP TABLE [dbo].[DimType]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;GO&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;CREATE TABLE [dbo].[DimType](&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;[Type_dim_key] [int] NULL,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;[Type_Code] [int] NULL,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;[Type_Description] [varchar] (25) NULL&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;) ON [PRIMARY]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;GO&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;--Date&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;INSERT INTO dbo.DimDate&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;VALUES (1,2000),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;(2, 2001),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;(3, 2002),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;(4, 2003),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;(5, 2004),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;(6, 2005),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;(7, 2006),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;(8, 2007),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;(9, 2008),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;(10, 2009),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;(11, 2010),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;(12, 2011),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;(13, 2012),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;(14, 2013),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;(15, 2014),&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;(16, 2015)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;--Order&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;INSERT INTO [dbo].[FactA]([FK_Date_Key],[FK_Type_Key], [FK_FactA_DDKey], [FactACount])&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;VALUES (12, 1, 1, 1), (12, 1, 2, 1), (12, 2, 3, 1),(12, 3, 4, 1), (12, 2, 5, 1)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;GO&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;--Orderlines&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;INSERT INTO [dbo].[FactB]([FK_Date_Key], [FK_FactA_DDKey], [FactBCount])&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;VALUES (12, 1, 1), (12, 1, 1), (12, 2,&amp;nbsp; 1),(12, 3,&amp;nbsp; 1), (12, 3,&amp;nbsp; 1)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;GO&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;--Type&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;INSERT INTO [dbo].[DimType]([Type_Dim_Key], [Type_code], [Type_Description])&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;VALUES (1, 1, 'Type 1'), (2, 2, 'Type 2'), (3, 3, 'Type 3')&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;GO&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;SELECT &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;Type_Code,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;Type_Description,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;FA.[FK_FactA_DDKey],&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;FactACount,&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;FactBCount&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;FROM DimType T&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;LEFT OUTER JOIN FactA FA ON T.Type_dim_key = FA.FK_Type_Key&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size: x-small;"&gt;LEFT OUTER JOIN FactB FB ON&amp;nbsp; FA.FK_FactA_DDKey = FB.FK_FactA_DDKey&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;I know that it's not a best practice querying factables directly but this is a labsituation and the degenerated dimension will be created in the cube. The last query of the script results in :&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-C1XjV_JW144/TqQTo4K1SSI/AAAAAAAAA58/_1zfXov-YN0/s1600/Results.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="132" rda="true" src="http://1.bp.blogspot.com/-C1XjV_JW144/TqQTo4K1SSI/AAAAAAAAA58/_1zfXov-YN0/s400/Results.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;So, now i can query these tables and i can filter the records of FactB with some of the Type dimension values so this would also be possible in the cube right?&amp;nbsp; The next step is building the cube :&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-zGV2S5M7DqA/TqQXcyhT7lI/AAAAAAAAA6M/jQGVaS99q4w/s1600/Dimensionusage.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="106" rda="true" src="http://1.bp.blogspot.com/-zGV2S5M7DqA/TqQXcyhT7lI/AAAAAAAAA6M/jQGVaS99q4w/s320/Dimensionusage.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;When we browse the cube the following information is given:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-1PZKEyJVOcQ/TqQXa2OGAZI/AAAAAAAAA6E/WLSlhCRssO0/s1600/cuberesults.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" rda="true" src="http://1.bp.blogspot.com/-1PZKEyJVOcQ/TqQXa2OGAZI/AAAAAAAAA6E/WLSlhCRssO0/s1600/cuberesults.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The results doesn't seem right because i would have expected a value for Fact B Count, Type 1 = 3, for Type 2 = 2 and for Type 3 = 0. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Solution &lt;/b&gt;&lt;br /&gt;In order to use a filter on both facts we need to change the structure of the table (for the first solution).&amp;nbsp;Let me draw the first solution. In this solution the Type dimension is connected with the DD dimension.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-s6ZSasiMmxk/TqpkMomPuwI/AAAAAAAAA6s/87fqyDRldvo/s1600/solution+1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" ida="true" src="http://3.bp.blogspot.com/-s6ZSasiMmxk/TqpkMomPuwI/AAAAAAAAA6s/87fqyDRldvo/s320/solution+1.png" width="248" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;In&amp;nbsp;the cube designer the solution looks like this:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-ptMP7HRvK9c/TqpxDZwUMJI/AAAAAAAAA68/_ukH4PyA3aE/s1600/SSAS+cubestructure.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" ida="true" src="http://2.bp.blogspot.com/-ptMP7HRvK9c/TqpxDZwUMJI/AAAAAAAAA68/_ukH4PyA3aE/s320/SSAS+cubestructure.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;On the &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/sqlanalysisservices/thread/18d0b668-0831-45e2-9293-df5978249a28"&gt;MSDN forum&lt;/a&gt; i was pointed&amp;nbsp;to usage of the reference dimension. The referenced dimension is one of the six different types of relationships as i can see on the MSDN page regarding &lt;a href="http://msdn.microsoft.com/en-us/library/ms175669.aspx"&gt;Referenced dimension&lt;/a&gt;. The first lines about a referenced dimension: "&lt;i&gt;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."&lt;/i&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-W32bZPXlFeg/Tq2XWkcxSeI/AAAAAAAAA8k/Bx419UR5ZMA/s1600/Dimension+usage.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="150" src="http://4.bp.blogspot.com/-W32bZPXlFeg/Tq2XWkcxSeI/AAAAAAAAA8k/Bx419UR5ZMA/s320/Dimension+usage.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;In case of a referenced dimension there are a couple of settings that needs to be set:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Reference dimension information.&lt;/li&gt;&lt;li&gt;Intermediate dimension.&lt;/li&gt;&lt;/ul&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;In the diagram below you can see (one the two) reference relationship window:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-VkeJBB46E4g/Tq2X-HUj_oI/AAAAAAAAA88/F8CTmGkg9xM/s1600/reference+window.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="213" src="http://1.bp.blogspot.com/-VkeJBB46E4g/Tq2X-HUj_oI/AAAAAAAAA88/F8CTmGkg9xM/s320/reference+window.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-kqe3VhrbPt8/TqpxFuAr94I/AAAAAAAAA7E/wKPa9VSbmwU/s1600/SSAS+dimension+usage.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&amp;nbsp;Below, specifically the design of the DD dimension is shown:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-O7k9Fy8l9FU/Tq2XYWy077I/AAAAAAAAA8s/FJ_-gS9rpYU/s1600/DimFactADD.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="233" src="http://3.bp.blogspot.com/-O7k9Fy8l9FU/Tq2XYWy077I/AAAAAAAAA8s/FJ_-gS9rpYU/s320/DimFactADD.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;And below you can see the results of this solution:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-ET3Hc5oM6TA/Tq2XmxWRniI/AAAAAAAAA80/xuxegN3msJw/s1600/resulktssolution1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="238" src="http://1.bp.blogspot.com/-ET3Hc5oM6TA/Tq2XmxWRniI/AAAAAAAAA80/xuxegN3msJw/s320/resulktssolution1.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;And that is correct!&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;br /&gt;Somehow it sounds a bit strange that a measure of fact (B) can't be selected by a dimension (type) of another fact (A) when the SSAS engine is operating in it's default behaviour. In SQL can quickly create a query that joins the tables and that gives the desired result. In order to make this happen in the SSAS engine you need to do more than using the default settings of the cube structure. In my next blogpost i'll explain a better solution for this problem. &lt;br /&gt;&lt;br /&gt;Greetz,&lt;br /&gt;&lt;br /&gt;Hennie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-7118070591891973494?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/7118070591891973494/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2011/10/ssas-selecting-facts-withe-different.html#comment-form' title='2 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/7118070591891973494'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/7118070591891973494'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2011/10/ssas-selecting-facts-withe-different.html' title='SSAS: Selecting facts with different dimensionality'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-wjpyQvKoHbM/TqQOGD94qaI/AAAAAAAAA5s/CaRbaIQ-j4E/s72-c/starmodel.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-1290486868456074328</id><published>2011-09-20T20:54:00.004+02:00</published><updated>2011-12-12T21:15:56.608+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQLServer'/><category scheme='http://www.blogger.com/atom/ns#' term='SSRS'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>SSRS: 5 Attempts and 2 solutions with reportfilter and multiple conditions (grmph)</title><content type='html'>&lt;b&gt;Introduction&lt;/b&gt;&lt;br /&gt;This is annoying me for a long time now: filter records based on multiple conditions in Reporting Services (SSRS). I'm working with power users and they are using reportbuilder 2.0 and they want to select multiple conditions for rows in a tablix. Simple? Intuitive? Easy for endusers? Not quite (in my opinion). &lt;br /&gt;&lt;br /&gt;&lt;b&gt;The problem&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Attempt 1 &lt;/i&gt;&lt;br /&gt;Suppose i've&amp;nbsp;&amp;nbsp;a simple fact with a department dimension and i've 5 factrecords. I&amp;nbsp;know that department A&amp;nbsp;and E has a factrecord. Therefore i'm using them to test this filterbehaviour. Now i want to select two departments with the report filter. On &lt;a href="http://technet.microsoft.com/en-us/library/cc627464.aspx"&gt;Technet&lt;/a&gt; i've found the following example :&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-luXdH6ezxik/TnW3gH9iG8I/AAAAAAAAA3U/2cOi5w9AawM/s1600/example+technet.png" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="38" src="http://2.bp.blogspot.com/-luXdH6ezxik/TnW3gH9iG8I/AAAAAAAAA3U/2cOi5w9AawM/s640/example+technet.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The first thing (as most of us will do and as my poweruser were doing) is trying Department_Description = Department A, Department E&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-prup_MNxobI/TnXGEFP5xaI/AAAAAAAAA3c/L88VBsN9SDU/s1600/Attempt1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="208" src="http://2.bp.blogspot.com/-prup_MNxobI/TnXGEFP5xaI/AAAAAAAAA3c/L88VBsN9SDU/s320/Attempt1.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-M9b0myZgSKs/TnWwvkvoaXI/AAAAAAAAA3A/5vpJb0f0k2o/s1600/Filter1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;and no results appear. Okay, well i know something about SQL and there is an IN operator available for this kind of filtering. In SQL you willl type something like this : &lt;br /&gt;&lt;br /&gt;WHERE Department IN ('Department A', 'Department B')&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Attempt 2&lt;/i&gt;&lt;br /&gt;So the next thing i tried was the IN operator&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-PTbOhFyyTFQ/TnXHHxugA2I/AAAAAAAAA3k/dvqQtRVauxs/s1600/Attempt+2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="230" src="http://1.bp.blogspot.com/-PTbOhFyyTFQ/TnXHHxugA2I/AAAAAAAAA3k/dvqQtRVauxs/s320/Attempt+2.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;But no luck here too.&lt;i&gt; &lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Attempt 3&lt;/i&gt; &lt;br /&gt;The next step is using quotations &lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-MTOfl9Vh284/TnXHjkEd9wI/AAAAAAAAA3o/ez7NGtUZUrA/s1600/attempt3+with+quotes.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="236" src="http://3.bp.blogspot.com/-MTOfl9Vh284/TnXHjkEd9wI/AAAAAAAAA3o/ez7NGtUZUrA/s320/attempt3+with+quotes.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;This gives me some errors. Now what? Coming back to the Filter window shows this:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-VJOMhbOT_RU/TnXHwwneCgI/AAAAAAAAA3s/qA8CrycSTI4/s1600/returntowindow.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="150" src="http://3.bp.blogspot.com/-VJOMhbOT_RU/TnXHwwneCgI/AAAAAAAAA3s/qA8CrycSTI4/s320/returntowindow.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-AL8_1G7b-h8/TnWzRPod75I/AAAAAAAAA3M/s8aEzM0h1Lo/s1600/Filterattempt.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Reporting Services has changed the constraint to this :&amp;nbsp; """"Department A, Department B"""". That seems a bit awkward. I think that three " are needed for escaping other " characters. When i'm building dynamic sql i need to use these too.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Attempt 4&lt;/i&gt;&lt;br /&gt;Perhaps single quotes?&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-78Sm0t9VVNI/TnXIuFaNwkI/AAAAAAAAA3w/XzWtO0MC0FU/s1600/Attemptxx.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="235" src="http://1.bp.blogspot.com/-78Sm0t9VVNI/TnXIuFaNwkI/AAAAAAAAA3w/XzWtO0MC0FU/s320/Attemptxx.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;Nope&lt;i&gt;!&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;Attempt 5&lt;/i&gt;&lt;br /&gt;Round Brackets perhaps?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-6mLyhyOm5d4/TnXJkBP6X6I/AAAAAAAAA30/mLdLx2DiUNQ/s1600/Attempt+xxxx.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="236" src="http://2.bp.blogspot.com/-6mLyhyOm5d4/TnXJkBP6X6I/AAAAAAAAA30/mLdLx2DiUNQ/s320/Attempt+xxxx.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Nothing again... grmph...Getting desperate here! When i return back to the window every time """" are added to the condition.&amp;nbsp; &lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-JtN5Gkgy0Xg/TnXJ6TaxTZI/AAAAAAAAA34/IB8aDafphE4/s1600/return+attempt.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="153" src="http://4.bp.blogspot.com/-JtN5Gkgy0Xg/TnXJ6TaxTZI/AAAAAAAAA34/IB8aDafphE4/s320/return+attempt.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The solutions (?)&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Solution 1&lt;/i&gt;&lt;b&gt; &lt;/b&gt;&lt;br /&gt;On &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/f9bbe09e-1eef-4d19-926a-4710844a1a58/"&gt;MSDN&lt;/a&gt; i've found an example. I&amp;nbsp; need to set the expression to =(Fields!Department_Description.Value = "Department A" OR Fields!Department_Description.Value = "Department E")&lt;br /&gt;&lt;br /&gt;and set the Filter to boolean.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-NRyxMuG1-mA/TnXKx3lgHZI/AAAAAAAAA38/V9yi7P5r3S8/s1600/nirvana.png" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://1.bp.blogspot.com/-NRyxMuG1-mA/TnXKx3lgHZI/AAAAAAAAA38/V9yi7P5r3S8/s400/nirvana.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-FvIk92YN9s8/TnW2naJYqcI/AAAAAAAAA3Q/BZQZIg737A0/s1600/Attempt5.png" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;&lt;i&gt;Solution 2&lt;/i&gt; &lt;br /&gt;Another solution i've found on a site of &lt;a href="http://blog.datainspirations.com/2010/12/21/working-with-reporting-services-filterspart-1/"&gt;data inspirations&lt;/a&gt;&amp;nbsp;:&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-hCUWC7ec180/Tnh3EIVZOwI/AAAAAAAAA4A/uAKQXRaHEbU/s1600/newsolution.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="316" src="http://4.bp.blogspot.com/-hCUWC7ec180/Tnh3EIVZOwI/AAAAAAAAA4A/uAKQXRaHEbU/s400/newsolution.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;And the expression is : =SPLIT("Department A" + "," + "Department E", ",")&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;Conclusion &lt;/b&gt;&lt;br /&gt;The solution proposed on the MSDN forums is not very intuitive. The other example from the site data inspirations is a bit more intuitive but you have to use the SPLIT function.&lt;br /&gt;&lt;br /&gt;Reportbuilder is used by end users for building Self Service BI reports, but this filter functionalitity is hard to understand.&amp;nbsp;I hope Microsoft do a better job building the successor of Reportbuilder.&lt;br /&gt;&lt;br /&gt;Greetz,&lt;br /&gt;Hennie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-1290486868456074328?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/1290486868456074328/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2011/09/ssrs-6-attempts-with-reportfilter-and.html#comment-form' title='1 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/1290486868456074328'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/1290486868456074328'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2011/09/ssrs-6-attempts-with-reportfilter-and.html' title='SSRS: 5 Attempts and 2 solutions with reportfilter and multiple conditions (grmph)'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-luXdH6ezxik/TnW3gH9iG8I/AAAAAAAAA3U/2cOi5w9AawM/s72-c/example+technet.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-7258188442659976891</id><published>2011-09-18T10:08:00.001+02:00</published><updated>2011-11-06T12:16:55.892+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSAS'/><category scheme='http://www.blogger.com/atom/ns#' term='SQLServer'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>SSAS : Field (Y/N)  'a' in Fact A impacts on rows Fact B</title><content type='html'>&lt;b&gt;Introduction&lt;/b&gt;&lt;br /&gt;I've a requirement from a customer about combining facts and selecting them with a Y/N field. This blogpost descibes this requirement and the translation in a solution. This blogpost is simplified version of the 'real world' situation. Suppose you have two facts : 'A' and 'B'. Fact A has a field 'a' and this field can be Yes or No. The user wants to use this field to limit the rows in Fact B, somehow.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Options&lt;/b&gt;&lt;br /&gt;When i started to investigate this problem, i came to three options:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Put the Yes/No field a in a separate dimension and use the dimension in both facts&lt;/li&gt;&lt;li&gt;Load the Yes/No field during the ETL in both facts.&lt;/li&gt;&lt;li&gt;Create an view where the two facts and the field are combined.&lt;/li&gt;&lt;/ol&gt;In my opinion option 1 is more rigid option than option 2. Option 2 is more flexible because i've to ability to set field a in Fact A and B independant. I've not investigated option 3, furthermore.&lt;br /&gt;&lt;br /&gt;In this post i'll explain option 1. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;The problem&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;First i'll describe the initial situation i've created. Below you can see my cube with the two facts A and B, two dimensions DimDepartment and Dimdate and the involved field ShowAllYN that should impact on both facts&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-MLdX8kmoSbs/TnM_ukTEZ_I/AAAAAAAAA2s/-zfCAbxzYgU/s1600/CubestructureTwofacts.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="263" src="http://4.bp.blogspot.com/-MLdX8kmoSbs/TnM_ukTEZ_I/AAAAAAAAA2s/-zfCAbxzYgU/s320/CubestructureTwofacts.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-xBXqCRasStU/TnM_jnzn-LI/AAAAAAAAA2o/aOfrKl8ie1Y/s1600/CubestructureTwofacts.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;When i browse the cube in SSMS, select field Fact A Count and Fact B Count and watch the result per department :&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-hVLUDbc_rfY/TnNS4_HZu7I/AAAAAAAAA2w/lebDJJdOtNs/s1600/Twofactsproblembrowse.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="125" src="http://2.bp.blogspot.com/-hVLUDbc_rfY/TnNS4_HZu7I/AAAAAAAAA2w/lebDJJdOtNs/s400/Twofactsproblembrowse.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The results of Fact A are limited, but the results in Fact B aren't (off course). So, how can i achieve that field "Show All YN"impacts both on FactA and FactB?&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Solution (option 1)&lt;/b&gt;&lt;br /&gt;The solution that is described in this blogpost is option 1. In option 1 a separate dimension is created, named DimFactA_DD dimension. The ShowAllYN field is not available anymore in fact A, but moved to this DD dimension. Normally you would create a Fact cubedimension for this kind of degenerated dimension fields. But in this case we need to create a separate (regular) dimension.&lt;br /&gt;&lt;br /&gt;So the cube structure is now changed to the following structure:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-QfmbhD1kCPg/TnWgctD8OiI/AAAAAAAAA20/aXlCca1fr4c/s1600/cubestructure+with+DD+dimension.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="275" src="http://4.bp.blogspot.com/-QfmbhD1kCPg/TnWgctD8OiI/AAAAAAAAA20/aXlCca1fr4c/s400/cubestructure+with+DD+dimension.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;And how does this look like in the cube browser? First let's look at the whether everything works ok when i don't use the DD dimension:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-P7H913Fadm8/TnWkb8UEvUI/AAAAAAAAA28/bOYO57jbHQw/s1600/normal+behaviour.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="177" src="http://2.bp.blogspot.com/-P7H913Fadm8/TnWkb8UEvUI/AAAAAAAAA28/bOYO57jbHQw/s400/normal+behaviour.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;The next step is using the DD dimension for both facts:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-rdBaUTjNIuk/TnWkU8YrGAI/AAAAAAAAA24/hpkh5GKtP7M/s1600/now+with+the+DD+dimension.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="155" src="http://2.bp.blogspot.com/-rdBaUTjNIuk/TnWkU8YrGAI/AAAAAAAAA24/hpkh5GKtP7M/s400/now+with+the+DD+dimension.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;As you can see selecting the Y/N field has an impact on the measures now, just as we wanted.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;br /&gt;In this post I've described one option that can be used for selecting multiple facts based on one field. There are many variations on this topic. One variation could be that you leave the Y/N field in the FactA, add one in Fact B and use the combined DD dimension. This way a very flexible solution can exist, but you have some redundancy.&lt;br /&gt;&lt;br /&gt;I've implemented option 2 at the customer and this gives me more flexibility than option 1 but the solution descibed in this blogpost is a much nicer solution in my opinion.&lt;br /&gt;&lt;br /&gt;Greetz,&lt;br /&gt;Hennie&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-7258188442659976891?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/7258188442659976891/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2011/09/ssas-field-yn-in-fact-impacts-on-rows.html#comment-form' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/7258188442659976891'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/7258188442659976891'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2011/09/ssas-field-yn-in-fact-impacts-on-rows.html' title='SSAS : Field (Y/N)  &apos;a&apos; in Fact A impacts on rows Fact B'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-MLdX8kmoSbs/TnM_ukTEZ_I/AAAAAAAAA2s/-zfCAbxzYgU/s72-c/CubestructureTwofacts.png' height='72' width='72'/><thr:total>0</thr:total><georss:featurename>Utrecht, Nederland</georss:featurename><georss:point>52.0901422 5.1096649</georss:point><georss:box>52.0120942 4.951736400000001 52.168190200000005 5.2675934</georss:box></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-2717124500208990896</id><published>2011-09-12T17:31:00.001+02:00</published><updated>2011-09-12T21:32:29.159+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSAS'/><title type='text'>SSAS : Setup dynamic dimension security in Analysis Services</title><content type='html'>&lt;b&gt;Introduction&lt;/b&gt;&lt;br /&gt;In SSAS implementations there is always a demand for implementing security. There are multiple possible security options and this blogpost focuses on data level security or row level security : security that depends on the useraccount and connects users to certain rows in a table. Users needs to be managed as new users appear, some will disappear and from some users may change their role.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;/b&gt;&lt;br /&gt;In this post i'll descibe the dynamic dimension security in SSAS i've built at a customer. It's also called 'attribute hierarchy security'. Dynamic dimension security is about allowing restrictive number of users to a certain set of information in your cube. So you need to create an allowed set of members that users in a role are permitted to access. In this blogpost i'll be defining a set by building a MDX query for showing departments for certain users.&lt;br /&gt;&lt;br /&gt;In this post we will build a security based on a department dimension. The cube is secured by the department dimension, a bridge tabel and a user table. In addition, i have leveraged two local user accounts: SSASUser and SSASUser2.&lt;br /&gt;&lt;br /&gt;Here are the steps that needs to be taken for a successful implementation of dynamic dimension security:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Create a table users with username field that should store the Windows accounts.&lt;/li&gt;&lt;li&gt;Create a bridge table that models the M2M relationship between users and department.&lt;/li&gt;&lt;li&gt;Fill the tables with appropriate values.&lt;/li&gt;&lt;li&gt;Add the tables to the datasourcce view of the SSAS project.&lt;/li&gt;&lt;li&gt;Create a user dimension.&lt;/li&gt;&lt;li&gt;Create a measure group for bridging the users and department.&lt;/li&gt;&lt;li&gt;Create regular relationships between users and the bridge userdepartment.&lt;/li&gt;&lt;li&gt;Create a new role in BIDS/SSMS.&lt;/li&gt;&lt;li&gt;Add&amp;nbsp;MDX statement to the Allowed member set and set the Enable visual totals checkbox.&lt;/li&gt;&lt;li&gt;Deploy and test.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;b&gt;Setup&lt;/b&gt;&lt;br /&gt;Below are the steps described that i've taken to build a dynamic dimension security.&lt;br /&gt;&lt;br /&gt;1) Create two SSAS users. I'll be using these users for testing the dynamic dimension security. I've added these to the SSASusers and the SSASUsers2 group.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-527HpuHqOQU/TmO3JhD3x9I/AAAAAAAAA1g/R2oyhdDZN8U/s1600/SSASUsers.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="220" src="http://4.bp.blogspot.com/-527HpuHqOQU/TmO3JhD3x9I/AAAAAAAAA1g/R2oyhdDZN8U/s400/SSASUsers.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://1.bp.blogspot.com/-5xIf4kqYIV0/TmO2fFkZs4I/AAAAAAAAA1c/EhgwLNg4RUM/s1600/SSASUsers2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;2) Create some tables in SQL and build a cube on the tables with the following structure:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-vuk19YZwQ7c/Tmdc_2Fdh7I/AAAAAAAAA1k/bsLBP_1Nh7k/s1600/DScubestructure.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="265" src="http://3.bp.blogspot.com/-vuk19YZwQ7c/Tmdc_2Fdh7I/AAAAAAAAA1k/bsLBP_1Nh7k/s640/DScubestructure.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;There a couple of sections involved in this diagram: a fact called, FactTest, a M2M dimension and a bridge for the security. The FactTest is a small example with two dimenions Date and Location. The M2M dimension setup is a bridge (BridgeLocationDepartment) and a Department dimension. The requirements of my customer tells me that there is a n:m relation between location and department. For this blogpost i've added two tables : BridgeUserDepartment and user. Most of these tables are described in more detail in other blogposts about SSAS M2M dimensions. You can find them here:&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://bifuture.blogspot.com/2011/06/ssaskimball-modeling-nm-relation.html"&gt;SSAS/KIMBALL: modeling a N:M relation between dimensions (part I) &lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://bifuture.blogspot.com/2011/06/ssaskimball-building-multivalue.html"&gt;SSAS/Kimball : building a multivalue dimension construction in SSAS (part II)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://bifuture.blogspot.com/2011/07/ssas-joining-issue-with-mdxing-of-m2m.html"&gt;SSAS: Joining issue with MDXing of M2M dimension (part III)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://bifuture.blogspot.com/2011/07/ssasssrs-cascading-parameters-in-ssrs.html"&gt;SSAS/SSRS/MDX : Cascading parameters and M2M dimensions&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://bifuture.blogspot.com/2011/07/ssasssrs-building-graph-for-analyzing.html"&gt;SSAS/SSRS : Building a graph for analyzing a subset related to the whole set&amp;nbsp;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;3) So there is n:m relation between location&amp;nbsp;and department, a fact table, a date dimension and especially for this blogpost i've added two extra tables and these controls the security on the cube: BridgeUserDepartment and Users. The BridgeUserDepartment table handles the n:m relation between department and users. The first thing to check is the relation between User and Department:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&amp;nbsp;&lt;a href="http://3.bp.blogspot.com/-HRmK7MeeJH0/Tmdh1CihMYI/AAAAAAAAA1o/yMpSONZ_6ZM/s1600/BridgeUserDepartment.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="93" src="http://3.bp.blogspot.com/-HRmK7MeeJH0/Tmdh1CihMYI/AAAAAAAAA1o/yMpSONZ_6ZM/s320/BridgeUserDepartment.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;User_Dim_Key 1 is the SSASUser and 2 is the SSASUser2.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Querying with MDX the Bridge User Department, SSASUser and SSAUser2 shows the following results:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-viAJsiQL2Kc/TmdkIEX0MyI/AAAAAAAAA1s/tuZkgbHkto8/s1600/TOTALMDXquery.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://1.bp.blogspot.com/-viAJsiQL2Kc/TmdkIEX0MyI/AAAAAAAAA1s/tuZkgbHkto8/s400/TOTALMDXquery.png" width="336" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;4) In this step w'll setup the dynamic security for this cube. We will create a new role, Dynamic Security, with read access to the ResearchAverage cube. &lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-6vBUYWKP80o/TmdlFgazm7I/AAAAAAAAA1w/bjAffQWAIAc/s1600/Create+role.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="287" src="http://1.bp.blogspot.com/-6vBUYWKP80o/TmdlFgazm7I/AAAAAAAAA1w/bjAffQWAIAc/s320/Create+role.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Add the SSASUser and SSASUser2 users to the membership tab.This step is a pitty one, in my opinion. Now i've to set something at two places: in the database and in the membership tab in Analysis. &lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-sY_nHNLuPjo/TmdlWBEgNcI/AAAAAAAAA10/zn625PLM-2s/s1600/Membership.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="287" src="http://1.bp.blogspot.com/-sY_nHNLuPjo/TmdlWBEgNcI/AAAAAAAAA10/zn625PLM-2s/s320/Membership.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Give read access to the cube:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-WW0GDIEQT6o/Tmdli43jkFI/AAAAAAAAA14/gIBBKiPFZac/s1600/Access.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="287" src="http://4.bp.blogspot.com/-WW0GDIEQT6o/Tmdli43jkFI/AAAAAAAAA14/gIBBKiPFZac/s320/Access.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;The next steps are done in BIDS (denali) but it makes no difference where you setup the security (in SSMS or BIDS). Only when you setup the security in SSMS, it will be overwritten when the cube is deployed from BIDS. The next step took me a while to understand when i&amp;nbsp;was working at the customer. In this customer situation there are about 50 dimensions and a lot of role playing dimensions. One error i keep on getting was&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span style="color: red;"&gt;"An error occurred in the MDX script for the dimension attribute permission's allowed member set: The dimension '[User]' was not found in the cube when the string, [User].[UserName].[UserName].&amp;amp;[&amp;lt;user&amp;gt;], was parsed."&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Because i had so many dimensions i didn't see the cube dimensions, at first. So i implemented the security at databasedimension level and not at cube dimensionlevel. The combobox "dimension" stores both database dimensions and cube dimensions. This is very confusing. I'm not completely sure that this also needed in this every situation. Anyway i've implemented the security at &lt;i&gt;&lt;b&gt;cubedimension&lt;/b&gt;&lt;/i&gt; level.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-G982u1tP2PM/Tmy0F0nq45I/AAAAAAAAA18/NN6tl7f4hZs/s1600/Attribute+security+on+cubedimension.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="169" src="http://3.bp.blogspot.com/-G982u1tP2PM/Tmy0F0nq45I/AAAAAAAAA18/NN6tl7f4hZs/s320/Attribute+security+on+cubedimension.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The following window does the trick. It limits the allowed set because of the usage of the UserName() function. This function returns a windows useraccount like Laptop\Hennie or Laptop\SSASUser.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-4AcxOrMnoy4/Tmy0GR85tdI/AAAAAAAAA2A/wod6zcX3Mu8/s1600/allowed+member+set.png" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="266" src="http://4.bp.blogspot.com/-4AcxOrMnoy4/Tmy0GR85tdI/AAAAAAAAA2A/wod6zcX3Mu8/s320/allowed+member+set.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;I've left open&amp;nbsp;the "enable visual totals" (lower left) intentionally and pressed on check (not shown in the window) and we have a....successful check!&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-K8losRxduHM/Tmy0iuiGMYI/AAAAAAAAA2E/nqNeGHW06OU/s1600/checkok.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="64" src="http://1.bp.blogspot.com/-K8losRxduHM/Tmy0iuiGMYI/AAAAAAAAA2E/nqNeGHW06OU/s320/checkok.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;The next step is running SSMS with the SSASUser account&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/--xKYxrxqgyk/Tmy03UskxkI/AAAAAAAAA2I/b3UQ63eK7X8/s1600/RUNASSSASUser.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="87" src="http://4.bp.blogspot.com/--xKYxrxqgyk/Tmy03UskxkI/AAAAAAAAA2I/b3UQ63eK7X8/s320/RUNASSSASUser.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;And we can only see the departments that are authorized for the SSASUser:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-SYKqsfYaZJc/Tmy1Z2NtEhI/AAAAAAAAA2M/gvVkYj1TiCc/s1600/and+the+results+are.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="191" src="http://4.bp.blogspot.com/-SYKqsfYaZJc/Tmy1Z2NtEhI/AAAAAAAAA2M/gvVkYj1TiCc/s320/and+the+results+are.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The next step is running SSMS with the SSASUser2 account&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-zTrBvfH-494/Tmy1v3kQpPI/AAAAAAAAA2Q/pf6xv-tl6No/s1600/runas+SSASUser2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="81" src="http://4.bp.blogspot.com/-zTrBvfH-494/Tmy1v3kQpPI/AAAAAAAAA2Q/pf6xv-tl6No/s320/runas+SSASUser2.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;And we can only see the departments that are granted by SSASUser2:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/--Q6FBl4An7A/Tmy1wSzBOYI/AAAAAAAAA2U/RRa5wERWcRM/s1600/SSASUSer2results.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="179" src="http://2.bp.blogspot.com/--Q6FBl4An7A/Tmy1wSzBOYI/AAAAAAAAA2U/RRa5wERWcRM/s320/SSASUSer2results.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Okay, let's try another dimension like date and ...Now we can see all the information. That was not supposed to happen.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-X-Nn2Jzso3Q/Tmy2YIORkJI/AAAAAAAAA2Y/qCZad3lQ8Lg/s1600/alltheresults.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="251" src="http://2.bp.blogspot.com/-X-Nn2Jzso3Q/Tmy2YIORkJI/AAAAAAAAA2Y/qCZad3lQ8Lg/s320/alltheresults.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;You can solve this with "enable visual totals" option.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-SSHP5BKSbLk/Tmy2czXyxsI/AAAAAAAAA2c/Pw_9Yyq9i7M/s1600/nowwithvisualtotals.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="268" src="http://1.bp.blogspot.com/-SSHP5BKSbLk/Tmy2czXyxsI/AAAAAAAAA2c/Pw_9Yyq9i7M/s320/nowwithvisualtotals.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;And now only the facts are shown that belongs to a department:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-pVuOcXKnI7Y/Tmy29AMB0dI/AAAAAAAAA2g/8yc_dEqolUA/s1600/resultwithvisualtotals.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="252" src="http://1.bp.blogspot.com/-pVuOcXKnI7Y/Tmy29AMB0dI/AAAAAAAAA2g/8yc_dEqolUA/s320/resultwithvisualtotals.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;Other things to do are making things invisible. The Bridge User Department measure and the User dimension provides a base for the security of the dynamic dimension security. These tables are only needed for the security and not for end user querying. So these two should be set to invisible. Important note: these are only hidden and when the end user is familiar with the presence of them, still they can query them.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Conclusions&lt;/b&gt;&lt;br /&gt;There some things that are a bit annoying in my opinion:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;It's not fully dynamic because i've to add the user to the membership tab also. To grant a user i've to add the user to the database and to the memership tab.&amp;nbsp;&lt;/li&gt;&lt;li&gt;The distinction between regular and cube dimension did cost me a lot of time to find out, because i didn't see the cube dimensions at first sight (because the customer had about 50 dimensions).&lt;/li&gt;&lt;li&gt;Another problem i've encountered now is that i've a benchmark graph with all departments and the user can compare his department with all of the other departments. Now with this security only the departments which are granted to the user&amp;nbsp;are visible. I'm still working on a solution for this. When i've a proper solution i'll blog about this. &lt;/li&gt;&lt;/ul&gt;So for securing the cube, dynamic security is a great solution for letting the users play with the cubes with Excel. &lt;br /&gt;&lt;br /&gt;Greetz,&lt;br /&gt;Hennie&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-2717124500208990896?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/2717124500208990896/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2011/09/ssas-setup-dynamic-security-in-analysis.html#comment-form' title='2 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/2717124500208990896'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/2717124500208990896'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2011/09/ssas-setup-dynamic-security-in-analysis.html' title='SSAS : Setup dynamic dimension security in Analysis Services'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-527HpuHqOQU/TmO3JhD3x9I/AAAAAAAAA1g/R2oyhdDZN8U/s72-c/SSASUsers.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-1337134743679794570</id><published>2011-09-07T07:38:00.000+02:00</published><updated>2011-09-07T10:12:56.338+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSAS'/><title type='text'>SSAS : Set up simple security in Analysis services</title><content type='html'>&lt;b&gt;Introduction&lt;/b&gt; &lt;br /&gt;In this post i will describe the basics of the security of a cube. For this purpose i'll be using the Resea&lt;span style="font-family: inherit;"&gt;rchAverage cube i've worked before and is described in the following posts:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family: inherit;"&gt;&lt;a href="http://bifuture.blogspot.com/2011/09/ssas-selecting-dynamic-period-from-now.html"&gt;SSAS : Selecting a dynamic period in a MDX query&amp;nbsp;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family: inherit;"&gt;&lt;a href="http://bifuture.blogspot.com/2011/08/ssasssrs-calulating-sums-and-averages.html"&gt;SSAS/SSRS : Calulating sums and averages with M2M dimensions&lt;/a&gt; &amp;nbsp; &lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul style="font-family: inherit;"&gt;&lt;/ul&gt;&lt;div style="font-family: inherit;"&gt;Security in SSAS is controlled by roles which allows you to group windows users according to their needs.&amp;nbsp; (windows) Users are members in roles and that determines whether a user can access a cube (and how).&lt;/div&gt;&lt;br /&gt;&lt;b&gt;Setup&lt;/b&gt;&lt;br /&gt;1) First set up a environment with the scripts i've used before (see former posts)&lt;br /&gt;2) The next thing we need to do is creating a user with Computermanagement (Right click computer and manage):&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-KjJyqnqCuc8/TmNlpqbPEXI/AAAAAAAAA0c/AXFEC7g2sMM/s1600/Create+user.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="130" src="http://4.bp.blogspot.com/-KjJyqnqCuc8/TmNlpqbPEXI/AAAAAAAAA0c/AXFEC7g2sMM/s320/Create+user.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;3) Create a group SSASUsers and add a user to the group:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-q2NX66yf6lw/TmNmDZeMsmI/AAAAAAAAA0g/MKrpvhcRr9Y/s1600/Group.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="315" src="http://1.bp.blogspot.com/-q2NX66yf6lw/TmNmDZeMsmI/AAAAAAAAA0g/MKrpvhcRr9Y/s320/Group.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;4)&amp;nbsp; Create a role in Analysis Services&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-nfsgdrHSbNA/TmNnHTniZvI/AAAAAAAAA0k/pA4sOSKoy-c/s1600/Newrole.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="212" src="http://3.bp.blogspot.com/-nfsgdrHSbNA/TmNnHTniZvI/AAAAAAAAA0k/pA4sOSKoy-c/s320/Newrole.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;5) Add the user to the role&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-HYBdB5Tw5lk/TmNoGIMJvgI/AAAAAAAAA0o/XldOtQs3fV0/s1600/SSASUsersToRole.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="287" src="http://4.bp.blogspot.com/-HYBdB5Tw5lk/TmNoGIMJvgI/AAAAAAAAA0o/XldOtQs3fV0/s320/SSASUsersToRole.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;6) Select "Read" in the Access field:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-UBXNPYSAahQ/TmNoh1UiWII/AAAAAAAAA0s/XP59679yARo/s1600/Access+Read.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="287" src="http://1.bp.blogspot.com/-UBXNPYSAahQ/TmNoh1UiWII/AAAAAAAAA0s/XP59679yARo/s320/Access+Read.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;7) Run as SSASuser a SQL Server Management Studio session:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-AWRvxzD9Ae8/TmNqH-BzhCI/AAAAAAAAA0w/T6aby9lFoDU/s1600/RUNAS.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="158" src="http://2.bp.blogspot.com/-AWRvxzD9Ae8/TmNqH-BzhCI/AAAAAAAAA0w/T6aby9lFoDU/s320/RUNAS.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;8) Connect with the Analysis server with the SSAS user:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-oayCrzOh5yU/TmNqkBlJjcI/AAAAAAAAA00/bhdWjkqoOkE/s1600/RUNASSSASUser.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-5q1s4j0UeEk/TmOl3CrqcKI/AAAAAAAAA04/HaYRIVIvhYE/s1600/LoginasSSASuser.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="236" src="http://1.bp.blogspot.com/-5q1s4j0UeEk/TmOl3CrqcKI/AAAAAAAAA04/HaYRIVIvhYE/s320/LoginasSSASuser.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;9) let's look at the databases :&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-KkDNXFBg63Q/TmOmG1sltyI/AAAAAAAAA08/3D1EhfVzs6o/s1600/Nodatabasess.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-KkDNXFBg63Q/TmOmG1sltyI/AAAAAAAAA08/3D1EhfVzs6o/s1600/Nodatabasess.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;No databases?&lt;br /&gt;&lt;br /&gt;10) Let's try a query to check whether we can query the database. The first thing that happens when i press new query is that Database is automatically selected:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-IzOnE9-_ePI/TmOsBY5zaQI/AAAAAAAAA1E/XEhcCPqVua8/s1600/AutomaticDBselection.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="186" src="http://4.bp.blogspot.com/-IzOnE9-_ePI/TmOsBY5zaQI/AAAAAAAAA1E/XEhcCPqVua8/s320/AutomaticDBselection.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;And let's try a query:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/--Zvd62BlrCE/TmOqUlUj7nI/AAAAAAAAA1A/Sv944dQA924/s1600/MDXCheckRead.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="251" src="http://2.bp.blogspot.com/--Zvd62BlrCE/TmOqUlUj7nI/AAAAAAAAA1A/Sv944dQA924/s320/MDXCheckRead.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;It seems that we can query the database without viewing the definition of the database.&lt;br /&gt;&lt;br /&gt;11) let's try whether we can connect to the cube with Excel&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-iZTaSc_UeW8/TmOwgPk213I/AAAAAAAAA1I/mS6NwD0G1hM/s1600/SelectDatabaseExcel.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="223" src="http://3.bp.blogspot.com/-iZTaSc_UeW8/TmOwgPk213I/AAAAAAAAA1I/mS6NwD0G1hM/s320/SelectDatabaseExcel.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;12) Excel&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-PtCwpaSPOzo/TmOxBOD2TKI/AAAAAAAAA1M/DN-TLpL07Os/s1600/Excel.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="301" src="http://3.bp.blogspot.com/-PtCwpaSPOzo/TmOxBOD2TKI/AAAAAAAAA1M/DN-TLpL07Os/s320/Excel.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Why can't we see the cube in SSMS? On the General tab there is a Read defintion checkbox &lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-mcq8KD-_9rQ/TmOxkGk_-UI/AAAAAAAAA1Q/HOx7HZugEAc/s1600/Readefintion.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="287" src="http://2.bp.blogspot.com/-mcq8KD-_9rQ/TmOxkGk_-UI/AAAAAAAAA1Q/HOx7HZugEAc/s320/Readefintion.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Can we see the cube now in SSMS?&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/--ydxtiyVNdM/TmOyAtfs1gI/AAAAAAAAA1U/kIkx9Uz_xgM/s1600/Readdefintion.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="159" src="http://2.bp.blogspot.com/--ydxtiyVNdM/TmOyAtfs1gI/AAAAAAAAA1U/kIkx9Uz_xgM/s320/Readdefintion.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;br /&gt;This blogpost is about a simple security model. This way you can setup quite easily a basic security in a early stage of a project or in case of a small project.&lt;br /&gt;&lt;br /&gt;Gr,&lt;br /&gt;Hennie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-1337134743679794570?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/1337134743679794570/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2011/09/ssas-set-up-simple-security-in-analysis.html#comment-form' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/1337134743679794570'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/1337134743679794570'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2011/09/ssas-set-up-simple-security-in-analysis.html' title='SSAS : Set up simple security in Analysis services'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-KjJyqnqCuc8/TmNlpqbPEXI/AAAAAAAAA0c/AXFEC7g2sMM/s72-c/Create+user.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-5873643634533904331</id><published>2011-09-02T08:17:00.000+02:00</published><updated>2011-09-02T09:05:08.997+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MDX'/><category scheme='http://www.blogger.com/atom/ns#' term='SSAS'/><title type='text'>SSAS : Selecting a dynamic period in a MDX query</title><content type='html'>&lt;b&gt;Introduction&lt;/b&gt;&lt;br /&gt;In many customer wishes i've encountered so far, they want a dynamic report that shows the data until now. In SQL there is a GETDATE() function avaliable to build dynamic queries with dates. IN MDX there is a NOW() function available. In this small post i'll show you an example of a MDX query with a sliding window principle.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Solution&lt;/b&gt; &lt;br /&gt;How could you solve this with MDX? For this post i've used a cube from a former &lt;a href="http://bifuture.blogspot.com/2011/08/ssasssrs-calulating-sums-and-averages.html"&gt;post&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-Whlx2iabkfM/Tl5MvciFCII/AAAAAAAAA0U/q-0QdZLNQfk/s1600/Dynamic+period.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="237" src="http://1.bp.blogspot.com/-Whlx2iabkfM/Tl5MvciFCII/AAAAAAAAA0U/q-0QdZLNQfk/s400/Dynamic+period.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The most important part is the following snippet:&lt;br /&gt;&lt;br /&gt;STRTOMEMBER('[DimDate].[Date Year].&amp;amp;[' + CSTR(YEAR(now())-3) + ']'):STRTOMEMBER('[DimDate].[Date Year].&amp;amp;[' + CSTR(YEAR(now())) + ']')&lt;br /&gt;&lt;br /&gt;The NOW() function calculates the current date and the CSTR() funtion turns it into a string which in turn can be concatenated with the other string. The : is a range operator that returns a window from 2008 (2011 -3) until 2011 (now).&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;br /&gt;Very handy for building dynamic period reports with MDX.&lt;br /&gt;&lt;br /&gt;Greetz,&lt;br /&gt;Hennie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-5873643634533904331?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/5873643634533904331/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2011/09/ssas-selecting-dynamic-period-from-now.html#comment-form' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/5873643634533904331'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/5873643634533904331'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2011/09/ssas-selecting-dynamic-period-from-now.html' title='SSAS : Selecting a dynamic period in a MDX query'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-Whlx2iabkfM/Tl5MvciFCII/AAAAAAAAA0U/q-0QdZLNQfk/s72-c/Dynamic+period.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-1256136949547164456</id><published>2011-08-28T21:29:00.004+02:00</published><updated>2011-08-31T16:44:46.490+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MDX'/><category scheme='http://www.blogger.com/atom/ns#' term='SSAS'/><category scheme='http://www.blogger.com/atom/ns#' term='SSRS'/><title type='text'>SSAS/SSRS : Calulating sums and averages with M2M dimensions</title><content type='html'>&lt;b&gt;Introduction &lt;/b&gt;&lt;br /&gt;Today a post about calculating averages of departments and these measures are compared&amp;nbsp;to a specific department. I have a requirement to build a&amp;nbsp;report with a graph with values for a specific department. Another demand is to build a line in&amp;nbsp;the graph with averages of all (?)&amp;nbsp;of the departments of the organization. The report must allow the user to select the department from a dropdown list in a report parameter.&amp;nbsp; Based on the selected department the report should show measures for the selected department and an average of all departments.&lt;br /&gt;&lt;br /&gt;There is an extra 'dimension'(!) in this investigation and that is how an average is calculated when we are dealing with a M2M dimensions. As you may know from my former posts M2M dimensions are specific parts of the star schemas methodology and SSAS:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://bifuture.blogspot.com/2011/06/ssaskimball-modeling-nm-relation.html"&gt;SSAS/KIMBALL: modeling a N:M relation between dimensions (part I) &lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://bifuture.blogspot.com/2011/06/ssaskimball-building-multivalue.html"&gt;SSAS/Kimball : building a multivalue dimension construction in SSAS (part II)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://bifuture.blogspot.com/2011/07/ssas-joining-issue-with-mdxing-of-m2m.html"&gt;SSAS: Joining issue with MDXing of M2M dimension (part III)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://bifuture.blogspot.com/2011/07/ssasssrs-cascading-parameters-in-ssrs.html"&gt;SSAS/SSRS/MDX : Cascading parameters and M2M dimensions&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://bifuture.blogspot.com/2011/07/ssasssrs-building-graph-for-analyzing.html"&gt;SSAS/SSRS : Building a graph for analyzing a subset related to the whole set&amp;nbsp;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;b&gt;Before we begin&lt;/b&gt;&lt;br /&gt;For this post i've created a lab environment for studying the average calculation of factrecords regarding M2M dimensions. I've used the same script from the post:"&lt;a href="http://bifuture.blogspot.com/2011/07/ssasssrs-building-graph-for-analyzing.html"&gt;SSAS/SSRS : Building a graph for analyzing a subset related to the whole set&lt;/a&gt;". I've build a cube on these tables and it has the following structure:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-qhFOkh5nOJY/ThoAkLGqDZI/AAAAAAAAAoc/RKskbX-EGlw/s1600/CubeGraphProblem.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="223" src="http://1.bp.blogspot.com/-qhFOkh5nOJY/ThoAkLGqDZI/AAAAAAAAAoc/RKskbX-EGlw/s400/CubeGraphProblem.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt;SQL Analysis&lt;/b&gt; &lt;br /&gt;Let's investigate the values in the relational tables before we investigate the OLAP cube with MDX. For this investigation w'll focus on department G and the year 2009.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;1) Aggregating the results by year &lt;/i&gt;&lt;br /&gt;In this first investigation of the totals by year shows that the FacTestCount is summarized to 35. This is a simple query and there is no involvement of the bridge table and the department dimension.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-fRWc6QrqpxE/TlflOJ8uB_I/AAAAAAAAAzk/849dF0_xn5E/s1600/All+Years+M2M+dimension.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="245" src="http://1.bp.blogspot.com/-fRWc6QrqpxE/TlflOJ8uB_I/AAAAAAAAAzk/849dF0_xn5E/s400/All+Years+M2M+dimension.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;2)&amp;nbsp; &lt;i&gt;Aggregating the results by year by location&lt;/i&gt;&lt;br /&gt;In this testquery i've added&amp;nbsp;an extra dimension to the query: DimLocation. As you may have expected nothing changes because the location dimension is a 'normal' dimension. No cartesian product takes place (as will happen when we include the DimDepartment dimension in the next query).&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-q1vXeolUd-4/TlfmOGkBSeI/AAAAAAAAAzs/yYBPjDDqOPI/s1600/All+Years+All+Departments+M2M+dimension.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://3.bp.blogspot.com/-q1vXeolUd-4/TlfmOGkBSeI/AAAAAAAAAzs/yYBPjDDqOPI/s400/All+Years+All+Departments+M2M+dimension.png" width="396" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;3)&lt;/i&gt;&amp;nbsp; &lt;i&gt;Aggregating the results by year by location by Department&lt;/i&gt;&lt;br /&gt;In the next query i've included the table DimDepartment and the bridgetable BridgeLocationDepartment and now something happens to the results: for the year 2009 the results have changed from 35 to 62. Because of the cartesian product we now have 62.&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-zIARIT06HMo/TlfmHLGh74I/AAAAAAAAAzo/MNVi5nEPdlo/s1600/All+Years+All+Departments+All+LocationsM2M+dimension.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://1.bp.blogspot.com/-zIARIT06HMo/TlfmHLGh74I/AAAAAAAAAzo/MNVi5nEPdlo/s400/All+Years+All+Departments+All+LocationsM2M+dimension.png" width="386" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;4)&lt;i&gt; Aggregating the results by year by Department G&lt;/i&gt;&lt;br /&gt;As earlier mentioned in this post w'll focus on Department G and the year 2009. In the query below you can see that we have 14 as the result of the query (for the year 2009):&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-XiROMDn-Y7s/TlfoTjQdq3I/AAAAAAAAAzw/uSmKcgSrpD8/s1600/DepartmentG.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="217" src="http://3.bp.blogspot.com/-XiROMDn-Y7s/TlfoTjQdq3I/AAAAAAAAAzw/uSmKcgSrpD8/s400/DepartmentG.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;Building the MDX statements&lt;/b&gt; &lt;br /&gt;When building reports based on cubes you need to write MDX to get the data from the cube.&amp;nbsp;This paragraph starts with an easy MDX query :&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-5ss2tmRXHO4/Tlfq6LICVSI/AAAAAAAAAz0/dk5QKI6a638/s1600/MDXDepartmentG.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="140" src="http://2.bp.blogspot.com/-5ss2tmRXHO4/Tlfq6LICVSI/AAAAAAAAAz0/dk5QKI6a638/s400/MDXDepartmentG.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;That is the result we would have expected because the SQL query returns also 14 for the year 2009 for department G. Now we need to write an MDX query that calculates the average (and summarization) of all departments by year. Below you can see the query i've written to calculate the following items:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;[Measures].[Fact Test Count].&lt;/b&gt; This measure is the count field in the fact and is used for summarizing (rolling up).&lt;/li&gt;&lt;li&gt;&lt;b&gt;[Measures].[SUM Fact Test Count]&lt;/b&gt;. This a measure where the Fact Test Count is summarized by year and by department.&lt;/li&gt;&lt;li&gt;&lt;b&gt;[Measures].[AVG Fact Test Count Found Departments].&lt;/b&gt; This measure is calculated by taking the average of the departments that &lt;i&gt;have&lt;/i&gt; a factrecord (and not all of&amp;nbsp;departments&amp;nbsp;present in the department dimension&lt;b&gt;). &lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;[Measures].[AVG Fact Test Count All Departments].&lt;/b&gt;&amp;nbsp; This measure calculates the average over &lt;i&gt;all &lt;/i&gt;of the departments that are available in the Department dimension. Even when there a less records in the fact present related to a department&lt;b&gt;.&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;[Measures].[AVG Fact Test Count All Departments2].&lt;/b&gt; This measure is just a test of mine whether i could call a another Calculated member.&lt;/li&gt;&lt;/ul&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-BAXoyHpf8no/Tl5IZD5DQrI/AAAAAAAAA0Q/oeYFR9Kj-l4/s1600/endresultaverageAangepast.png" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="350" src="http://2.bp.blogspot.com/-BAXoyHpf8no/Tl5IZD5DQrI/AAAAAAAAA0Q/oeYFR9Kj-l4/s400/endresultaverageAangepast.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Okay what do we see now? We can see that&amp;nbsp;the total of all departments in the year 2009&amp;nbsp;is equal to the cartesian product SQL query above (62). So that's is a desired outcome. The average by found department is 7.75 (62/8) and these are departments that do have a factrecord. The next measure is 6.2 and that is 62/10 because there 10 departments in the department dimension.&lt;/div&gt;&lt;br /&gt;&lt;b&gt;Building the report&lt;/b&gt;&lt;br /&gt;The next thing to do is building a report with this MDX query. In this report i want to show the selected parameter in a graph and compare this to the average of departments and the sum. Perhaps not a best usability practice of building a graph but this just for showing what is possible with MDX averages, sums and graphs in reports. First build a report, create a datasource to the cube and build a dataset based on the query above. And the next thing is dragging a graph from the toolbox in the report and customize it as below. I've used the average by all departments for comparison of the chosen department in the parameter. &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-fpHo2kBvMr4/TlqL-KrCPUI/AAAAAAAAA0E/jAh8af7wa8k/s1600/diagramwith+averages.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="195" src="http://4.bp.blogspot.com/-fpHo2kBvMr4/TlqL-KrCPUI/AAAAAAAAA0E/jAh8af7wa8k/s400/diagramwith+averages.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;When you run the report it will look like this:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-hK9Qu1MwWrg/TlqMqY4KafI/AAAAAAAAA0I/ztYiIIooLKQ/s1600/endresultaverage+diagram.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="253" src="http://1.bp.blogspot.com/-hK9Qu1MwWrg/TlqMqY4KafI/AAAAAAAAA0I/ztYiIIooLKQ/s400/endresultaverage+diagram.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;I'm not fully convinced whether i've used the right presentation of the values. I've to think about this ;-) What can we learn from such a diagram? Well, there&amp;nbsp;are two years that the measure was below average and the other years showed a higher level than the select department. It depends on the context of the data what this mean, offcourse. If you're talking about profits then&amp;nbsp;that it's a good thing. If you're talking about a number defects then it's a bad thing.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;This post is about investigating the calculation of averages in relation with M2M dimensions. This post helped me understanding what is going on when i calculate an average of departments in MDX with M2M dimensions. In a discussion with my customer we talked about it and we were curious about what is being calculated in a report when an average is calculated. Does it calculate an average of the unique values or the values that multiplied by the cartesian product, does it calculate the averages over the found departments or the departments that are present in the department dimension.&lt;br /&gt;&lt;br /&gt;Hennie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-1256136949547164456?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/1256136949547164456/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2011/08/ssasssrs-calulating-sums-and-averages.html#comment-form' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/1256136949547164456'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/1256136949547164456'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2011/08/ssasssrs-calulating-sums-and-averages.html' title='SSAS/SSRS : Calulating sums and averages with M2M dimensions'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-qhFOkh5nOJY/ThoAkLGqDZI/AAAAAAAAAoc/RKskbX-EGlw/s72-c/CubeGraphProblem.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-2056402895086503139</id><published>2011-08-17T08:04:00.002+02:00</published><updated>2011-08-17T11:07:27.967+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQLServer'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>SQL : joining tables with the OUTER  APPLY</title><content type='html'>&lt;b&gt;Introduction&lt;/b&gt;&lt;br /&gt;In many of my projects i've done sofar, i had to combine tables in order to retrieve keys for my fact tables. When there is a perfect relation available, no worries, no problem. If this perfect relation is&amp;nbsp;perfectly modelled then linking and retrieving proper keys is much more easier then when there is a relation that is not based on proper relation modelling. Sometimes there are cases when you need to link sources from different departments that do not have a common primary-foreign key. Sometimes you need to link tables based on some descriptive fields that are used in both tables. The second problem is that when you do have some fields available for 'fuzzy linking', they return multiple rows back. Returning multiple rows back can cause wrong counts in your fact table. Therefore you need to align the counts of the "default fact source table" with the 'referenced table'.&lt;br /&gt;&lt;br /&gt;For this post i've developed a small example in such a way that it represents the problem i want to examine. In the diagram below the order table is the table that is used as a source&amp;nbsp;for the fact table and i need the department from the order log table to incorporate this in the (to be build) fact table.The relation is based on ''fuzzy linkage" : customer code and a date. And, i need the department key in my fact table. The problem is that there are (for the same customer and date)&amp;nbsp; multiple records&amp;nbsp;with different departments. Therefore a simple distinct won't work.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-uwNfa0ojsJg/TkjUsIAjFtI/AAAAAAAAAyY/uxz32WavdDs/s1600/FuzzyRelationship.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="115" src="http://2.bp.blogspot.com/-uwNfa0ojsJg/TkjUsIAjFtI/AAAAAAAAAyY/uxz32WavdDs/s320/FuzzyRelationship.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;In the past i've solved this&amp;nbsp;with a double subqueries and this is not a good solution because the performance is bad.&amp;nbsp; I decided to investigate this problem in more dept in this post. In this post i'll discover the different options that are available to solve this problem.&lt;br /&gt;&lt;br /&gt;I've four queries developed and these are investigated in this blog.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Option 1 : double subquery.&lt;/li&gt;&lt;li&gt;Option 2 : joining with subquery.&lt;/li&gt;&lt;li&gt;Option 3 : CTE solution.&lt;/li&gt;&lt;li&gt;Option 4 : OUTER APPLY solution.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;b&gt;The case&lt;/b&gt;&lt;br /&gt;This is the script i've used for analyzing the queries:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="font-size: x-small;"&gt;USE [FuzzyLinking]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tblOrder]') AND type in (N'U'))&lt;br /&gt;DROP TABLE [dbo].[tblOrder]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;CREATE TABLE [dbo].[tblOrder](&lt;br /&gt;[OrderID] [int] IDENTITY(1,1) NOT NULL,&lt;br /&gt;[OrderDate] [Datetime] NOT NULL,&lt;br /&gt;[CustomerCode] [varchar] (10) NOT NULL,&lt;br /&gt;[Amount] [int] NOT NULL&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;GO&lt;br /&gt;IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tblOrderLog]') AND type in (N'U'))&lt;br /&gt;DROP TABLE [dbo].[tblOrderLog]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;CREATE TABLE [dbo].[tblOrderLog](&lt;br /&gt;[OrderLogID] [int] IDENTITY(1,1) NOT NULL,&lt;br /&gt;[OrderLogDate] [datetime] NOT NULL,&lt;br /&gt;[CustomerCode] [varchar] (10)&amp;nbsp; NOT NULL,&lt;br /&gt;[DepartmentCode] [int] NOT NULL&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tblDepartment]') AND type in (N'U'))&lt;br /&gt;DROP TABLE [dbo].[tblDepartment]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;CREATE TABLE [dbo].[tblDepartment](&lt;br /&gt;[DepartmentCode] [int] NOT NULL,&lt;br /&gt;[DepartmentDescription] [varchar](50) NOT NULL&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;GO&lt;br /&gt;---&lt;br /&gt;&lt;br /&gt;INSERT INTO dbo.tblDepartment ( DepartmentCode, DepartmentDescription) &lt;br /&gt;VALUES &lt;br /&gt;(1, 'Department A'),&lt;br /&gt;(2, 'Department B'), &lt;br /&gt;(3, 'Department C'), &lt;br /&gt;(4, 'Department D'), &lt;br /&gt;(5, 'Department E')&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;INSERT INTO [dbo].[tblOrder] ([OrderDate],[CustomerCode],[Amount])&lt;br /&gt;VALUES &lt;br /&gt;('2011-08-15 19:40:14.163', 'A', 20.95),&lt;br /&gt;('2011-08-15 05:40:14.554', 'B', 99.54),&lt;br /&gt;('2011-08-16 18:35:25.143', 'B', 12.55),&lt;br /&gt;('2011-08-17 17:23:11.123', 'C', 15.00),&lt;br /&gt;('2011-08-18 23:12:18.434', 'A', 25.00),&lt;br /&gt;('2011-08-19 17:34:12.345', 'A', 27.00);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;br /&gt;INSERT INTO [dbo].[tblOrderLog] ([OrderLogDate],[CustomerCode],[DepartmentCode])&lt;br /&gt;VALUES ('2011-08-15 20:40:14.163', 'A', 1),&lt;br /&gt;('2011-08-15 22:12:11.163', 'A', 2),&lt;br /&gt;('2011-08-15 05:55:14.554', 'B', 2),&lt;br /&gt;('2011-08-16 19:35:25.143', 'C', 3),&lt;br /&gt;('2011-08-17 18:23:11.123', 'C', 3),&lt;br /&gt;('2011-08-19 00:12:18.434', 'A', 2),&lt;br /&gt;('2011-08-19 18:12:18.434', 'A', 3),&lt;br /&gt;('2011-08-19 18:12:18.434', 'A', 4),&lt;br /&gt;('2011-08-20 00:12:18.434', 'A', 5);&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Analysis&lt;/b&gt;&lt;br /&gt;When i write a simple join between the Order and Orderlogtable based on 'customercode' and 'day'&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/-yWJeJ9ESLbw/Tkjg76R0y0I/AAAAAAAAAyg/tjDYhU7hqtQ/s1600/doubleresults.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;/a&gt;&lt;code&gt;&lt;br /&gt;&lt;br /&gt;SELECT &lt;br /&gt;O.OrderID,&lt;br /&gt;O.OrderDate,&lt;br /&gt;O.CustomerCode,&lt;br /&gt;OL.OrderLogID,&lt;br /&gt;OL.OrderLogDate,&lt;br /&gt;OL.DepartmentCode&lt;br /&gt;FROM tblOrder O&lt;br /&gt;INNER JOIN tblOrderLog OL ON O.CustomerCode = OL.CustomerCode &lt;br /&gt;AND CONVERT(varchar(8),O.[OrderDate], 112) = CONVERT(varchar(8),OL.[OrderLogDate], 112) &lt;/code&gt;&lt;br /&gt;&lt;br /&gt;this is resulting in :&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-ZocaW5v0PnE/TkjhcvSV8TI/AAAAAAAAAyk/H-MnKiY6Vpo/s1600/doubleresults.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="98" src="http://2.bp.blogspot.com/-ZocaW5v0PnE/TkjhcvSV8TI/AAAAAAAAAyk/H-MnKiY6Vpo/s320/doubleresults.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href="http://1.bp.blogspot.com/-yWJeJ9ESLbw/Tkjg76R0y0I/AAAAAAAAAyg/tjDYhU7hqtQ/s1600/doubleresults.png" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;As you can see we have multiple OrderID's and this is not a good situation for using this in a fact table. Instead of 6 fact records we now have 9 records and this is caused by the cartesian poduct. This is not a good base for a fact table. So we need some additional work here.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The queries&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Option 1 &lt;/i&gt;&lt;br /&gt;Okay,&amp;nbsp; the first solution here is the one i've used in some of my projects (i've to admit) and that is this query:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;SELECT &lt;br /&gt;O.OrderID,&lt;br /&gt;O.OrderDate,&lt;br /&gt;O.CustomerCode,&lt;br /&gt;D.DepartmentCode&lt;br /&gt;FROM tblOrder O&lt;br /&gt;LEFT OUTER JOIN (&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT OrderLogDate, CustomerCode, DepartmentCode&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; FROM tblOrderLog&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE OrderLogID IN&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; (SELECT Min(OrderLogID)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; FROM tblOrderLog&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; GROUP BY CONVERT(varchar(8),[OrderLogDate], 112) , CustomerCode)) D ON CONVERT(varchar(8),O.[OrderDate], 112)&amp;nbsp; = CONVERT(varchar(8),D.[OrderLogDate], 112) &lt;br /&gt;AND O.CustomerCode= D.CustomerCode&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;and this returns :&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-i5hMsSCJgIQ/TkjlMr2NO1I/AAAAAAAAAyo/TsiBMcqaNeY/s1600/FuzzyLinking+1st+solution.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="103" src="http://2.bp.blogspot.com/-i5hMsSCJgIQ/TkjlMr2NO1I/AAAAAAAAAyo/TsiBMcqaNeY/s320/FuzzyLinking+1st+solution.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;And this is ok. Now i've 6 orders back again. I choosed to take the first orderlog record and the related department. This depends on the businessrules, off course.&lt;br /&gt;&lt;br /&gt;I'm not very satisfied with this solution because two subqueries doesn't seem a good (and a fast) solution to me.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Option 2&lt;/i&gt;&lt;br /&gt;Another option i've researched is the query below. In this query i've reduced the subqueries to one.&lt;br /&gt;&lt;code&gt;&lt;br /&gt;SELECT &lt;br /&gt;O.OrderID,&lt;br /&gt;O.OrderDate,&lt;br /&gt;O.CustomerCode,&lt;br /&gt;OL.DepartmentCode&lt;br /&gt;FROM tblOrder O&lt;br /&gt;LEFT OUTER JOIN tblOrderLog OL ON OL.OrderLogID =&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; (SELECT TOP 1 OrderLogID&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; FROM tblOrderLog OL1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE CONVERT(varchar(8),O.[OrderDate], 112)&amp;nbsp; = CONVERT(varchar(8),OL1.[OrderLogDate], 112) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; AND O.CustomerCode= OL1.CustomerCode&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ORDER BY&amp;nbsp;&amp;nbsp; O.CustomerCode, CONVERT(varchar(8),OL1.[OrderLogDate], 112))&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;And this returns the same values as the query in option 1:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-3YjdfxbDfuo/TkjpQgA4P0I/AAAAAAAAAys/ru2vfDwDZ6w/s1600/FuzzyLinking+1st+solution.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="103" src="http://3.bp.blogspot.com/-3YjdfxbDfuo/TkjpQgA4P0I/AAAAAAAAAys/ru2vfDwDZ6w/s320/FuzzyLinking+1st+solution.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;i&gt;Option 3&lt;/i&gt;&lt;br /&gt;Yet another option i've found is the query written down below. In this query the&amp;nbsp;subsubquery is now&amp;nbsp; vanished. Instead we have now a Common Table Expression (CTE) used. &lt;br /&gt;&lt;br /&gt;&lt;code&gt;WITH CTE_order AS&lt;br /&gt;(SELECT &lt;br /&gt;O.OrderID,&lt;br /&gt;O.OrderDate,&lt;br /&gt;O.CustomerCode,&lt;br /&gt;OL.DepartmentCode,&lt;br /&gt;ROW_NUMBER() OVER (PARTITION BY O.OrderID ORDER BY O.OrderDate) AS RowNo&lt;br /&gt;FROM tblOrder O&lt;br /&gt;LEFT OUTER JOIN tblOrderLog OL ON CONVERT(varchar(8),O.[OrderDate], 112)&amp;nbsp; = CONVERT(varchar(8),OL.[OrderLogDate], 112) &lt;br /&gt;AND O.CustomerCode = OL.CustomerCode)&lt;br /&gt;SELECT&lt;br /&gt;OrderID,&lt;br /&gt;OrderDate,&lt;br /&gt;CustomerCode,&lt;br /&gt;DepartmentCode&lt;br /&gt;FROM CTE_order&lt;br /&gt;WHERE&amp;nbsp; RowNo = 1 OR&amp;nbsp; OrderDate IS NULL;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Also resulting in the same results as we've seen before.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-3YjdfxbDfuo/TkjpQgA4P0I/AAAAAAAAAys/ru2vfDwDZ6w/s1600/FuzzyLinking+1st+solution.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="103" src="http://3.bp.blogspot.com/-3YjdfxbDfuo/TkjpQgA4P0I/AAAAAAAAAys/ru2vfDwDZ6w/s320/FuzzyLinking+1st+solution.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;i&gt;Option 4 &lt;/i&gt;&lt;br /&gt;In the next option i'm using an OUTER APPLY. The OUTER APPLY operator is used for combining tables when there is not a direct JOIN ON possible and you need to join tables based on some fields that are not keys, like in this case. So this seems a perfect match, solving this problem with the OUTER APPLY. This is the query:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;SELECT &lt;br /&gt;O.OrderID,&lt;br /&gt;O.OrderDate,&lt;br /&gt;O.CustomerCode,&lt;br /&gt;O1.DepartmentCode &lt;br /&gt;FROM tblOrder O&lt;br /&gt;OUTER APPLY &lt;br /&gt;( &lt;br /&gt;SELECT TOP 1 OrderLogID, DepartmentCode &lt;br /&gt;FROM tblOrderLog OL1&lt;br /&gt;WHERE CONVERT(varchar(8),O.[OrderDate], 112) = CONVERT(varchar(8),OL1.[OrderLogDate], 112) &lt;br /&gt;AND O.CustomerCode= OL1.CustomerCode&lt;br /&gt;ORDER BY O.CustomerCode, CONVERT(varchar(8),OL1.[OrderLogDate], 112)&lt;br /&gt;) O1 &lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Resulting in.....Yep the same as before :&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-3YjdfxbDfuo/TkjpQgA4P0I/AAAAAAAAAys/ru2vfDwDZ6w/s1600/FuzzyLinking+1st+solution.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="103" src="http://3.bp.blogspot.com/-3YjdfxbDfuo/TkjpQgA4P0I/AAAAAAAAAys/ru2vfDwDZ6w/s320/FuzzyLinking+1st+solution.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Comparing the queries&lt;/i&gt;&lt;br /&gt;As i've read about the OUTER APPLY it has a better performance than subqueries or other solutions. Is this really true? Let's find out. I took the four queries and included the actual query plan and compared the costs. Studying the actual execution plan indicates that the OUTER APPLY is best option (of the four). As i already assumed the double subquery is a bad performer.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-X8WI44ArF1w/TkkX_uDHDiI/AAAAAAAAAyw/gG85W6z8czY/s1600/comparing+queries.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="276" src="http://4.bp.blogspot.com/-X8WI44ArF1w/TkkX_uDHDiI/AAAAAAAAAyw/gG85W6z8czY/s400/comparing+queries.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;br /&gt;I've compared 4 options regarding this specific problem. The problem was about (what i call) 'fuzzy linking' between two tables and retrieving an appropriate key for the fact table. Below you can see the results in a&amp;nbsp;graph and as i already thought : the double subquery is worst option (option 1) and the best solution (of the 4) is option 4 (the OUTER APPLY):&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-m76XWmPEpp4/TkkbrRfWqtI/AAAAAAAAAy0/NlvK-yyryvk/s1600/resultsouterappply.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="192" src="http://4.bp.blogspot.com/-m76XWmPEpp4/TkkbrRfWqtI/AAAAAAAAAy0/NlvK-yyryvk/s320/resultsouterappply.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;I've learned a bit more about SQL Server and the OUTER APPLY. I do think that i'll be using this feature more often in tasks like joining tables based on some not key fields.&lt;br /&gt;&lt;br /&gt;Greetz,&lt;br /&gt;Hennie&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-2056402895086503139?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/2056402895086503139/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2011/08/sql-joining-tables-with-outer-apply.html#comment-form' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/2056402895086503139'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/2056402895086503139'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2011/08/sql-joining-tables-with-outer-apply.html' title='SQL : joining tables with the OUTER  APPLY'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-uwNfa0ojsJg/TkjUsIAjFtI/AAAAAAAAAyY/uxz32WavdDs/s72-c/FuzzyRelationship.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-8213707428695274961</id><published>2011-08-12T08:01:00.001+02:00</published><updated>2011-08-12T08:04:25.707+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQLServer'/><category scheme='http://www.blogger.com/atom/ns#' term='SSRS'/><title type='text'>SSRS: Building a report on an excel datasource with Reportbuilder 2.0</title><content type='html'>&lt;b&gt;Introduction&lt;/b&gt; &lt;br /&gt;Today a small tutorial about using an excel file as a source for a report with reportbuilder 2.0.The following steps should be followed when you're creating a report based upon an excel file. &lt;br /&gt;&lt;br /&gt;1) Create an excelsheet with som testdata.&lt;br /&gt;2) Create an ODBC DSN to access the excel file.&lt;br /&gt;3) Create a datasource in reportbuilder.&lt;br /&gt;4) Build a dataset and a report.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;1) Create an excelsheet with some testdata&lt;/b&gt;&lt;br /&gt;First, create a simple excel sheet with data with Excel 2007. We will build a report based on this data. Save this file under the name ImportantInformation.xlsx.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-yuctC1fmrE0/TkPSk3IIHcI/AAAAAAAAAyM/0XFUisfJQzg/s1600/11-8-2011+15-00-43.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-yuctC1fmrE0/TkPSk3IIHcI/AAAAAAAAAyM/0XFUisfJQzg/s1600/11-8-2011+15-00-43.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt;2) Create an ODBC DSN to access the excel file&lt;/b&gt;&lt;br /&gt;As the title of the post suggested we are gonbe build a report based on an Excel sheet based on an ODBC connection. The details of how to do is listed here:&lt;br /&gt;&lt;br /&gt;Click on Start, All Programs, Control Panel, Administrative Tools, Data Sources (ODBC). If the tabbed page is not in User DSN, change the tab to User DSN and click on the Add button.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-dLv199fJKto/TkPGQhnZj1I/AAAAAAAAAvc/JZe4KY8WHOc/s1600/User+DSN.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="261px" src="http://4.bp.blogspot.com/-dLv199fJKto/TkPGQhnZj1I/AAAAAAAAAvc/JZe4KY8WHOc/s320/User+DSN.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;3. Scroll down and highlight Microsoft Excel Driver (*.xlsx) and click on the Finish button.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-8wirkjuyvhs/TkPPHEnOFQI/AAAAAAAAAxw/nOHxkU4JC-0/s1600/NEwCReatedatasource.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="235px" src="http://3.bp.blogspot.com/-8wirkjuyvhs/TkPPHEnOFQI/AAAAAAAAAxw/nOHxkU4JC-0/s320/NEwCReatedatasource.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;This opens the ODBC Microsoft Excel Setup window as shown.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-JceGEIiniWE/TkPPcJQiHyI/AAAAAAAAAx0/CZQ6WzUTdlQ/s1600/11-8-2011+14-47-26.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="173px" src="http://4.bp.blogspot.com/-JceGEIiniWE/TkPPcJQiHyI/AAAAAAAAAx0/CZQ6WzUTdlQ/s320/11-8-2011+14-47-26.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&amp;nbsp;Press on "Select Werkbook" and select the Excel sheet&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-mE7Z5b5ggPM/TkPh3PeMYLI/AAAAAAAAAyQ/xEXJqIQ6SLw/s1600/11-8-2011+16-05-28.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="193px" src="http://2.bp.blogspot.com/-mE7Z5b5ggPM/TkPh3PeMYLI/AAAAAAAAAyQ/xEXJqIQ6SLw/s320/11-8-2011+16-05-28.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&amp;nbsp;Press Ok and the excel file will appear in the User DSN screen&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-t8ruobzHpZM/TkPPqb_WuXI/AAAAAAAAAx4/EJ3CFN6wEvU/s1600/11-8-2011+14-48-24.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="261px" src="http://3.bp.blogspot.com/-t8ruobzHpZM/TkPPqb_WuXI/AAAAAAAAAx4/EJ3CFN6wEvU/s320/11-8-2011+14-48-24.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-cWHazYjFsJs/TkPNG8pGJmI/AAAAAAAAAwI/-b_v5zCKpqE/s1600/Testconnection+succeeded.png" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Click on OK and the window closes.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;3) Create a datasource in reportbuilder&lt;/b&gt;&lt;br /&gt;The ODBC connection has been created in the last step and now it should be possible to create a datasource in reportbuilder and connect it to the ODBC connection. Lets create a report based on this ODBC. Choose New Data source.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-2bUYabdiUZg/TkPQSEegCmI/AAAAAAAAAx8/p7b40pZnO3I/s1600/11-8-2011+14-51-02.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="268px" src="http://4.bp.blogspot.com/-2bUYabdiUZg/TkPQSEegCmI/AAAAAAAAAx8/p7b40pZnO3I/s320/11-8-2011+14-51-02.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-WorWvsbNCqM/TkPOWXZ2H6I/AAAAAAAAAxQ/7ROs5XyUv6A/s1600/Machine+datasource+importantinfor+mation.xlsx.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;Set the properties Name (i didn't) and choose a connection embedded in my report. Press Build in order to create the connection string.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-4PHh_goAVhE/TkPQsG0UCdI/AAAAAAAAAyA/bkvQ143xB3c/s1600/11-8-2011+14-52-36.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="232px" src="http://1.bp.blogspot.com/-4PHh_goAVhE/TkPQsG0UCdI/AAAAAAAAAyA/bkvQ143xB3c/s320/11-8-2011+14-52-36.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Choose "Use connection string" and press build (again(?)) and select the ImportantInformation.xlsx&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-WorWvsbNCqM/TkPOWXZ2H6I/AAAAAAAAAxQ/7ROs5XyUv6A/s1600/Machine+datasource+importantinfor+mation.xlsx.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="255px" src="http://3.bp.blogspot.com/-WorWvsbNCqM/TkPOWXZ2H6I/AAAAAAAAAxQ/7ROs5XyUv6A/s320/Machine+datasource+importantinfor+mation.xlsx.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Press OK and the Select Workbook will come up. Locate the excel sheet (i've stored mine on E:\Excel)&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-9CLCmokq4po/TkPRAxXE81I/AAAAAAAAAyE/BpYP-GG2-tI/s1600/11-8-2011+14-54-13.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="232px" src="http://2.bp.blogspot.com/-9CLCmokq4po/TkPRAxXE81I/AAAAAAAAAyE/BpYP-GG2-tI/s320/11-8-2011+14-54-13.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Press ok and Press "test connection"&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-0sI9HAKu6lk/TkPOWKWG7RI/AAAAAAAAAxM/ycNQuAEM1k0/s1600/Testconnection+succeeded.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="315px" src="http://2.bp.blogspot.com/-0sI9HAKu6lk/TkPOWKWG7RI/AAAAAAAAAxM/ycNQuAEM1k0/s320/Testconnection+succeeded.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;And the connection string is build &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-SEI-QFKNh_g/TkPRbdRqYPI/AAAAAAAAAyI/ajqC4Y9rukE/s1600/11-8-2011+14-55-59.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="232px" src="http://4.bp.blogspot.com/-SEI-QFKNh_g/TkPRbdRqYPI/AAAAAAAAAyI/ajqC4Y9rukE/s320/11-8-2011+14-55-59.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The connection string is as follows:&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: 'Courier New',Courier,monospace;"&gt;&lt;span style="font-size: x-small;"&gt;Dsn=ImportantInformation.xlsx;dbq=E:\Excel\ImportantInformation.xlsx;defaultdir=E:\Excel;driverid=1046;fil=excel 12.0;maxbuffersize=2048;pagetimeout=5&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Click on Ok en we're entering the next universe.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;4) Build a dataset and the report&lt;/b&gt;&lt;br /&gt;The&amp;nbsp; next step is create a simple report based on the data in the Excel sheet. Select "Table or Matrix".&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-DBxXTWPNRvw/TkPOV976VmI/AAAAAAAAAxI/blwMU6hP_Bg/s1600/New+table+in+RB2.0.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="146px" src="http://4.bp.blogspot.com/-DBxXTWPNRvw/TkPOV976VmI/AAAAAAAAAxI/blwMU6hP_Bg/s320/New+table+in+RB2.0.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The following window appears and you're asked for selecting the right datasource. In our case only one is created and we can't choose the wrong one here.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-HmZ-WhBLlH8/TkPOVs--dSI/AAAAAAAAAxE/HpwpNHI3nm4/s1600/Choose+datasource.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="231px" src="http://3.bp.blogspot.com/-HmZ-WhBLlH8/TkPOVs--dSI/AAAAAAAAAxE/HpwpNHI3nm4/s320/Choose+datasource.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The next step is the most important one. Took me some trails before i got it right. Type SELECT * FROM [Sheet1$] (if you named the tab "Sheet1"). Press ! and the query is executed. &lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-Sr1YFiTWf4U/TkPOVDB8trI/AAAAAAAAAw8/nniNUKlSA38/s1600/Design+a+query.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="232px" src="http://4.bp.blogspot.com/-Sr1YFiTWf4U/TkPOVDB8trI/AAAAAAAAAw8/nniNUKlSA38/s320/Design+a+query.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The wizard continues...&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-T1zm_K42lNE/TkPOU0k17DI/AAAAAAAAAw4/o4WgM-hSwqM/s1600/Choose+layout.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="232px" src="http://1.bp.blogspot.com/-T1zm_K42lNE/TkPOU0k17DI/AAAAAAAAAw4/o4WgM-hSwqM/s320/Choose+layout.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&amp;nbsp;Put some fields in the details section and Column1 in the row groups. I deselected the sum. &lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-G5kPzWeEDSM/TkPOUiFb0ZI/AAAAAAAAAw0/j8y8zC0ive8/s1600/Arrange+fields.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="232px" src="http://2.bp.blogspot.com/-G5kPzWeEDSM/TkPOUiFb0ZI/AAAAAAAAAw0/j8y8zC0ive8/s320/Arrange+fields.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Choose appropriate layout.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-8Ve1_Jcpg8w/TkPOUdK1dSI/AAAAAAAAAww/Z935mCmRjx8/s1600/Chooselayout.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="232px" src="http://1.bp.blogspot.com/-8Ve1_Jcpg8w/TkPOUdK1dSI/AAAAAAAAAww/Z935mCmRjx8/s320/Chooselayout.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Choose appropriate style&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-umIBlFfraaQ/TkPOUNO0ajI/AAAAAAAAAws/lnDOPmoZEzY/s1600/Choose+a+style.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="232px" src="http://1.bp.blogspot.com/-umIBlFfraaQ/TkPOUNO0ajI/AAAAAAAAAws/lnDOPmoZEzY/s320/Choose+a+style.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Press finish&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-PsPR2YaDInY/TkPOT-Jnq1I/AAAAAAAAAwo/jnJiFJ3Au2c/s1600/EndresultRB2.0.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="145px" src="http://1.bp.blogspot.com/-PsPR2YaDInY/TkPOT-Jnq1I/AAAAAAAAAwo/jnJiFJ3Au2c/s320/EndresultRB2.0.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;br /&gt;Easy to do and this is enabling power users building reports on&amp;nbsp;Excel data. Opening and closing the excel file&amp;nbsp;when building the report result also in error messages in Report builder 2.0 (Something like connection lost with the excel file). This is an error i recieved when i tried to open the excel file when Reportbuilder is using the excel file:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-PROXwyf7Lp8/TkPlSdCGSGI/AAAAAAAAAyU/OJN7YknDIBY/s1600/Errormessagewhenopeningexcelfile.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="32px" src="http://3.bp.blogspot.com/-PROXwyf7Lp8/TkPlSdCGSGI/AAAAAAAAAyU/OJN7YknDIBY/s320/Errormessagewhenopeningexcelfile.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Greetz,&lt;br /&gt;Hennie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-8213707428695274961?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/8213707428695274961/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2011/08/ssrs-building-report-on-excel.html#comment-form' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/8213707428695274961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/8213707428695274961'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2011/08/ssrs-building-report-on-excel.html' title='SSRS: Building a report on an excel datasource with Reportbuilder 2.0'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-yuctC1fmrE0/TkPSk3IIHcI/AAAAAAAAAyM/0XFUisfJQzg/s72-c/11-8-2011+15-00-43.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-2968576488548511922</id><published>2011-08-10T07:59:00.003+02:00</published><updated>2011-08-10T09:37:08.337+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSAS'/><category scheme='http://www.blogger.com/atom/ns#' term='SSRS'/><title type='text'>SSAS/SSRS : Building a dashboard</title><content type='html'>&lt;b&gt;Introduction&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Currently reading "Information dashboard design" of Stephen Few. A book i can highly recommend to you when you are interested in hands on advice, best practices about building dashboards. We all know the dashboardhype: everybody wants a dashboard. Dashboards are sexy. Building a good dashboard is about giving the users a unique and powerful means to presenting information, but they rarely fullfill their promisses. Too bad, because building a dashboard according to the usability rules can greatly enhance insights. During my study i became interested in building applications according to the usability laws that were researched by Don Norman, for instance. One book of him, that is very easy to read and give you great insights of the (bad) design of everyday things, is his famous book : &lt;a href="http://www.blogger.com/post-create.g?blogID=5650243067310933543"&gt;The Design of Everyday Things&lt;/a&gt;. In this book he explains some bad examples and some good examples of design of normal things that surrounds us. Great book and when your designing dashboards it could give you some background information.&lt;br /&gt;&lt;br /&gt;In this post i'll describe building a piece of a dashboard. In the coming weeks, months i will regularly post some blogs about building pieces of dashboards according to best practices or some great ideas that i've seen in the book of Stephen Few. While reading the book of Stephen Few i got interested in building a sober dashboard and i would like rebuild them in Reporting Services. One example i find particularly interesting. You can find this on page 201, left under. Below you i will show you the end result that i've build with Reporting Services.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-wlLvAsJAWIk/Tj7NQXt2sFI/AAAAAAAAAuM/D1iX-CJ9Ikw/s1600/EndREsult.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="117" src="http://4.bp.blogspot.com/-wlLvAsJAWIk/Tj7NQXt2sFI/AAAAAAAAAuM/D1iX-CJ9Ikw/s320/EndREsult.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;First&lt;/b&gt;&lt;br /&gt;At first we need to set up a environment in which we can build a dashboard. For this purpose i've created the following SQL Script :&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;USE [dashboard]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[FactSales]') AND type in (N'U'))&lt;br /&gt;DROP TABLE [dbo].[FactSales]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;CREATE TABLE [dbo].[FactSales](&lt;br /&gt;[FactSalesID] [int] IDENTITY(1,1) NOT NULL,&lt;br /&gt;[FK_Date_Key] [int] NOT NULL,&lt;br /&gt;[FK_Department_Key] [int] NOT NULL,&lt;br /&gt;[FK_Product_Key] [int] NOT NULL,&lt;br /&gt;[FactSalesCount] [int] NOT NULL,&lt;br /&gt;[SalesAmount] [money] NOT NULL&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DimDepartment]') AND type in (N'U'))&lt;br /&gt;DROP TABLE [dbo].[DimDepartment]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;CREATE TABLE [dbo].[DimDepartment](&lt;br /&gt;[Department_Dim_key] [int] NOT NULL,&lt;br /&gt;[Department_Code] [int] NOT NULL,&lt;br /&gt;[Department_Description] [varchar](50) NOT NULL&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DimProduct]') AND type in (N'U'))&lt;br /&gt;DROP TABLE [dbo].[DimProduct]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;CREATE TABLE [dbo].[DimProduct](&lt;br /&gt;[Product_Dim_key] [int] NOT NULL,&lt;br /&gt;[Product_Code] [int] NOT NULL,&lt;br /&gt;[Product_Description] [varchar](50) NOT NULL&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[FactPurchaseOrder]') AND type in (N'U'))&lt;br /&gt;DROP TABLE [dbo].[FactPurchaseOrder]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;CREATE TABLE [dbo].[FactPurchaseOrder](&lt;br /&gt;[FactPurchaseOrderID] [int] IDENTITY(1,1) NOT NULL,&lt;br /&gt;[FK_Date_Key] [int] NOT NULL,&lt;br /&gt;[FK_Department_Key] [int] NOT NULL,&lt;br /&gt;[FK_Product_Key] [int] NOT NULL,&lt;br /&gt;[FactPurchaseOrderCount] [int] NOT NULL,&lt;br /&gt;[FactPurchaseAmount] [money] NOT NULL&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DimDate]') AND type in (N'U'))&lt;br /&gt;DROP TABLE [dbo].[DimDate]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;CREATE TABLE [dbo].[DimDate](&lt;br /&gt;[Date_dim_key] [int] NULL,&lt;br /&gt;[Date_Year] [int] NULL&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;INSERT INTO dbo.DimDepartment (Department_Dim_key, Department_Code, Department_Description) &lt;br /&gt;VALUES &lt;br /&gt;(1, 1, 'Department A'),&lt;br /&gt;(2, 2, 'Department B'), &lt;br /&gt;(3, 3, 'Department C'), &lt;br /&gt;(4, 4, 'Department D'), &lt;br /&gt;(5, 5, 'Department E')&lt;br /&gt;&lt;br /&gt;INSERT INTO dbo.DimProduct (Product_Dim_key, Product_Code, Product_Description) &lt;br /&gt;VALUES &lt;br /&gt;(1, 1, 'Product 1'),&lt;br /&gt;(2, 2, 'Product 2'), &lt;br /&gt;(3, 3, 'Product 3'), &lt;br /&gt;(4, 4, 'Product 4'), &lt;br /&gt;(5, 5, 'Product 5')&lt;br /&gt;&lt;br /&gt;INSERT INTO dbo.DimDate&lt;br /&gt;VALUES (0,2000),&lt;br /&gt;(1, 2001),&lt;br /&gt;(2, 2002),&lt;br /&gt;(3, 2003),&lt;br /&gt;(4, 2004),&lt;br /&gt;(5, 2005),&lt;br /&gt;(6, 2006),&lt;br /&gt;(7, 2007),&lt;br /&gt;(8, 2008),&lt;br /&gt;(9, 2009),&lt;br /&gt;(10, 2010),&lt;br /&gt;(11, 2011),&lt;br /&gt;(12, 2012),&lt;br /&gt;(13, 2013),&lt;br /&gt;(14, 2014),&lt;br /&gt;(15, 2015)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;INSERT INTO [dbo].[FactSales]([FK_Date_Key], [FK_Department_Key], [FK_Product_Key], [FactSalesCount], [SalesAmount] )&lt;br /&gt;VALUES&lt;br /&gt;&lt;br /&gt;(8, 5, 2, 1, 6.25),&lt;br /&gt;(8, 2, 3, 1, 5.96),&lt;br /&gt;(8, 3, 1, 1, 2.95),&lt;br /&gt;(8, 1, 1, 1, 4.98),&lt;br /&gt;(8, 3, 5, 1, 20.00),&lt;br /&gt;(8, 5, 5, 1, 100.00),&lt;br /&gt;&lt;br /&gt;(9, 3, 1, 1, 12.70),&lt;br /&gt;(9, 2, 1, 1, 22.67),&lt;br /&gt;(9, 4, 4, 1, 56.16),&lt;br /&gt;(9, 5, 2, 1, 23.16),&lt;br /&gt;(9, 2, 3, 1, 22.13),&lt;br /&gt;(9, 1, 1, 1, 100.12),&lt;br /&gt;&lt;br /&gt;(10, 1, 3, 1, 50.0),&lt;br /&gt;(10, 2, 1, 1, 39.95),&lt;br /&gt;(10, 3, 2, 1, 66.05),&lt;br /&gt;(10, 5, 1, 1, 40.95),&lt;br /&gt;(10, 3, 4, 1, 6.05),&lt;br /&gt;(10, 5, 5, 1, 1.95),&lt;br /&gt;&lt;br /&gt;(11, 1, 3, 1, 50.0),&lt;br /&gt;(11, 3, 1, 1, 39.95),&lt;br /&gt;(11, 3, 5, 1, 66.05),&lt;br /&gt;(11, 1, 2, 1, 23.0),&lt;br /&gt;(11, 3, 4, 1, 55.95),&lt;br /&gt;(11, 3, 2, 1, 78.05)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;INSERT INTO [dbo].[FactPurchaseOrder]([FK_Date_Key], [FK_Department_Key], [FK_Product_Key], [FactPurchaseOrderCount], [FactPurchaseAmount] )&lt;br /&gt;VALUES&lt;br /&gt;&lt;br /&gt;(8, 3, 5, 1, 66.67),&lt;br /&gt;(8, 5, 1, 1, 25.00),&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;(9, 1, 2, 1, 21.95),&lt;br /&gt;(9, 2, 5, 1, 80.45),&lt;br /&gt;&lt;br /&gt;(10, 3, 2, 1, 51.02),&lt;br /&gt;(10, 5, 1, 1, 30.05),&lt;br /&gt;&lt;br /&gt;(10, 1, 3, 1, 21.00),&lt;br /&gt;(10, 2, 1, 1, 19.95),&lt;br /&gt;(10, 3, 2, 1, 21.05),&lt;br /&gt;(10, 5, 1, 1, 15.95),&lt;br /&gt;&lt;br /&gt;(10, 1, 3, 1, 60.0),&lt;br /&gt;(11, 3, 1, 1, 30.95),&lt;br /&gt;(11, 3, 5, 1, 31.05)&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;---&lt;/span&gt;&lt;br /&gt;This script will create some tables and will insert some data into the appropriate tables.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Building the cube&lt;/b&gt;&lt;br /&gt;The next thing we need to do is building a cube based on this datamodel. Below you can see the structure of this cube.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-WUutAuLxvWM/Tj6jNV546mI/AAAAAAAAAuA/gJvjI_H3k4Q/s1600/dashboard+cube+structure.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="201" src="http://3.bp.blogspot.com/-WUutAuLxvWM/Tj6jNV546mI/AAAAAAAAAuA/gJvjI_H3k4Q/s320/dashboard+cube+structure.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;An image can you tell more than the SQL script above. So i'll explain the case with aid of this diagram. There are two facts Salesorder and purchase order. There are a couple of conformed dimensions :Department, Date and Product. The idea behind this that you need to purchase a product before you can sell it. I don't think i have the purchases in line with the sales. It is just an example. Another dimension POStatus is used for analyzing the status of a purchase order. Below the dimension usage tab:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-B6Gy9pbbMtI/Tj6kWcLY3NI/AAAAAAAAAuE/kWHW48CqeiE/s1600/Dimension+usage+dashboard.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="126" src="http://1.bp.blogspot.com/-B6Gy9pbbMtI/Tj6kWcLY3NI/AAAAAAAAAuE/kWHW48CqeiE/s320/Dimension+usage+dashboard.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;Building the report&lt;/b&gt;&lt;br /&gt;Okay, now it's time to build the report. The first thing is dragging the fields needed in the query designer into the query window.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-Vt6DO8Yn0nI/Tj6kzzH9TGI/AAAAAAAAAuI/o2cn8DA0Clo/s1600/example+query.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="263" src="http://1.bp.blogspot.com/-Vt6DO8Yn0nI/Tj6kzzH9TGI/AAAAAAAAAuI/o2cn8DA0Clo/s400/example+query.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Just plain and simple.&lt;br /&gt;&lt;br /&gt;In the reportinfg services&amp;nbsp;i've dragged a tablix on the report. In the dashboard example i've 7 columns and below you can see how i've created them in the tablix.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;1) Product description (Desc)&lt;/i&gt;&lt;br /&gt;The product descritption field in the table is simple. It's the product description of the product. This product description is used for grouping the products.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;2) Last five years sparkline&lt;/i&gt;&lt;br /&gt;I've created a sparkline graph based on the sales amount and a year column.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-PamMASdmDOc/Tj7YPD8J0JI/AAAAAAAAAuk/sQAEJT16dfE/s1600/sparkline+dashboard.png" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/-PamMASdmDOc/Tj7YPD8J0JI/AAAAAAAAAuk/sQAEJT16dfE/s320/sparkline+dashboard.png" width="240" /&gt;&lt;/a&gt;&lt;b&gt; &lt;/b&gt;&lt;/div&gt;&lt;br /&gt;&lt;i&gt;3) Number (# 2011)&lt;/i&gt;&lt;br /&gt;In order to determine the current year i'm using the Globals!ExecutionTime as a rundate. The # column is calculated by summing the counts in tha fact table&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-PamMASdmDOc/Tj7YPD8J0JI/AAAAAAAAAuk/sQAEJT16dfE/s1600/sparkline+dashboard.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style="font-size: x-small;"&gt;=SUM(IIF(Fields!DateYear.Value = YEAR(Globals!ExecutionTime), Fields!Fact_Sales_Count.Value, 0))&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;4) Amount ($ 2011)&lt;/i&gt;&lt;br /&gt;As described at point 3, The salesAmounts are summarized by grouping the products.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp; =SUM(IIF(Fields!DateYear.Value = YEAR(Globals!ExecutionTime), Fields!Sales_Amount.Value,0))&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;5) Percentage of total (% $/total (2011))&lt;/i&gt;&lt;br /&gt;Calculating the perccentage betwee the productsales and the total product sales is done by the following expression&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp;=SUM(IIF(Fields!DateYear.Value = YEAR(Globals!ExecutionTime), Fields!Sales_Amount.Value,0),&amp;nbsp;&amp;nbsp; "grpProductDescription")/&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;SUM(IIF(Fields!DateYear.Value = YEAR(Globals!ExecutionTime), Fields!Sales_Amount.Value,0), "tblxSalesPerProduct")&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;6) Since last year&lt;/i&gt;&lt;br /&gt;Calculating the percentage of growth or decline is a bit more difficult. Below you can see the expression i've created. Most of the expression is build around the&amp;nbsp;demand that a - (minus) and + (plus) should be shown in case of a decline or a growth.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;=IIF(&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUM(IIF(Fields!DateYear.Value = YEAR(Globals!ExecutionTime), Fields!Sales_Amount.Value,0)) &amp;gt; SUM(IIF(Fields!DateYear.Value = YEAR(DATEADD("yyyy", -1, Globals!ExecutionTime)), Fields!Sales_Amount.Value,0)),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "+" + FORMATPERCENT(CSTR(SUM(IIF(Fields!DateYear.Value = YEAR(Globals!ExecutionTime), Fields!Sales_Amount.Value,0))/&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUM(IIF(Fields!DateYear.Value = YEAR(DATEADD("yyyy", -1, Globals!ExecutionTime)), Fields!Sales_Amount.Value,0))),0),&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "-" + FORMATPERCENT(CSTR(SUM(IIF(Fields!DateYear.Value = YEAR(Globals!ExecutionTime), Fields!Sales_Amount.Value,0))/&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUM(IIF(Fields!DateYear.Value = YEAR(DATEADD("yyyy", -1, Globals!ExecutionTime)), Fields!Sales_Amount.Value,0))),0)&lt;br /&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;7) AVG $ (2011)&lt;/i&gt;&lt;br /&gt;The last column that i've created is the avg $ (average sales). That is done by aggregating (sum) and dividing the amounts and the counts.&lt;br /&gt;&lt;div style="margin: 0cm 0cm 0pt;"&gt;&lt;span style="font-size: 9pt;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size: x-small;"&gt;=SUM(IIF(Fields!DateYear.Value =YEAR(Globals!ExecutionTime), Fields!Sales_Amount.Value, 0))/SUM(IIF(Fields!DateYear.Value = YEAR(Globals!ExecutionTime), Fields!Fact_Sales_Count.Value, 0))&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Other Tablix adjustments&lt;/i&gt;&lt;br /&gt;There are two more important adjustments to the report: sorting and filtering. The sorting is about sorting the products according their sales effort (regarding to the whole sales). The filtering is about the top 3 bestseller products.&lt;br /&gt;&lt;i&gt;Sorting &lt;/i&gt;&lt;br /&gt;Sorting the products is possible by clikcing on the grouping of the products (and not&amp;nbsp; tablix level).&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-gmMPh-qyP_s/Tj7OXKAVFDI/AAAAAAAAAuU/5v5B4N44m0A/s1600/Grouping.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="261" src="http://1.bp.blogspot.com/-gmMPh-qyP_s/Tj7OXKAVFDI/AAAAAAAAAuU/5v5B4N44m0A/s320/Grouping.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Click on sorting.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-E7BIwdwL_34/Tj7OW-DFCkI/AAAAAAAAAuQ/DTXk6f3GCx0/s1600/Sorting+based+on+the+grouping.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="261" src="http://4.bp.blogspot.com/-E7BIwdwL_34/Tj7OW-DFCkI/AAAAAAAAAuQ/DTXk6f3GCx0/s320/Sorting+based+on+the+grouping.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;And use the following expression for sorting the products. I only implemented the amount. That's enough.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-Kk666MIkH9s/Tj7POby8hpI/AAAAAAAAAuY/0VoZ9nX-MFI/s1600/filterexpression.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="223" src="http://1.bp.blogspot.com/-Kk666MIkH9s/Tj7POby8hpI/AAAAAAAAAuY/0VoZ9nX-MFI/s320/filterexpression.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;i&gt;Filter top 3&lt;/i&gt;&lt;br /&gt;The last&amp;nbsp;last change in the report is filtering the top 3 products. The filter option that is used is also on the group level.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-9aYwy2_pdnw/Tj7POnczShI/AAAAAAAAAuc/pGCeQ9uVB9o/s1600/Filtersetup.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="261" src="http://2.bp.blogspot.com/-9aYwy2_pdnw/Tj7POnczShI/AAAAAAAAAuc/pGCeQ9uVB9o/s320/Filtersetup.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Below you can see the expression that i've used for filtering&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-TPqqyqJeq84/Tj7PPMW6xaI/AAAAAAAAAug/IWweSF5o8kI/s1600/sortingexression.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="178" src="http://4.bp.blogspot.com/-TPqqyqJeq84/Tj7PPMW6xaI/AAAAAAAAAug/IWweSF5o8kI/s320/sortingexression.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;And the expression that i've entered in value field is (don't forget the =) :&lt;br /&gt;&lt;br /&gt;=3&lt;br /&gt;&lt;br /&gt;And end result.....&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-wlLvAsJAWIk/Tj7NQXt2sFI/AAAAAAAAAuM/D1iX-CJ9Ikw/s1600/EndREsult.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="117" naa="true" src="http://4.bp.blogspot.com/-wlLvAsJAWIk/Tj7NQXt2sFI/AAAAAAAAAuM/D1iX-CJ9Ikw/s320/EndREsult.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;br /&gt;The example in the book of Stephen Few has&amp;nbsp;a sparkline as&amp;nbsp;the first column. I haven't read the complete book of Stephen and i do not know why he decided to put the sparkline in the first column but from usability view point i do think that product description should be the first colum. Humans read from top left to bottom right and they are interested in productdescriptions, first.&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-2968576488548511922?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/2968576488548511922/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2011/08/ssasssrs-building-dashboard.html#comment-form' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/2968576488548511922'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/2968576488548511922'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2011/08/ssasssrs-building-dashboard.html' title='SSAS/SSRS : Building a dashboard'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-wlLvAsJAWIk/Tj7NQXt2sFI/AAAAAAAAAuM/D1iX-CJ9Ikw/s72-c/EndREsult.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-1173645907733255075</id><published>2011-08-03T08:27:00.001+02:00</published><updated>2011-08-03T08:32:06.068+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MDX'/><category scheme='http://www.blogger.com/atom/ns#' term='SSAS'/><category scheme='http://www.blogger.com/atom/ns#' term='SQLServer'/><category scheme='http://www.blogger.com/atom/ns#' term='SSRS'/><title type='text'>SSAS/SSRS : Building different gauges with MDX.</title><content type='html'>&lt;b&gt;Introduction&lt;/b&gt;&lt;br /&gt;For one of my customers i've to build a dashboard. This customer wants to improve the quality of service. There are discussions about how do you measure quality, what is good service and what is bad service. The problem is that there are many departments and how do you compare them. Is it recommended to say below 50 is ok and above is not ok? So what is good and what is wrong? Just showing the number is also a bad practice (without any reference). &lt;br /&gt;&lt;br /&gt;Another approach i've read in the book of Stephen Few : "Information dashboard design" and he showed an example of a gauge with an organization average and an industry best practice (benchmarking). Below you can see a diagram about combining the department average, organization average and an industry best practice. An other idea pops in my mind about comparing departments peer2peer with same departments of&amp;nbsp; other organizations.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-J3kbfJqf3Ng/TjUPlFoyiXI/AAAAAAAAAtE/U-BATaI38vM/s1600/Gauge.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="177" src="http://4.bp.blogspot.com/-J3kbfJqf3Ng/TjUPlFoyiXI/AAAAAAAAAtE/U-BATaI38vM/s200/Gauge.png" width="200" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;So in theory there are four measures possible for comparing values.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Department average.&lt;/li&gt;&lt;li&gt;Organization average.&lt;/li&gt;&lt;li&gt;Industry best practice.&lt;/li&gt;&lt;li&gt;Peer2peer department average (for later).&lt;/li&gt;&lt;/ul&gt;Red, orange and green imply a judgement of the figures. So i decided not use these colors. At this moment i'm using more neutral colors like purple and darkblue. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Prerequisites&lt;/b&gt;&lt;br /&gt;Okay, let's setup the case. First setup the datamodel and insert some test data. Below i've drawn a star datamodel with two facts a department level fact and a benchmark fact (for showing the industry best practice average). The department level fact is a fact with data from the own organization and the benchmark fact is information that is gathered, stored, processed and distributed by an exernal benchmark organization. For simplicity i'll assume that the one measure of department level fact will be compared with the measure of the benchmark fact. In the real world there will be multiple organizations star schemas and they need to be coupled with the benchmark fact.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-iFeWT-6arn4/TjUSkvSvrQI/AAAAAAAAAtI/pHrb9N0IVKI/s1600/Benchmar.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="232" src="http://4.bp.blogspot.com/-iFeWT-6arn4/TjUSkvSvrQI/AAAAAAAAAtI/pHrb9N0IVKI/s320/Benchmar.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;So there four dimensions : OrgDepartment, Date, organization and P2Pdepartment (for later blogposts). So i've created a script for&amp;nbsp; this purpose.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;USE [Gauge]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DeptLevelFact]') AND type in (N'U'))&lt;br /&gt;DROP TABLE [dbo].[DeptLevelFact]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;CREATE TABLE [dbo].[DeptLevelFact](&lt;br /&gt;[DeptLevelFactID] [int] IDENTITY(1,1) NOT NULL,&lt;br /&gt;[FK_Date_Key] [int] NOT NULL,&lt;br /&gt;[FK_Department_Key] [int] NOT NULL,&lt;br /&gt;[DeptLevelFactCount] [int] NOT NULL&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DimDepartment]') AND type in (N'U'))&lt;br /&gt;DROP TABLE [dbo].[DimDepartment]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;CREATE TABLE [dbo].[DimDepartment](&lt;br /&gt;[Department_Dim_key] [int] NOT NULL,&lt;br /&gt;[Department_Code] [int] NOT NULL,&lt;br /&gt;[Department_Description] [varchar](50) NOT NULL&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BenchMarkFact]') AND type in (N'U'))&lt;br /&gt;DROP TABLE [dbo].[BenchMarkFact]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;CREATE TABLE [dbo].[BenchMarkFact](&lt;br /&gt;[BenchMarkFactID] [int] IDENTITY(1,1) NOT NULL,&lt;br /&gt;[FK_Date_Key] [int] NOT NULL,&lt;br /&gt;[FK_Organisation_Key] [int] NOT NULL,&lt;br /&gt;[BenchMarkFactCount] [int] NOT NULL&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DimDate]') AND type in (N'U'))&lt;br /&gt;DROP TABLE [dbo].[DimDate]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;CREATE TABLE [dbo].[DimDate](&lt;br /&gt;[Date_dim_key] [int] NULL,&lt;br /&gt;[Date_Year] [int] NULL&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DimOrganisation]') AND type in (N'U'))&lt;br /&gt;DROP TABLE [dbo].[DimOrganisation]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;CREATE TABLE [dbo].[DimOrganisation](&lt;br /&gt;[Organisation_Dim_key] [int] NOT NULL,&lt;br /&gt;[Organisation_Code] [int] NOT NULL,&lt;br /&gt;[Organisation_Description] [varchar](50) NOT NULL&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;GO&lt;br /&gt;---&lt;br /&gt;&lt;br /&gt;INSERT INTO dbo.DimDepartment (Department_Dim_key, Department_Code, Department_Description) &lt;br /&gt;VALUES &lt;br /&gt;(1, 1, 'Department A'),&lt;br /&gt;(2, 2, 'Department B'), &lt;br /&gt;(3, 3, 'Department C'), &lt;br /&gt;(4, 4, 'Department D'), &lt;br /&gt;(5, 5, 'Department E')&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;INSERT INTO dbo.DimDate&lt;br /&gt;VALUES (1,2000),&lt;br /&gt;(2, 2001),&lt;br /&gt;(3, 2002),&lt;br /&gt;(4, 2003),&lt;br /&gt;(5, 2004),&lt;br /&gt;(6, 2005),&lt;br /&gt;(7, 2006),&lt;br /&gt;(8, 2007),&lt;br /&gt;(9, 2008),&lt;br /&gt;(10, 2009),&lt;br /&gt;(11, 2010),&lt;br /&gt;(12, 2011),&lt;br /&gt;(13, 2012),&lt;br /&gt;(14, 2013),&lt;br /&gt;(15, 2014),&lt;br /&gt;(16, 2015)&lt;br /&gt;&lt;br /&gt;INSERT INTO dbo.DimOrganisation (Organisation_Dim_key, Organisation_Code,Organisation_Description) &lt;br /&gt;VALUES &lt;br /&gt;(1, 1, 'Organisation X'),&lt;br /&gt;(2, 2, 'Organisation Y'), &lt;br /&gt;(3, 3, 'Organisation Z')&lt;br /&gt;&lt;br /&gt;INSERT INTO [dbo].[DeptLevelFact]([FK_Date_Key],[FK_Department_Key],[DeptLevelFactCount])&lt;br /&gt;VALUES&lt;br /&gt;(10, 1, 3),&lt;br /&gt;(10, 2, 5),&lt;br /&gt;(10, 3, 8),&lt;br /&gt;(10, 5, 1)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;INSERT INTO [dbo].[BenchMarkFact]([FK_Date_Key],[FK_Organisation_Key],[BenchMarkFactCount])&lt;br /&gt;VALUES&lt;br /&gt;(10, 1, 3),&lt;br /&gt;(10, 2, 5),&lt;br /&gt;(10, 3, 7)&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Building the cube&lt;/b&gt;&lt;br /&gt;Based on the script above i've created a cube. This structure of the cube can be seen in the diagram below:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-hgLp5VbDrTY/TjcB6IL7CoI/AAAAAAAAAtw/AIxUUpAweGM/s1600/cubestructure.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://3.bp.blogspot.com/-hgLp5VbDrTY/TjcB6IL7CoI/AAAAAAAAAtw/AIxUUpAweGM/s320/cubestructure.png" width="295" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-rWSomaPgieA/TjbAIbYAarI/AAAAAAAAAts/LWFLb47IhAQ/s1600/cubestructure.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;I've deployed&amp;nbsp; the project and the next step is building the report.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Building the report&lt;/b&gt;&lt;br /&gt;Now let's start another session of visual studio (BIDS) and to create a new report. I've added the following query to the dataset. &lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="font-size: x-small;"&gt;WITH&lt;br /&gt;MEMBER [Measures].[avg measure by all departments] AS&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AVG({[DimDepartment].[DepartmentDescription].[DepartmentDescription]},&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Measures].[DeptLevelFactCount])&lt;br /&gt;MEMBER [Measures].[avg measure by department C] AS&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AVG({[DimDepartment].[DepartmentDescription].&amp;amp;[Department C]},&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Measures].[DeptLevelFactCount])&lt;br /&gt;MEMBER [Measures].[avg measure by all Organisations] AS&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AVG({[DimOrganisation].[OrganisationDescription].[OrganisationDescription]},&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Measures].[BenchMarkFactCount])&lt;br /&gt;SELECT &lt;br /&gt;{&lt;br /&gt;[Measures].[avg measure by all departments],&lt;br /&gt;[Measures].[avg measure by department C],&lt;br /&gt;[Measures].[avg measure by all Organisations]&lt;br /&gt;} &lt;br /&gt;ON COLUMNS&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;FROM ( SELECT ( { [DimDate].[DateYear].&amp;amp;[2009] } ) ON COLUMNS &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM [Gauge]) &lt;br /&gt;WHERE ( [DimDate].[DateYear].&amp;amp;[2009] ) CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;And i've dragged some gauges on the dashboard. &lt;br /&gt;.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-uTdwV0L1L6c/Tje1xiTGT-I/AAAAAAAAAt8/R8LKdVe08fc/s1600/gaugereport.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="244" src="http://3.bp.blogspot.com/-uTdwV0L1L6c/Tje1xiTGT-I/AAAAAAAAAt8/R8LKdVe08fc/s320/gaugereport.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The radial gauge (1) is the one i initially preferred but while reading more about the usability of this diagram the less i prefer (see below for the usability tips). The second is a linear gauge and is like a thermometer. The third is also a linear gauge but with ranges. This would imply that a indicator is judged somehow in right or wrong. The fourth lineair gauge is a gauge with precentages.&amp;nbsp; I didn't manage to change the percentages into absolute numbers. And the last gauge (5) is the same as 2 but horizontal positioned.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Usability tips&lt;/b&gt;&lt;br /&gt;From studying (old study) books, internet,&amp;nbsp; etc i can give you some handy tips and best practices when you're developing gauges and dashboards:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The first tip is don't use radial gauges (1) ;-) in your dashboard because they use a lot of space and the added value is low. If do want to use gauge in your dashboard, use the lineair gauge (2, 4 or 5). This diagram uses less space on your dashboard and gives you the same information.&lt;/li&gt;&lt;li&gt;When you do use the radial gauge don't punt the numbers on the inside of the scale. Put them on the outside of the scale. This way the pointer won't overlap the numbers. This will enhance faster readability of the gauge.&lt;/li&gt;&lt;li&gt;If you're using the radial gauge put the markers on the inside.There are three options available and this the least worst option. The other options are outside and cross. The outside option could cover the numbers with the marker and cross will do the same but centers between the inside and the outside option. So i would recommend using the inside option.&lt;/li&gt;&lt;li&gt;In the example i used multiple indicators for an average of all departments and an average of all other organisations. I used different color for these indicators. But one thing i did not manage was adding a label (avg departments or avg organisations) to the indicators. For beter readability i would have liked that. Again this would have enhanced readability. Perhaps i'll find out in the future.&lt;/li&gt;&lt;li&gt;The use of colors is also an important choice. In number 2 and 5 i've used red as a color and red indicates as there is a danger, problem, etc. In this example is the color red not a very good choice.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;br /&gt;There is a lot possible with these gauges and you can play for hours with these things. I think that dashboard design is not about putting all kind of gauges, diagrams, graphs on a window but you have to think about how to present the information on the screen for the best usability possible. That's the challenge when you're developing a dashboard.&lt;br /&gt;&lt;br /&gt;Greetz,&lt;br /&gt;Hennie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-1173645907733255075?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/1173645907733255075/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2011/08/ssasssrs-building-different-gauges-with.html#comment-form' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/1173645907733255075'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/1173645907733255075'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2011/08/ssasssrs-building-different-gauges-with.html' title='SSAS/SSRS : Building different gauges with MDX.'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-J3kbfJqf3Ng/TjUPlFoyiXI/AAAAAAAAAtE/U-BATaI38vM/s72-c/Gauge.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-1045203025482320026</id><published>2011-07-26T19:59:00.001+02:00</published><updated>2011-07-26T20:00:09.709+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Denali'/><title type='text'>Denali : Installing the SSAS Tabular Model project AdventureWorks</title><content type='html'>&lt;b&gt;Introduction&lt;/b&gt;&lt;br /&gt;I wanted to take a look at the new tabular model (BISM) and i've already read some things about BISM and the multidimensional mode on the blog of &lt;a href="http://cwebbbi.wordpress.com/2010/11/11/pass-summit-day-2/"&gt;Chris Webb&lt;/a&gt;. These two are not working together. The BISM and multidimensional model are two different things. It seems that you need to install the "tabular mode" on a seperate instance. During the new installation of Denali CTP3 (post) i pressed next, next, etc and i didn't noticed a choice for this tabular mode (i've to read my own post in detail to make sure ;-)).&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Installing a new instance in Denali&lt;/b&gt;&lt;br /&gt;The first thing we have to do is&amp;nbsp;installing a new instance on SQL Server. So start up the setup.exe again an let's go through the installation process again. I'm not showing every window again. You can read more about installing Denali in a &lt;a href="http://bifuture.blogspot.com/2011/07/installing-sql-server-denali-ctp3.html"&gt;former post&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-CkUxXtUUWas/Ti5v-KApCCI/AAAAAAAAAro/d8Pn3N5xsvo/s1600/SS+Installation+center+%2528instance%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="214px" src="http://2.bp.blogspot.com/-CkUxXtUUWas/Ti5v-KApCCI/AAAAAAAAAro/d8Pn3N5xsvo/s320/SS+Installation+center+%2528instance%2529.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Click on installation.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-1i0mzY9f6Zw/Ti5wT7THawI/AAAAAAAAArs/CAI_Y6MhEvY/s1600/validation+%2528instance%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240px" src="http://2.bp.blogspot.com/-1i0mzY9f6Zw/Ti5wT7THawI/AAAAAAAAArs/CAI_Y6MhEvY/s320/validation+%2528instance%2529.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Press Next,&amp;nbsp; Next until you arrive in this window.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/--xI2SPlIo1c/Ti5w8SabLRI/AAAAAAAAAr0/6nwBzmv1H7w/s1600/setup+support+rules+%2528instance%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="239px" src="http://4.bp.blogspot.com/--xI2SPlIo1c/Ti5w8SabLRI/AAAAAAAAAr0/6nwBzmv1H7w/s320/setup+support+rules+%2528instance%2529.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Press Next, Next until you arrive in this window. &lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-0I0AjJRtZu8/Ti5w720Pb7I/AAAAAAAAArw/zsV70QeMt44/s1600/installationtype+%2528instance%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240px" src="http://4.bp.blogspot.com/-0I0AjJRtZu8/Ti5w720Pb7I/AAAAAAAAArw/zsV70QeMt44/s320/installationtype+%2528instance%2529.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;First i thought that i had to enter information about the instance here. But creating a new instance is done later in the installation process.&lt;br /&gt;&lt;br /&gt;Press a couple of times Next, Next, Next, etc until you arrive in this window.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-975L4OlN7fo/Ti5xa8nNCsI/AAAAAAAAAr4/18zRt6anPoU/s1600/Feature+selection+%2528instance%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240px" src="http://4.bp.blogspot.com/-975L4OlN7fo/Ti5xa8nNCsI/AAAAAAAAAr4/18zRt6anPoU/s320/Feature+selection+%2528instance%2529.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;etc, etc...&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-BVB1gWp0sZg/Ti5y3PjWVeI/AAAAAAAAAr8/tB2_LpBIKKY/s1600/instance+configuration+%2528instance%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240px" src="http://4.bp.blogspot.com/-BVB1gWp0sZg/Ti5y3PjWVeI/AAAAAAAAAr8/tB2_LpBIKKY/s320/instance+configuration+%2528instance%2529.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Press Next, Next, etc until you arrive in the next window:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-KHso9s2uMMc/Ti54zKsHjMI/AAAAAAAAAsA/JbSsgnzy5PQ/s1600/Tabular+mode+%2528instance%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240px" src="http://4.bp.blogspot.com/-KHso9s2uMMc/Ti54zKsHjMI/AAAAAAAAAsA/JbSsgnzy5PQ/s320/Tabular+mode+%2528instance%2529.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;blabla Next, etc.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-a_ZECNK18UA/Ti55LidiBLI/AAAAAAAAAsE/O5H6x989_nM/s1600/Readtoinstall+%2528instance%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="297px" src="http://3.bp.blogspot.com/-a_ZECNK18UA/Ti55LidiBLI/AAAAAAAAAsE/O5H6x989_nM/s320/Readtoinstall+%2528instance%2529.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Done......&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Installing the Tabular model project&lt;/b&gt;&lt;br /&gt;Okay now it's time to install the BISM project. If you download the examples from Microsoft and extract the files you will see the following files.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-ynNVR1YwVr4/Ti57L0lSDrI/AAAAAAAAAsI/NG3rt37zkE8/s1600/installed+files.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-ynNVR1YwVr4/Ti57L0lSDrI/AAAAAAAAAsI/NG3rt37zkE8/s1600/installed+files.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The following files are available in the folder "Adventure Works DW Tabular Denali CTP3".&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-MEBnOERXAb8/Ti57uMMkFKI/AAAAAAAAAsQ/_L_mt5EaU5c/s1600/project+bism.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-MEBnOERXAb8/Ti57uMMkFKI/AAAAAAAAAsQ/_L_mt5EaU5c/s1600/project+bism.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Again, the following files are available in the folder "Adventure Works DW Tabular Denali CTP3".&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-E4Q30IKDhA8/Ti57t17b7II/AAAAAAAAAsM/hxmbmftJovQ/s1600/files+BISM+project.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-E4Q30IKDhA8/Ti57t17b7II/AAAAAAAAAsM/hxmbmftJovQ/s1600/files+BISM+project.png" /&gt;&lt;/a&gt;&lt;/div&gt;The first file is the BIM file and the other one is the BIMproject file. The bin folder is empty. Okay lets double click on the projectfile and ....&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-t4O5070IC-c/Ti6jZob_T6I/AAAAAAAAAsU/bwEBFQXqR6E/s1600/BIM+melding.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="112px" src="http://2.bp.blogspot.com/-t4O5070IC-c/Ti6jZob_T6I/AAAAAAAAAsU/bwEBFQXqR6E/s320/BIM+melding.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The message appears : "You cannot open the BIM file. Reason: The workspace database server 'localhost' is not running in Vertipaq mode.". I immediately thought that this has something to do with the instance i've created. On the localhost i've installed the Multidimensional mode and on the BISM instance i've installed the tabular mode. I opened the properties of the project and noticed that the propery Workspace Server was "localhost". I changed this to localhost\bism.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-mLBuaI3JH5E/Ti6kUuQ4w5I/AAAAAAAAAsY/KaWyRdliuNc/s1600/properties.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320px" src="http://1.bp.blogspot.com/-mLBuaI3JH5E/Ti6kUuQ4w5I/AAAAAAAAAsY/KaWyRdliuNc/s320/properties.png" width="273px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;After i changed the property, a verification process is started right away. It's telling me that the connection to server is succeeded. Great.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-nFkH_DTuzfs/Ti6kU0iAPaI/AAAAAAAAAsc/gu8fu5zTTMg/s1600/check+server.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="83px" src="http://4.bp.blogspot.com/-nFkH_DTuzfs/Ti6kU0iAPaI/AAAAAAAAAsc/gu8fu5zTTMg/s320/check+server.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;And yes it seems that we can run the project.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-pElM2noYtYc/Ti6lOmU2ymI/AAAAAAAAAsg/2sN-6ZmHnUM/s1600/BISM+Adventureworks+project.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="267px" src="http://4.bp.blogspot.com/-pElM2noYtYc/Ti6lOmU2ymI/AAAAAAAAAsg/2sN-6ZmHnUM/s320/BISM+Adventureworks+project.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Okay now let's see how it looks in SQL Server Management Studio. I would have expected a choice for connecting to the BISM services or whatever.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-RCzZYJSFD18/Ti6oJT-gilI/AAAAAAAAAsk/8-Blto-QQBQ/s1600/select+instance+BISM+%2528instance%2529.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-RCzZYJSFD18/Ti6oJT-gilI/AAAAAAAAAsk/8-Blto-QQBQ/s1600/select+instance+BISM+%2528instance%2529.png" /&gt;&lt;/a&gt;&lt;/div&gt;So how do i see the deployed projects? Let's try this&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-jsjAfxWkTqM/Ti6pE9pkGbI/AAAAAAAAAso/hy-xvC1s9dk/s1600/connecting+to+BISM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="236px" src="http://4.bp.blogspot.com/-jsjAfxWkTqM/Ti6pE9pkGbI/AAAAAAAAAso/hy-xvC1s9dk/s320/connecting+to+BISM.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Does that work? Yep it seems we have succeeded.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-eUwH3mGnXVI/Ti6pf49B6lI/AAAAAAAAAss/FbDqvspVdFM/s1600/lookatproject.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="274px" src="http://2.bp.blogspot.com/-eUwH3mGnXVI/Ti6pf49B6lI/AAAAAAAAAss/FbDqvspVdFM/s320/lookatproject.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;I've to make a remark. As you can see a project is deployed, here. Before i tried to connect to the bism server (?) i played a bit with Adventureworks project. I tried to deploy the project and i got an error:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-1COO5_ASvCY/Ti6qPEh6rOI/AAAAAAAAAsw/mVZxqRJC-ew/s1600/deploy+succeeded+ornot.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320px" src="http://1.bp.blogspot.com/-1COO5_ASvCY/Ti6qPEh6rOI/AAAAAAAAAsw/mVZxqRJC-ew/s320/deploy+succeeded+ornot.png" width="293px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;I assumed that the deployment didn't succeed but looking in SSMS show a deployed project(?!). So is this a bug? Interesting. So i deleted the project in SSMS.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-8WLheF5ouqI/Ti6s10ukLsI/AAAAAAAAAs8/aFvdG1iiYYY/s1600/delete+adventureworks+BISM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="287px" src="http://4.bp.blogspot.com/-8WLheF5ouqI/Ti6s10ukLsI/AAAAAAAAAs8/aFvdG1iiYYY/s320/delete+adventureworks+BISM.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-pYI4vzbQ8ho/Ti6q4Ylz8SI/AAAAAAAAAs0/dT5RnIEp-f4/s1600/delete+adventureworks+BISM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;And the project was deleted from BISM server. I tried to deploy the project again, the error occurred again and..... the project is gone/not there! So i assume that the project was already installed during the installing process.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-EQd31eY_86U/Ti6s2GnXBiI/AAAAAAAAAtA/KIUin7HlzCk/s1600/BISM+server.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="48px" src="http://3.bp.blogspot.com/-EQd31eY_86U/Ti6s2GnXBiI/AAAAAAAAAtA/KIUin7HlzCk/s320/BISM+server.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Now, i've to found why the adventureworks project don't&amp;nbsp;install on the server anymore, but that is one for a future post.&lt;/div&gt;&lt;br /&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;br /&gt;One conclusion you can draw from this post is that MDX en BISM don't mix (duh). These two cannot installed on the same instance. So when you're developing mixed projects in MDX and BISM you need to install a seperate instance.&lt;br /&gt;&lt;br /&gt;Next time we will go deeper into working with this BISM and the adventureworks example.&lt;br /&gt;&lt;br /&gt;Greetz&lt;br /&gt;Hennie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-1045203025482320026?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/1045203025482320026/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2011/07/denali-installing-ssas-tabular-model.html#comment-form' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/1045203025482320026'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/1045203025482320026'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2011/07/denali-installing-ssas-tabular-model.html' title='Denali : Installing the SSAS Tabular Model project AdventureWorks'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-CkUxXtUUWas/Ti5v-KApCCI/AAAAAAAAAro/d8Pn3N5xsvo/s72-c/SS+Installation+center+%2528instance%2529.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-8686337350155796569</id><published>2011-07-22T21:01:00.004+02:00</published><updated>2011-07-23T14:31:11.250+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Denali'/><title type='text'>Denali : 10 situations with the EOMONTH() function.</title><content type='html'>Hi, &lt;br /&gt;&lt;br /&gt;In Denali is a new function is available: EOMONTH() and it returns the last day of the month of specified date, with an optional offset. More information can be found on &lt;a href="http://technet.microsoft.com/en-us/library/hh213020%28SQL.110%29.aspx"&gt;technet&lt;/a&gt;. Return type is the type of &lt;span class="parameter"&gt;&lt;i&gt;&lt;span style="font-family: Segoe UI;"&gt;start_date&lt;/span&gt;&lt;/i&gt;&lt;/span&gt; or &lt;span class="input"&gt;datetime2(7). EOMONTH() is the same name as used in Excel.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="input"&gt;So i tried some things with this function. Below you can see the results:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="input"&gt;&lt;b&gt;Situation 1&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="input"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="font-size: small;"&gt;SELECT EOMONTH(getdate())&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: black; font-family: inherit; font-size: small;"&gt;Returning:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="input"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;a href="http://4.bp.blogspot.com/-H32LWCkpj7k/TikiC0FUYUI/AAAAAAAAArQ/TIn_9pL5FMc/s1600/20110731.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-H32LWCkpj7k/TikiC0FUYUI/AAAAAAAAArQ/TIn_9pL5FMc/s1600/20110731.png" t$="true" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="input"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Always nice to try&lt;span class="input"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="input" style="font-size: small;"&gt;&lt;span style="color: blue; font-family: Consolas;"&gt;&lt;span style="color: blue; font-family: Consolas;"&gt;&lt;span style="color: blue; font-family: Consolas;"&gt;&lt;span style="color: blue; font-family: Consolas;"&gt;&lt;span style="color: blue; font-family: Consolas;"&gt;&lt;span style="color: blue; font-family: Consolas;"&gt;SELECT &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: teal; font-family: Consolas;"&gt;&lt;span style="color: teal; font-family: Consolas;"&gt;&lt;span style="color: teal; font-family: Consolas;"&gt;EOMONTH&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;(&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red; font-family: Consolas;"&gt;&lt;span style="color: red; font-family: Consolas;"&gt;&lt;span style="color: red; font-family: Consolas;"&gt;'2012-02-12'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: black; font-family: inherit; font-size: small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Returning:&lt;br /&gt;&lt;span style="color: black;"&gt;&lt;span style="font-family: inherit;"&gt;&lt;b&gt;Situation 2&lt;/b&gt;&lt;/span&gt;&lt;/span&gt; &lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://3.bp.blogspot.com/-XxFOn4raWPI/Tikii6NB65I/AAAAAAAAArU/gK_r1ImnDTs/s1600/20120229.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-XxFOn4raWPI/Tikii6NB65I/AAAAAAAAArU/gK_r1ImnDTs/s1600/20120229.png" t$="true" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="color: black; font-family: inherit;"&gt;Yup that works too!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Situation 3&lt;/b&gt;&lt;br /&gt;Now lets try somethiing with the offset.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue; font-family: Consolas; font-size: small;"&gt;&lt;span style="color: blue; font-family: Consolas;"&gt;&lt;span style="color: blue; font-family: Consolas;"&gt;SELECT&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: small;"&gt;&lt;span style="font-family: Consolas;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: teal; font-family: Consolas; font-size: small;"&gt;&lt;span style="color: teal; font-family: Consolas;"&gt;&lt;span style="color: teal; font-family: Consolas;"&gt;EOMONTH&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: grey; font-family: Consolas; font-size: small;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;(&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red; font-family: Consolas; font-size: small;"&gt;&lt;span style="color: red; font-family: Consolas;"&gt;&lt;span style="color: red; font-family: Consolas;"&gt;'2013-02-12'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: grey; font-family: Consolas; font-size: small;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: small;"&gt;&lt;span style="font-family: Consolas;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: grey; font-family: Consolas; font-size: small;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;-&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: small;"&gt;&lt;span style="font-family: Consolas;"&gt;10000&lt;/span&gt;&lt;/span&gt;&lt;span style="color: grey; font-family: Consolas; font-size: small;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Returning:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://3.bp.blogspot.com/-8gOpccpmJUQ/Tikjchc0OjI/AAAAAAAAArY/z2o6zaTDaOg/s1600/11791031.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-8gOpccpmJUQ/Tikjchc0OjI/AAAAAAAAArY/z2o6zaTDaOg/s1600/11791031.png" t$="true" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Thats a lot of years back..&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Situation 4&lt;/b&gt;&lt;br /&gt;Now let's try to crash the EOMONTH() function.&lt;br /&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;SELECT&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: small;"&gt;&lt;span style="font-family: Consolas;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: teal; font-family: Consolas; font-size: small;"&gt;&lt;span style="color: teal; font-family: Consolas;"&gt;&lt;span style="color: teal; font-family: Consolas;"&gt;EOMONTH&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: grey; font-family: Consolas; font-size: small;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;(&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red; font-family: Consolas; font-size: small;"&gt;&lt;span style="color: red; font-family: Consolas;"&gt;&lt;span style="color: red; font-family: Consolas;"&gt;'2013-02-12'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: grey; font-family: Consolas; font-size: small;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: small;"&gt;&lt;span style="font-family: Consolas;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: grey; font-family: Consolas; font-size: small;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;-&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: small;"&gt;&lt;span style="font-family: Consolas;"&gt;100000&lt;/span&gt;&lt;/span&gt;&lt;span style="color: grey; font-family: Consolas; font-size: small;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Returning:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: red;"&gt;Msg 517, Level 16, State 1, Line 1&lt;/span&gt;&lt;br /&gt;&lt;span style="color: red;"&gt;Adding a value to a 'datetime2' column caused an overflow.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Situation 5&lt;/b&gt;&lt;br /&gt;Let't try some implicit conversion of the function&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&lt;span style="font-size: small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: blue; font-family: Consolas; font-size: small;"&gt;&lt;span style="color: blue; font-family: Consolas;"&gt;&lt;span style="color: blue; font-family: Consolas;"&gt;SELECT&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: small;"&gt;&lt;span style="font-family: Consolas;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: small;"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: teal; font-family: Consolas; font-size: small;"&gt;&lt;span style="color: teal; font-family: Consolas;"&gt;&lt;span style="color: teal; font-family: Consolas;"&gt;EOMONTH&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: grey; font-family: Consolas; font-size: small;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;(&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red; font-family: Consolas; font-size: small;"&gt;&lt;span style="color: red; font-family: Consolas;"&gt;&lt;span style="color: red; font-family: Consolas;"&gt;'20110721'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: grey; font-family: Consolas; font-size: small;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: black; font-family: inherit;"&gt;Returning&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://4.bp.blogspot.com/-LxTfwUgWB9M/TiklDieqaJI/AAAAAAAAArc/cAOZioJvW5s/s1600/Implicit.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-LxTfwUgWB9M/TiklDieqaJI/AAAAAAAAArc/cAOZioJvW5s/s1600/Implicit.png" t$="true" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Situation 6&lt;/b&gt;&lt;br /&gt;Let's try an&amp;nbsp; impossible implicit conversion&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue; font-family: Consolas; font-size: small;"&gt;&lt;span style="color: blue; font-family: Consolas;"&gt;&lt;span style="color: blue; font-family: Consolas;"&gt;SELECT&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: small;"&gt;&lt;span style="font-family: Consolas;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: teal; font-family: Consolas; font-size: small;"&gt;&lt;span style="color: teal; font-family: Consolas;"&gt;&lt;span style="color: teal; font-family: Consolas;"&gt;EOMONTH&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: grey; font-family: Consolas; font-size: small;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;(&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red; font-family: Consolas; font-size: small;"&gt;&lt;span style="color: red; font-family: Consolas;"&gt;&lt;span style="color: red; font-family: Consolas;"&gt;'20110750'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: grey; font-family: Consolas; font-size: small;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Returning&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;span style="color: red; font-size: small;"&gt;Msg 241, Level 16, State 1, Line 1&lt;/span&gt;&lt;span style="font-size: small;"&gt;&lt;br style="color: red;" /&gt;&lt;/span&gt;&lt;span style="color: red; font-size: small;"&gt;Conversion failed when converting date and/or time from character string.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Situation 7&lt;/b&gt;&lt;br /&gt;Let's try a another&amp;nbsp; impossible implicit conversion&lt;br /&gt;&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;span style="font-family: inherit; font-size: small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue; font-family: Consolas; font-size: small;"&gt;&lt;span style="color: blue; font-family: Consolas;"&gt;&lt;span style="color: blue; font-family: Consolas;"&gt;SELECT&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;span style="font-size: small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: small;"&gt;&lt;span style="font-family: Consolas;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: teal; font-family: Consolas; font-size: small;"&gt;&lt;span style="color: teal; font-family: Consolas;"&gt;&lt;span style="color: teal; font-family: Consolas;"&gt;EOMONTH&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: grey; font-family: Consolas; font-size: small;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;(&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: small;"&gt;&lt;span style="font-family: Consolas;"&gt;20110750&lt;/span&gt;&lt;/span&gt;&lt;span style="color: grey; font-family: Consolas; font-size: small;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Returning&lt;br /&gt;&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;br /&gt;&lt;span style="color: red; font-size: small;"&gt;Msg 8116, Level 16, State 1, Line 1&lt;br /&gt;Argument data type int is invalid for argument 1 of eomonth function.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;Situation 8&lt;/b&gt;&lt;br /&gt;BOMonth()?&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;br /&gt;&lt;span style="color: blue; font-family: Consolas; font-size: small;"&gt;&lt;span style="color: blue; font-family: Consolas;"&gt;&lt;span style="color: blue; font-family: Consolas;"&gt;SELECT&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: small;"&gt;&lt;span style="font-family: Consolas;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: teal; font-family: Consolas; font-size: small;"&gt;&lt;span style="color: teal; font-family: Consolas;"&gt;&lt;span style="color: teal; font-family: Consolas;"&gt;BOMONTH&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: small;"&gt;&lt;span style="font-family: Consolas;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: grey; font-family: Consolas; font-size: small;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;=&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: small;"&gt;&lt;span style="font-family: Consolas;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: teal; font-family: Consolas; font-size: small;"&gt;&lt;span style="color: teal; font-family: Consolas;"&gt;&lt;span style="color: teal; font-family: Consolas;"&gt;EOMONTH&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: grey; font-family: Consolas; font-size: small;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;(&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: magenta; font-family: Consolas; font-size: small;"&gt;&lt;span style="color: magenta; font-family: Consolas;"&gt;&lt;span style="color: magenta; font-family: Consolas;"&gt;getDate&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: grey; font-family: Consolas; font-size: small;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;(),&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: small;"&gt;&lt;span style="font-family: Consolas;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: grey; font-family: Consolas; font-size: small;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;-&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: small;"&gt;&lt;span style="font-family: Consolas;"&gt;1&lt;/span&gt;&lt;/span&gt;&lt;span style="color: grey; font-family: Consolas; font-size: small;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: small;"&gt;&lt;span style="font-family: Consolas;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: grey; font-family: Consolas; font-size: small;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;&lt;span style="color: grey; font-family: Consolas;"&gt;+&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas; font-size: small;"&gt;&lt;span style="font-family: Consolas;"&gt; 1&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Returning&lt;br /&gt;&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;a href="http://2.bp.blogspot.com/-yH_Vgqz8XZo/TikqbIAzK_I/AAAAAAAAArk/E1gwjm7RLkA/s1600/BOM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-yH_Vgqz8XZo/TikqbIAzK_I/AAAAAAAAArk/E1gwjm7RLkA/s1600/BOM.png" t$="true" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;Situation 9&lt;/b&gt;&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: small;"&gt;&lt;code&gt;SELECT * &lt;br /&gt;FROM dbo.FactResellerSales RS&lt;br /&gt;INNER JOIN DimDate D ON RS.OrderDateKey = D.DateKey&lt;br /&gt;WHERE D.FullDateAlternateKey Between CAST('20040501' AS DATETIME) AND EOMONTH('20040501')&lt;/code&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Returning&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;a href="http://4.bp.blogspot.com/-J3ZntTkznuw/TikpCsW6ZLI/AAAAAAAAArg/46XIIu_SYHo/s1600/That+seems+to+work.png" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-J3ZntTkznuw/TikpCsW6ZLI/AAAAAAAAArg/46XIIu_SYHo/s1600/That+seems+to+work.png" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Situation 10&lt;/b&gt;&lt;br /&gt;Hmm the last one... Can't think of a new situation anymore. I'm out of inspiration! I suggest that you think about the tenth situation and let me know what you've came up with....&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;br /&gt;EOMONTH() is an interesting function but as other bloggers suggests, why is the only new Date function that is released. There are so many datefunctions to think about...&lt;br /&gt;&lt;br /&gt;Other interesting functions to discover are:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IIF&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CHOOSE&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CONCAT&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATEFROMPARTS&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TIMEFROMPARTS&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATETIME2FROMPARTS&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATETIMEFROMPARTS&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SMALLDATETIMEFROMPARTS&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TRY_CONVERT&lt;/li&gt;&lt;li&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FORMAT&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;This is not a complete list.&lt;br /&gt;Very interesting link&amp;nbsp;is on beyond relational : &lt;a href="http://beyondrelational.com/whatisnew/sqlserver/denali/"&gt;http://beyondrelational.com/whatisnew/sqlserver/denali/&lt;/a&gt; where you can find all the features released in Denali.&lt;br /&gt;&lt;br /&gt;Greetz,&lt;br /&gt;Hennie&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;span style="font-family: Consolas; font-size: xx-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: blue; font-family: Consolas; font-size: x-small;"&gt;&lt;span style="color: black; font-family: inherit;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: grey; font-family: Consolas; font-size: x-small;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-8686337350155796569?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/8686337350155796569/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2011/07/denali-10-situations-with-eomonth.html#comment-form' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/8686337350155796569'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/8686337350155796569'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2011/07/denali-10-situations-with-eomonth.html' title='Denali : 10 situations with the EOMONTH() function.'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-H32LWCkpj7k/TikiC0FUYUI/AAAAAAAAArQ/TIn_9pL5FMc/s72-c/20110731.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-8188644150662553420</id><published>2011-07-20T08:43:00.000+02:00</published><updated>2011-07-20T08:43:27.083+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Denali'/><title type='text'>Installing SQL Server Denali CTP3 Walkthrough</title><content type='html'>&lt;b&gt;Introduction&lt;/b&gt; &lt;br /&gt;In case you missed it: SQL Server Denali CTP3 is out! At last a new CTP version of Denali and this time (relative) more features available than in CTP1. CTP2 was not widely distributed, but only for&amp;nbsp;a happy few. This post is about installing the x86 version on my virtual machine. Created a new clean VM environment ready for installing Denali CTP3. Below i've gathered the most interesting links about CTP3 (so far for this moment):&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://sqlblog.com/blogs/davide_mauri/archive/2011/07/12/sql-server-2011-denali-ctp3-download-links.aspx"&gt;CTP3 Download links (Davide Mauri)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://msftdbprodsamples.codeplex.com/releases/view/55330"&gt;Adventureworks for CTP3&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://blogs.technet.com/b/dataplatforminsider/archive/2011/07/11/sql-server-code-name-denali-ctp3-is-here.aspx"&gt;SQL Server team blog&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.sqlservercentral.com/blogs/jamesserra/archive/2011/07/12/sql-server-_1C20_denali_1D203A00_-ctp3-now-available_2100_.aspx"&gt;James Serra's blog with all kind of links&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;b&gt;Downloading the necessary software of Denali CTP3&lt;/b&gt;&lt;br /&gt;First downoad the following software:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Denali CTP3. &lt;/li&gt;&lt;li&gt;Sample databases (future post).&lt;/li&gt;&lt;li&gt;Feature pack.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;b&gt;Installing&amp;nbsp;Denali CTP3&lt;/b&gt;&lt;br /&gt;So the first thing to do is downloading the CTP3 version. After installing the download manager you can download the CTP3 version:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-95AGpfKQZQ0/TiPababC8KI/AAAAAAAAApM/tSpcBDeRBu8/s1600/Downloading+denali+2012+CTP3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="82px" src="http://1.bp.blogspot.com/-95AGpfKQZQ0/TiPababC8KI/AAAAAAAAApM/tSpcBDeRBu8/s400/Downloading+denali+2012+CTP3.png" width="400px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The first thing i did is double clicking on the application file : SQLFULL_x86_ENU_INSTALL and the next thing that happens is the "Unloading the Box" window that opens.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-w8Q-wnbfrIg/TiPcxdpX5xI/AAAAAAAAApQ/G112gv2-slw/s1600/Unloading+the+box.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="86px" src="http://2.bp.blogspot.com/-w8Q-wnbfrIg/TiPcxdpX5xI/AAAAAAAAApQ/G112gv2-slw/s320/Unloading+the+box.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;There seems some unzipping taking place here in a folder SQLFULL_x86_ENU and i waited a couple of minutes before it's completed. the following files are available in the SQLFULL_x86_ENU folder:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-hSVFs_S0tlA/TiPfjpl21NI/AAAAAAAAApU/DRvOp5Qni_Y/s1600/The+folder+structure.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="120px" src="http://2.bp.blogspot.com/-hSVFs_S0tlA/TiPfjpl21NI/AAAAAAAAApU/DRvOp5Qni_Y/s320/The+folder+structure.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Double clicking the setup.exe did the following window showing up:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-3nEYb7n2gjM/TiPf9Hp_9fI/AAAAAAAAApY/7bV8a1P-2lM/s1600/Please+wait.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="52px" src="http://3.bp.blogspot.com/-3nEYb7n2gjM/TiPf9Hp_9fI/AAAAAAAAApY/7bV8a1P-2lM/s320/Please+wait.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;And then we're in the installation center:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-TFCbMdlkWnc/TiPgR8O5i2I/AAAAAAAAApc/P2g9MWJY2XY/s1600/SSInstallation+Center.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400px" src="http://1.bp.blogspot.com/-TFCbMdlkWnc/TiPgR8O5i2I/AAAAAAAAApc/P2g9MWJY2XY/s400/SSInstallation+Center.png" width="372px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&amp;nbsp;And we leave the first tab as it is and go to the second option : "installation"&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-NRWh0rPGp-s/TiPgzzbycqI/AAAAAAAAApg/WGnTEICuJPk/s1600/installation+tab.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="217px" src="http://4.bp.blogspot.com/-NRWh0rPGp-s/TiPgzzbycqI/AAAAAAAAApg/WGnTEICuJPk/s400/installation+tab.png" width="400px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;and choose "New SQL Server stand-alone installation or add features to an existing installation" and it seems that i've passed some potential problems:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-4zP5gMUwDq8/TiPhbtdEpJI/AAAAAAAAApk/PSK32G2nX68/s1600/passed.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300px" src="http://1.bp.blogspot.com/-4zP5gMUwDq8/TiPhbtdEpJI/AAAAAAAAApk/PSK32G2nX68/s400/passed.png" width="400px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Press ok and the following window appears. There is only an evaluation version , yet ;-)&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-Kr1MmuHRsBo/TiPl6C-lCjI/AAAAAAAAAp4/pxkuTM-LgYg/s1600/evaluation+version.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300px" src="http://2.bp.blogspot.com/-Kr1MmuHRsBo/TiPl6C-lCjI/AAAAAAAAAp4/pxkuTM-LgYg/s400/evaluation+version.png" width="400px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;Press next.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-oqal2LBUmUc/TiPl5tlgRJI/AAAAAAAAAp0/u01Pq3w49mE/s1600/license+terms.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300px" src="http://3.bp.blogspot.com/-oqal2LBUmUc/TiPl5tlgRJI/AAAAAAAAAp0/u01Pq3w49mE/s400/license+terms.png" width="400px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Press Next.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-UvvTTsczsco/TiPl5J1qv_I/AAAAAAAAApw/FFmP_QTX-9U/s1600/install+setup+files.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300px" src="http://3.bp.blogspot.com/-UvvTTsczsco/TiPl5J1qv_I/AAAAAAAAApw/FFmP_QTX-9U/s400/install+setup+files.png" width="400px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Press install. I'm ignoring the windows firewall problem.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-QjpkluRgcEw/TiPl4xa26DI/AAAAAAAAAps/kVw8GmsHnSk/s1600/Setup+support+rules.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300px" src="http://3.bp.blogspot.com/-QjpkluRgcEw/TiPl4xa26DI/AAAAAAAAAps/kVw8GmsHnSk/s400/Setup+support+rules.png" width="400px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Press Next. Just a simple installation is needed.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-zMideWmC5u0/TiPlzZ2fSTI/AAAAAAAAApo/ZJprMZO8hcw/s1600/SSFeature+installation.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300px" src="http://2.bp.blogspot.com/-zMideWmC5u0/TiPlzZ2fSTI/AAAAAAAAApo/ZJprMZO8hcw/s400/SSFeature+installation.png" width="400px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Press Next. Now we can select the features that are available and i choose the full option model. Not sure whether we run into problems but we'll see.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-WAKE8bdwLXo/TiPmzc6mqGI/AAAAAAAAAp8/AXS2rLvBJ1k/s1600/select+all+features.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300px" src="http://3.bp.blogspot.com/-WAKE8bdwLXo/TiPmzc6mqGI/AAAAAAAAAp8/AXS2rLvBJ1k/s400/select+all+features.png" width="400px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Press Next..... and....an error has occurred: Powershell 2.0 not installed. Hmmm.... &lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-hurdrXhVEYY/TiPnzxLFfFI/AAAAAAAAAqA/D04qTh9-DUo/s1600/installationruleserror.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300px" src="http://1.bp.blogspot.com/-hurdrXhVEYY/TiPnzxLFfFI/AAAAAAAAAqA/D04qTh9-DUo/s400/installationruleserror.png" width="400px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Strange error: "Windows Powershell 2.0 already installed" ? Below the error message in more detail. "Do not select the feature that require PowerShell 2.0"? How should i know which feature is using powershell 2.0?&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-Pi1iDcDk5Ew/TiPoCWVcP6I/AAAAAAAAAqE/dmkhXiukXJQ/s1600/powershell+2.0+install+error.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="172px" src="http://1.bp.blogspot.com/-Pi1iDcDk5Ew/TiPoCWVcP6I/AAAAAAAAAqE/dmkhXiukXJQ/s320/powershell+2.0+install+error.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;I've downloaded powershell 2.0 from MSDN, installed and rerun the installation process again. Now, it seems that i've passed the powershell 2.0 prerequisites. I've noticed that before the installation rule window a message already appeared about installing powershell 2.0 (right bottom - two windows back).&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-JsaxWmfVZEE/TiPyY7yCu5I/AAAAAAAAAqI/4HdMeAxZwAw/s1600/passedtherules.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240px" src="http://1.bp.blogspot.com/-JsaxWmfVZEE/TiPyY7yCu5I/AAAAAAAAAqI/4HdMeAxZwAw/s320/passedtherules.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Press Next. It seems there is still enough space available on my C drive.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-ZB5-D7qRoro/TiPy5mXT4VI/AAAAAAAAAqM/46vaQqYoVfY/s1600/disk+space.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240px" src="http://1.bp.blogspot.com/-ZB5-D7qRoro/TiPy5mXT4VI/AAAAAAAAAqM/46vaQqYoVfY/s320/disk+space.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;Press Next.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-Mb_QKmC752A/TiP0--dOctI/AAAAAAAAAqQ/ofwpIAcdpWw/s1600/Serverconfiguration.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240px" src="http://1.bp.blogspot.com/-Mb_QKmC752A/TiP0--dOctI/AAAAAAAAAqQ/ofwpIAcdpWw/s320/Serverconfiguration.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Press Next. Adding current user. Not a very best practice but i'm just want to run Denali as quick as possible.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-6k6YXydhDVs/TiP1ai_ZPxI/AAAAAAAAAqU/hPoCS_v47jY/s1600/DBE+configuration.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240px" src="http://4.bp.blogspot.com/-6k6YXydhDVs/TiP1ai_ZPxI/AAAAAAAAAqU/hPoCS_v47jY/s320/DBE+configuration.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Press Next.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-4JgnJVpCxj4/TiP13gnu1FI/AAAAAAAAAqc/2b-8ypgjkvw/s1600/SSASConfiguration.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240px" src="http://3.bp.blogspot.com/-4JgnJVpCxj4/TiP13gnu1FI/AAAAAAAAAqc/2b-8ypgjkvw/s320/SSASConfiguration.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Press Next.&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-G0ArHbEnqlM/TiP2GblAzbI/AAAAAAAAAqg/qJQIq2CcQtc/s1600/SSRSConfiguration.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240px" src="http://4.bp.blogspot.com/-G0ArHbEnqlM/TiP2GblAzbI/AAAAAAAAAqg/qJQIq2CcQtc/s320/SSRSConfiguration.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;Press Next.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-bI6eGUnM5Wc/TiP2XFSfV8I/AAAAAAAAAqk/UfNPonpg8NM/s1600/DRC.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240px" src="http://4.bp.blogspot.com/-bI6eGUnM5Wc/TiP2XFSfV8I/AAAAAAAAAqk/UfNPonpg8NM/s320/DRC.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;Press Next.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-Zje3MaB5veU/TiP2rhL1dZI/AAAAAAAAAqo/k2bEzZ58pcg/s1600/Distributed+replay+controller.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240px" src="http://1.bp.blogspot.com/-Zje3MaB5veU/TiP2rhL1dZI/AAAAAAAAAqo/k2bEzZ58pcg/s320/Distributed+replay+controller.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Press Next.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-DaAM08PFbos/TiP24gkAhMI/AAAAAAAAAqs/ocXn-rGB04g/s1600/errorreporting.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240px" src="http://1.bp.blogspot.com/-DaAM08PFbos/TiP24gkAhMI/AAAAAAAAAqs/ocXn-rGB04g/s320/errorreporting.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;Press Next.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-3WXjb-jgHBg/TiP3KEyA4OI/AAAAAAAAAqw/ZOehv2dHsBk/s1600/IC+rules.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240px" src="http://4.bp.blogspot.com/-3WXjb-jgHBg/TiP3KEyA4OI/AAAAAAAAAqw/ZOehv2dHsBk/s320/IC+rules.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Press Next.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-SHA0xa3OHg8/TiP3WEP8YOI/AAAAAAAAAq0/r6lqD2okEsQ/s1600/Ready+to+install.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="266px" src="http://2.bp.blogspot.com/-SHA0xa3OHg8/TiP3WEP8YOI/AAAAAAAAAq0/r6lqD2okEsQ/s320/Ready+to+install.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Press Next and in the installation begins&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-p_7B1uIh5iM/TiP3p5MQBvI/AAAAAAAAAq4/ExtfdAW4L1A/s1600/installation+progress.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="266px" src="http://4.bp.blogspot.com/-p_7B1uIh5iM/TiP3p5MQBvI/AAAAAAAAAq4/ExtfdAW4L1A/s320/installation+progress.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Seems that everything is succeeded&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-EyMATpa9GKQ/TiQGYnMGxxI/AAAAAAAAAq8/U2FVKlhMkLY/s1600/complete.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="266px" src="http://1.bp.blogspot.com/-EyMATpa9GKQ/TiQGYnMGxxI/AAAAAAAAAq8/U2FVKlhMkLY/s320/complete.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;And finally execute a reboot and start SQL Server Management Studio via the Menu Start. You can see the following entries inthis menu:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-hZSTLdVYnQ8/TiQNz2UqpTI/AAAAAAAAArA/HbYBFwttN1g/s1600/startmenu.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-hZSTLdVYnQ8/TiQNz2UqpTI/AAAAAAAAArA/HbYBFwttN1g/s1600/startmenu.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;I'm not sure whether i've installed all these menu entries during the installation of Denali CTP3. I did have a clean windows install (Windows Server 2008) but the yellow entries are new and the white entries should be older. Not quite clear why some are white and some are yellow. &lt;br /&gt;&lt;br /&gt;When i start up the SQL Server Management Studio the following window appears:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-D87cC8K_AQQ/TiQOxc3zBAI/AAAAAAAAArE/7x3BSX24JeU/s1600/Denali+startmenu.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="208px" src="http://4.bp.blogspot.com/-D87cC8K_AQQ/TiQOxc3zBAI/AAAAAAAAArE/7x3BSX24JeU/s320/Denali+startmenu.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;And looking in the Object explorers of SSMS, SSIS (Control and dataflow) and SSRS shows me: &lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-0VuAZ6gnZZw/TiQWs4HXgrI/AAAAAAAAArM/pBIepWDWDxw/s1600/SSMS+Menu.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400px" src="http://4.bp.blogspot.com/-0VuAZ6gnZZw/TiQWs4HXgrI/AAAAAAAAArM/pBIepWDWDxw/s400/SSMS+Menu.png" width="378px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Well this is it for now.&lt;/div&gt;&lt;br /&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;br /&gt;The basic installation went smooth and i had one small problem with Powershell 2.0 that was a prerequisite (and wasn't reported during the analysisin the setup support rules window). I'm particularly interested in DQS and in SSIS deployment model. I hope to find out more in future about these parts.&lt;br /&gt;&lt;br /&gt;Greetz,&lt;br /&gt;Hennie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-8188644150662553420?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/8188644150662553420/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2011/07/installing-sql-server-denali-ctp3.html#comment-form' title='2 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/8188644150662553420'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/8188644150662553420'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2011/07/installing-sql-server-denali-ctp3.html' title='Installing SQL Server Denali CTP3 Walkthrough'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-95AGpfKQZQ0/TiPababC8KI/AAAAAAAAApM/tSpcBDeRBu8/s72-c/Downloading+denali+2012+CTP3.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-3367966619496065982</id><published>2011-07-17T14:49:00.004+02:00</published><updated>2011-07-17T15:04:56.298+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MDX'/><category scheme='http://www.blogger.com/atom/ns#' term='SSAS'/><category scheme='http://www.blogger.com/atom/ns#' term='SSRS'/><title type='text'>SSAS/SSRS : Building a graph for analyzing a subset related to the whole set</title><content type='html'>&lt;b&gt;Introduction&lt;/b&gt;&lt;br /&gt;My client has some wishes about a graph that shows a subset of facts of certain&amp;nbsp;locations against the whole population of locations. They want to highlight the locations and show their position in a sorted diagram. Below you can see the end result of the graph. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-0ZJ1EetUBK0/TiAs3ZEH01I/AAAAAAAAAo8/IxKqmNAICT0/s1600/Department+C.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/-0ZJ1EetUBK0/TiAs3ZEH01I/AAAAAAAAAo8/IxKqmNAICT0/s320/Department+C.png" width="313" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;Scenario&lt;/b&gt;&lt;br /&gt;For this purpose i've quickly created a small cube. First i build a script for building the following tables:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;DimDate&lt;/li&gt;&lt;li&gt;DimLocation&lt;/li&gt;&lt;li&gt;DimDepartment&lt;/li&gt;&lt;li&gt;BridgeLocationDepartment&lt;/li&gt;&lt;/ul&gt;&amp;nbsp;And they are related as follows:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-aQoYBmQcghg/TfTUQe8xILI/AAAAAAAAAmc/HMlnGuaVEJs/s1600/MM+dimension.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="282" m$="true" src="http://1.bp.blogspot.com/-aQoYBmQcghg/TfTUQe8xILI/AAAAAAAAAmc/HMlnGuaVEJs/s320/MM+dimension.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;T&lt;span style="font-size: small;"&gt;his situation is already explained in more detail in my former posts:&lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;M&lt;/span&gt;&lt;span style="font-size: small;"&gt;odeling a N:M relation between dimensions (&lt;a href="http://bifuture.blogspot.com/2011/06/ssaskimball-modeling-nm-relation.html"&gt;&lt;span style="color: #888888;"&gt;part I&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style="font-size: small;"&gt;)&lt;/span&gt;&lt;span style="font-size: small;"&gt;. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;Building a multivalue dimension construction in SSAS ( &lt;a href="http://bifuture.blogspot.com/2011/06/ssaskimball-building-multivalue.html"&gt;&lt;span style="color: #888888;"&gt;part II&lt;/span&gt;&lt;/a&gt;). &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;Joining issue with MDXing of M2M dimension (&lt;a href="http://bifuture.blogspot.com/2011/07/ssas-joining-issue-with-mdxing-of-m2m.html"&gt;&lt;span style="color: #888888;"&gt;part III&lt;/span&gt;&lt;/a&gt;).&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;Cascading parameters and M2M dimensions&amp;nbsp; (&lt;a href="http://bifuture.blogspot.com/2011/07/ssasssrs-cascading-parameters-in-ssrs.html"&gt;part IV&lt;/a&gt;) &lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;I've created the following example script:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="font-size: x-small;"&gt;USE [GraphProblem]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[FactTest]') AND type in (N'U'))&lt;br /&gt;DROP TABLE [dbo].[FactTest]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;CREATE TABLE [dbo].[FactTest](&lt;br /&gt;[FactTestID] [int] IDENTITY(1,1) NOT NULL,&lt;br /&gt;[FK_Date_Key] [int] NOT NULL,&lt;br /&gt;[FK_Location_Key] [int] NOT NULL,&lt;br /&gt;[FactTestCount] [int] NOT NULL&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;----&lt;br /&gt;IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DimLocation]') AND type in (N'U'))&lt;br /&gt;DROP TABLE [dbo].[DimLocation]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;CREATE TABLE [dbo].[DimLocation](&lt;br /&gt;[Location_Dim_key] [int] NOT NULL,&lt;br /&gt;[Location_Code] [int] NOT NULL,&lt;br /&gt;[Location_Description] [varchar](50) NOT NULL&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;----&lt;br /&gt;IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DimDepartment]') AND type in (N'U'))&lt;br /&gt;DROP TABLE [dbo].[DimDepartment]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;CREATE TABLE [dbo].[DimDepartment](&lt;br /&gt;[Department_Dim_key] [int] NOT NULL,&lt;br /&gt;[Department_Code] [int] NOT NULL,&lt;br /&gt;[Department_Description] [varchar](50) NOT NULL&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;---&lt;br /&gt;IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[BridgeLocationDepartment]') AND type in (N'U'))&lt;br /&gt;DROP TABLE [dbo].[BridgeLocationDepartment]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;CREATE TABLE [dbo].[BridgeLocationDepartment](&lt;br /&gt;[BridgeLocationDepartment_ID] [int] IDENTITY(1,1) NOT NULL,&lt;br /&gt;[FK_Location_Key] [int] NOT NULL,&lt;br /&gt;[FK_Department_Key] [int] NOT NULL,&lt;br /&gt;[Valid_From] [date] NOT NULL,&lt;br /&gt;[Valid_Until] [date] NOT NULL&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;---&lt;br /&gt;IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DimDate]') AND type in (N'U'))&lt;br /&gt;DROP TABLE [dbo].[DimDate]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;CREATE TABLE [dbo].[DimDate](&lt;br /&gt;[Date_dim_key] [int] NULL,&lt;br /&gt;[Date_Year] [int] NULL&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;---&lt;br /&gt;&lt;br /&gt;INSERT INTO dbo.DimDepartment (Department_Dim_key, Department_Code, Department_Description) &lt;br /&gt;VALUES &lt;br /&gt;(1, 1, 'Department A'),&lt;br /&gt;(2, 2, 'Department B'), &lt;br /&gt;(3, 3, 'Department C'), &lt;br /&gt;(4, 4, 'Department D'), &lt;br /&gt;(5, 5, 'Department E'),&lt;br /&gt;(6, 6, 'Department F'), &lt;br /&gt;(7, 7, 'Department G'), &lt;br /&gt;(8, 8, 'Department H'), &lt;br /&gt;(9, 9, 'Department I'), &lt;br /&gt;(10, 10, 'Department J') &lt;br /&gt;&lt;br /&gt;INSERT INTO dbo.DimLocation (Location_Dim_key, Location_Code, Location_Description) &lt;br /&gt;VALUES &lt;br /&gt;(1, 1, 'Location 1'),&lt;br /&gt;(2, 2, 'Location 2'), &lt;br /&gt;(3, 3, 'Location 3'), &lt;br /&gt;(4, 4, 'Location 4'), &lt;br /&gt;(5, 5, 'Location 5'), &lt;br /&gt;(6, 6, 'Location 6'), &lt;br /&gt;(7, 7, 'Location 7'),&lt;br /&gt;(8, 8, 'Location 8'),&lt;br /&gt;(9, 9, 'Location 9'),&lt;br /&gt;(10, 10, 'Location 10')&lt;br /&gt;&lt;br /&gt;INSERT INTO dbo.BridgeLocationDepartment (FK_Location_Key, FK_Department_Key, Valid_From, Valid_Until)&lt;br /&gt;VALUES &lt;br /&gt;(1, 1, '2011-01-01', '9999-12-31'), &lt;br /&gt;(2, 1, '2005-01-01', '9999-12-31'), &lt;br /&gt;(2, 2, '2005-01-01', '9999-12-31'),&lt;br /&gt;(3, 3, '2005-01-01', '9999-12-31'),&lt;br /&gt;(4, 3, '2005-01-01', '9999-12-31'),&lt;br /&gt;(4, 4, '2005-01-01', '9999-12-31'),&lt;br /&gt;(5, 5, '2005-01-01', '9999-12-31'),&lt;br /&gt;(5, 7, '2005-01-01', '9999-12-31'),&lt;br /&gt;(6, 6, '2005-01-01', '9999-12-31'),&lt;br /&gt;(6, 7, '2005-01-01', '9999-12-31'),&lt;br /&gt;(7, 7, '2005-01-01', '9999-12-31'),&lt;br /&gt;(8, 8, '2005-01-01', '9999-12-31'),&lt;br /&gt;(9, 9, '2005-01-01', '9999-12-31'),&lt;br /&gt;(9, 10, '2005-01-01', '9999-12-31'),&lt;br /&gt;(10, 10, '2005-01-01', '9999-12-31' )&lt;br /&gt;&lt;br /&gt;INSERT INTO dbo.DimDate&lt;br /&gt;VALUES (1,2000),&lt;br /&gt;(2, 2001),&lt;br /&gt;(3, 2002),&lt;br /&gt;(4, 2003),&lt;br /&gt;(5, 2004),&lt;br /&gt;(6, 2005),&lt;br /&gt;(7, 2006),&lt;br /&gt;(8, 2007),&lt;br /&gt;(9, 2008),&lt;br /&gt;(10, 2009),&lt;br /&gt;(11, 2010),&lt;br /&gt;(12, 2011),&lt;br /&gt;(13, 2012),&lt;br /&gt;(14, 2013),&lt;br /&gt;(15, 2014),&lt;br /&gt;(16, 2015)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;INSERT INTO [dbo].[FactTest]([FK_Date_Key],[FK_Location_Key],[FactTestCount])&lt;br /&gt;VALUES&lt;br /&gt;(7, 1, 1),(7, 2, 1),(8, 3, 1),(9, 3, 1),(9, 2, 1),(10, 4, 1),(10, 5, 1),(10, 5, 1),(11, 5, 1),(7, 7, 1),&lt;br /&gt;(9, 4, 1),(10, 3, 1),(11, 10, 1),(12, 6, 1),(10, 2, 1),(9, 9, 1),(8, 7, 1),(5, 7, 1),(6, 1, 1),(7, 5, 1),&lt;br /&gt;(8, 1, 1),(7, 1, 1),(7, 2, 1),(8, 3, 1),(9, 2, 1),(10, 4, 1),(10, 5, 1),(10, 5, 1),(7, 7, 1),(9, 4, 1),&lt;br /&gt;(10, 3, 1),(11, 10, 1),(10, 2, 1),(9, 9, 1),(8, 7, 1),(5, 7, 1),(6, 1, 1),(7, 5, 1),(8, 1, 1),(10, 5, 1),&lt;br /&gt;(7, 7, 1),(9, 4, 1),(10, 3, 1),(11, 10, 1),(10, 2, 1),(9, 9, 1),(8, 7, 1),(5, 7, 1),(6, 1, 1),(7, 5, 1),&lt;br /&gt;(8, 1, 1),(10, 5, 1),(10, 5, 1),(11, 5, 1),(7, 7, 1),(9, 4, 1),(10, 3, 1),(11, 10, 1),(12, 6, 1),(10, 2, 1),&lt;br /&gt;(9, 9, 1),(5, 7, 1),(6, 1, 1),(7, 5, 1),(8, 1, 1),(10, 5, 1),(10, 5, 1),(11, 5, 1),(8, 1, 1),(7, 1, 1),&lt;br /&gt;(7, 2, 1),(8, 3, 1),(9, 2, 1),(10, 4, 1),(10, 5, 1),(10, 5, 1),(10, 1, 1),(10, 2, 1),(10, 3, 1),(10, 7, 1),&lt;br /&gt;(10, 5, 1),(10, 9, 1),(10, 2, 1),(10, 1, 1),(10, 4, 1),(10, 4, 1),(10, 5, 1),(10, 9, 1),(10, 2, 1)&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Created a cube on the datastructure with following structure:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-qhFOkh5nOJY/ThoAkLGqDZI/AAAAAAAAAoc/RKskbX-EGlw/s1600/CubeGraphProblem.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="179" m$="true" src="http://1.bp.blogspot.com/-qhFOkh5nOJY/ThoAkLGqDZI/AAAAAAAAAoc/RKskbX-EGlw/s320/CubeGraphProblem.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The dimension usage tab:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-2bcTfTlwqhE/ThoAgoqdrVI/AAAAAAAAAoY/3mzqRqfGhnE/s1600/DimensionUsageGraphProblem.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="109" m$="true" src="http://1.bp.blogspot.com/-2bcTfTlwqhE/ThoAgoqdrVI/AAAAAAAAAoY/3mzqRqfGhnE/s320/DimensionUsageGraphProblem.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;And now take a look at the dimension browser tab:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-YVvm2GqbfEQ/ThoCWgm-w8I/AAAAAAAAAok/cksSrw4034Y/s1600/BrowserGraphPRoblem.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="301" m$="true" src="http://2.bp.blogspot.com/-YVvm2GqbfEQ/ThoCWgm-w8I/AAAAAAAAAok/cksSrw4034Y/s320/BrowserGraphPRoblem.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;So the values for 2009 seems an interesting candidate for simulating the situation. There are certain departments and locations which can be used for testing my graphproblem. I would like to focus on Department C (location 3 and 4) and department G (Location 5 and 7).&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The solution&lt;/b&gt;&lt;br /&gt;Now, let's build the report with a graph and a parameter "department". So when the department is selected i want to show the locations in highlighted manner. You can see this in the diagram in the introduction section. Initially, it would look something like this (the customer don't want the names of the locations shown):&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/--I3XhPHf1fE/TiAs3nkserI/AAAAAAAAApA/MO3vb4rd2zM/s1600/Locations+sorted.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/--I3XhPHf1fE/TiAs3nkserI/AAAAAAAAApA/MO3vb4rd2zM/s320/Locations+sorted.png" width="315" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/--hc8CQBJQRY/TiAmDN0WMhI/AAAAAAAAAoo/mHCOTYvBt5k/s1600/Locations+sorted.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;But the locations of department C is not red (the two 5's). It's not possible to do a lookup between two datasets in SQL Server 2008 (SQL Server 2008 R2 does have a lookup function). Therefore i decided to alter my MDX query and add an extra column indicating whether a location belongs to a selected department at the parameter. So i changed the standard MDX query to this:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;WITH MEMBER [Measures].[test]&lt;br /&gt;AS &lt;br /&gt;IIF(ISEMPTY((EXISTS([DimLocation].[LocationDescription].CURRENTMEMBER, {STRTOSET(@DimDepartmentDepartmentDescription, CONSTRAINED)}, "FactTest").item(0), [Measures].[FactTestCount])), 0, 1) &lt;br /&gt;&lt;br /&gt;SELECT {[Measures].[FactTestCount], [Measures].[test]} ON COLUMNS,&lt;br /&gt;[DimLocation].[LocationDescription].[LocationDescription] ON ROWS&lt;br /&gt;FROM (SELECT ( { [DimDate].[DateYear].&amp;amp;[2009] }) ON COLUMNS &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; FROM [GraphProblem])&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Resulting in (when testing with department C):&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-wyFFOXCdW4U/TiAtfSEfGiI/AAAAAAAAApI/KkLRvJj6vLI/s1600/MDX+query+returned.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-wyFFOXCdW4U/TiAtfSEfGiI/AAAAAAAAApI/KkLRvJj6vLI/s1600/MDX+query+returned.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/--Rafxjl69Mk/TiAqMGXbmzI/AAAAAAAAAos/48fkoKBYZ6g/s1600/MDX+query+returned.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;The most important section is the WITH section where IIF and EXISTS do some nifty work. The EXISTS function checks whether the set of locations are related to the set of departments (selected&amp;nbsp; with the parameter). The EXISTS returns a NULL when there is not a relation and a measure value&amp;nbsp; when there is a relation. So with the IIF and the ISEMPTY it's possible to return a 1 (for a relation) and 0 (for no relation)&lt;br /&gt;&lt;br /&gt;So now take a look in the report and select the series properties in the diagram and select the Fill tab:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-Dkoo6ltWJ40/TiArXwYtNaI/AAAAAAAAAow/aht0GY8_Rf0/s1600/reportfunction.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="227" src="http://4.bp.blogspot.com/-Dkoo6ltWJ40/TiArXwYtNaI/AAAAAAAAAow/aht0GY8_Rf0/s320/reportfunction.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The next thing is checking whether the test measure is 0 or 1 with : "=IIF(Fields!test.Value = 1, "Red", "Blue")". This looks great when i run the report. The locations belonging to department C is highlighted:&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-0ZJ1EetUBK0/TiAs3ZEH01I/AAAAAAAAAo8/IxKqmNAICT0/s1600/Department+C.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/-0ZJ1EetUBK0/TiAs3ZEH01I/AAAAAAAAAo8/IxKqmNAICT0/s320/Department+C.png" width="313" /&gt;&lt;/a&gt;&lt;/div&gt;When i choose department G the following diagram is shown:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-gUduVRYjAqs/TiAs4LqR2jI/AAAAAAAAApE/LWZurUxOxB0/s1600/Department+G.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/-gUduVRYjAqs/TiAs4LqR2jI/AAAAAAAAApE/LWZurUxOxB0/s320/Department+G.png" width="315" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;br /&gt;Initially, i wanted to solve this problem in the report but when i found out that SQL Server 2008 doesn't have a lookup function i needed to try other things. There are some solutions available on the internet about&amp;nbsp; building this with subreports or custom coding but the solution above is a better solution (in my opinion).&lt;br /&gt;&lt;br /&gt;Greetz,&lt;br /&gt;Hennie&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-3367966619496065982?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/3367966619496065982/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2011/07/ssasssrs-building-graph-for-analyzing.html#comment-form' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/3367966619496065982'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/3367966619496065982'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2011/07/ssasssrs-building-graph-for-analyzing.html' title='SSAS/SSRS : Building a graph for analyzing a subset related to the whole set'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-0ZJ1EetUBK0/TiAs3ZEH01I/AAAAAAAAAo8/IxKqmNAICT0/s72-c/Department+C.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-8932377499365218868</id><published>2011-07-09T11:19:00.004+02:00</published><updated>2011-07-12T09:45:00.880+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MDX'/><category scheme='http://www.blogger.com/atom/ns#' term='SSAS'/><category scheme='http://www.blogger.com/atom/ns#' term='SSRS'/><title type='text'>SSAS/SSRS/MDX : Cascading parameters and M2M dimensions</title><content type='html'>&lt;b&gt;Introduction &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Well, today a post about cascading parameters in Reporting Services (SSRS) in combination with MDX coding. Cascading parameters is about defining multiple parameters in such a way that a list of values of&amp;nbsp; a parameter depends on the values of another parameter. For this post i'll build upon my lab environment as described in my earlier posts:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;M&lt;span style="font-size: small;"&gt;odeling a N:M relation between dimensions (&lt;/span&gt;&lt;a href="http://bifuture.blogspot.com/2011/06/ssaskimball-modeling-nm-relation.html"&gt;part I&lt;/a&gt;&lt;span style="font-size: small;"&gt;)&lt;/span&gt;&lt;span style="font-size: small;"&gt;. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;Building a multivalue dimension construction in SSAS (&lt;/span&gt; &lt;a href="http://bifuture.blogspot.com/2011/06/ssaskimball-building-multivalue.html"&gt;part II&lt;/a&gt;).&lt;/li&gt;&lt;li&gt;Joining issue with MDXing of M2M dimension (&lt;a href="http://bifuture.blogspot.com/2011/07/ssas-joining-issue-with-mdxing-of-m2m.html"&gt;part III&lt;/a&gt;).&lt;/li&gt;&lt;/ul&gt;As a matter of fact, this post could be seen as a part IV in this list because the problem is also related with the M2M dimension construction. This is explained in my former post (&lt;a href="http://bifuture.blogspot.com/2011/07/ssas-joining-issue-with-mdxing-of-m2m.html"&gt;part III&lt;/a&gt;).&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;Scenario &lt;/b&gt;&lt;br /&gt;What i'll describe in this post is building a cascading parameter build upon two datasets: one for department and one for location. I've seen enough examples of building parameters on SQL queries but there are not that many examples based on MDX. As decribed in the&amp;nbsp;earlier posts (see above) i've the following situation:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Department A&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Location 1.&lt;/li&gt;&lt;li&gt;Location 2.&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Department B.&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Location 2.&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;Department C.&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Location 3.&lt;/li&gt;&lt;li&gt;Location 4. &lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;So, the cascading parameter should show location 1 and 2 when the first parameter is department A.&amp;nbsp; Again,&amp;nbsp; when department C is chosen the other parameter should be limited to location 3 and 4.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Building the report&amp;nbsp;&lt;/b&gt;&lt;br /&gt;First, let's setup the report in Reporting Services that returns a department, a location and a count field. I've created a datasource in SSRS, built a dataset and added the two parameters: Department and Location.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-J57AUB8-pak/ThaoO41DPvI/AAAAAAAAAoA/c_ipLCtn3EE/s1600/CascadingParametersDataset.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="203" src="http://4.bp.blogspot.com/-J57AUB8-pak/ThaoO41DPvI/AAAAAAAAAoA/c_ipLCtn3EE/s320/CascadingParametersDataset.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="font-family: inherit;"&gt;&lt;span style="font-size: small;"&gt;After I pressed OK and returned back to the report i noticed that there are a couple of extra (hidden) datasets created(DepartmentDepartmentDescription and LocationLocationDescription). Dataset1 is MDX query that should return data for the report.&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-ffFVf80Tx9M/Thao-cigpWI/AAAAAAAAAoE/6idR6Cl0AUw/s1600/CascadingParametersHiddenDatasets.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://2.bp.blogspot.com/-ffFVf80Tx9M/Thao-cigpWI/AAAAAAAAAoE/6idR6Cl0AUw/s320/CascadingParametersHiddenDatasets.png" width="221" /&gt;&lt;/a&gt;&lt;/div&gt;Let's try the report and check if the cascading parameter location is depending on the department parameter. Look at the diagram below and notice that all four locations are shown, even when i choosed a different departments.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-JTCewug-vR4/ThapcjMIigI/AAAAAAAAAoI/L103-sjhccA/s1600/1st+test+cascadingParameter.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="126" src="http://4.bp.blogspot.com/-JTCewug-vR4/ThapcjMIigI/AAAAAAAAAoI/L103-sjhccA/s320/1st+test+cascadingParameter.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Seems that we've to add some more magic to the report. Let's look at the parameter datasets in more detail. I've copied the MDX query of the department dataset below:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="font-size: x-small;"&gt;WITH &lt;br /&gt;MEMBER [Measures].[ParameterCaption] AS [Department].[Department Description].CURRENTMEMBER.MEMBER_CAPTION &lt;br /&gt;MEMBER [Measures].[ParameterValue] AS [Department].[Department Description].CURRENTMEMBER.UNIQUENAME &lt;br /&gt;MEMBER [Measures].[ParameterLevel] AS [Department].[Department Description].CURRENTMEMBER.LEVEL.ORDINAL &lt;br /&gt;SELECT {[Measures].[ParameterCaption], &lt;br /&gt;[Measures].[ParameterValue], &lt;br /&gt;[Measures].[ParameterLevel]} ON COLUMNS , &lt;br /&gt;[Department].[Department Description].ALLMEMBERS ON ROWS FROM [MultiValueDimension]&lt;/span&gt; &lt;/code&gt;&lt;br /&gt;&lt;br /&gt;No need for changes here. Let's take a look at the location dataset.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="font-size: x-small;"&gt;WITH&amp;nbsp;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="font-size: x-small;"&gt;MEMBER [Measures].[ParameterCaption] AS [Location].[Location Description].CURRENTMEMBER.MEMBER_CAPTION&amp;nbsp;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="font-size: x-small;"&gt;MEMBER [Measures].[ParameterValue] AS [Location].[Location Description].CURRENTMEMBER.UNIQUENAME&amp;nbsp;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="font-size: x-small;"&gt;MEMBER [Measures].[ParameterLevel] AS [Location].[Location Description].CURRENTMEMBER.LEVEL.ORDINAL&amp;nbsp;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="font-size: x-small;"&gt;SELECT {[Measures].[ParameterCaption],&amp;nbsp;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="font-size: x-small;"&gt;[Measures].[ParameterValue],&amp;nbsp;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="font-size: x-small;"&gt;[Measures].[ParameterLevel]} ON COLUMNS ,&amp;nbsp;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="font-size: x-small;"&gt;[Location].[Location Description].ALLMEMBERS ON ROWS&amp;nbsp;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="font-size: x-small;"&gt;FROM ( SELECT ( STRTOSET(@DepartmentDepartmentDescription, CONSTRAINED) ) ON COLUMNS&amp;nbsp;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM [MultiValueDimension]) &lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;The problem (as i described in my &lt;a href="http://bifuture.blogspot.com/2011/07/ssas-joining-issue-with-mdxing-of-m2m.html"&gt;former post&lt;/a&gt; about the showing the right location related at the right department) is that all locations are shown because the relation between location and department isn't enforced. So i need to change the query and two important changes are needed.&lt;br /&gt;&lt;br /&gt;First change the WITH part:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="font-size: x-small;"&gt;WITH&amp;nbsp;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="font-size: x-small;"&gt;MEMBER [Measures].[ParameterCaption] AS [Location].[Location Description].CURRENTMEMBER.MEMBER_CAPTION&amp;nbsp;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="font-size: x-small;"&gt;MEMBER [Measures].[ParameterValue] AS [Location].[Location Description].CURRENTMEMBER.UNIQUENAME&amp;nbsp;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="font-size: x-small;"&gt;MEMBER [Measures].[ParameterLevel] AS [Location].[Location Description].CURRENTMEMBER.LEVEL.ORDINAL &lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;into:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="font-size: x-small;"&gt;WITH &lt;br /&gt;MEMBER [Measures].[ParameterCaption] AS iif(IsEmpty([Measures].[Bridge Location Department Count]), null, [Location].[Location Description].CURRENTMEMBER.MEMBER_CAPTION) &lt;br /&gt;MEMBER [Measures].[ParameterValue] AS iif(IsEmpty([Measures].[Bridge Location Department Count]), null, [Location].[Location Description].CURRENTMEMBER.UNIQUENAME) &lt;br /&gt;MEMBER [Measures].[ParameterLevel] AS iif(IsEmpty([Measures].[Bridge Location Department Count]), null, [Location].[Location Description].CURRENTMEMBER.LEVEL.ORDINAL)&lt;/span&gt; &lt;/code&gt;&lt;br /&gt;&lt;br /&gt;This part is enforcing the member to NULL when the relation is&amp;nbsp;not there:&lt;br /&gt;&lt;br /&gt;and change:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="font-size: x-small;"&gt;[Location].[Location Description].ALLMEMBERS ON ROWS&amp;nbsp;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;into:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="font-size: x-small;"&gt;NONEMPTY([Location].[Location Description].ALLMEMBERS,[Measures].[Bridge Location Department Count])&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: x-small;"&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;This part is needed to suppress the NULLs but fon't forget to show all locations( for a specific department), even when there is no fact.This is important to notice because when i don't add this extra constraint location 4 isn't shown at Department C. This location doesn't have a factrecord stored.&lt;br /&gt;&lt;br /&gt;And the final solution is shown below:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;WITH &lt;br /&gt;MEMBER [Measures].[ParameterCaption] AS iif(IsEmpty([Measures].[Bridge Location Department Count]), null, [Location].[Location Description].CURRENTMEMBER.MEMBER_CAPTION) &lt;br /&gt;MEMBER [Measures].[ParameterValue] AS iif(IsEmpty([Measures].[Bridge Location Department Count]), null, [Location].[Location Description].CURRENTMEMBER.UNIQUENAME) &lt;br /&gt;MEMBER [Measures].[ParameterLevel] AS iif(IsEmpty([Measures].[Bridge Location Department Count]), null, [Location].[Location Description].CURRENTMEMBER.LEVEL.ORDINAL)&lt;br /&gt;SELECT {&lt;br /&gt;[Measures].[ParameterCaption],&lt;br /&gt;[Measures].[ParameterValue], &lt;br /&gt;[Measures].[ParameterLevel]} ON COLUMNS , &lt;br /&gt;NONEMPTY([Location].[Location Description].ALLMEMBERS,[Measures].[Bridge Location Department Count]) ON ROWS&lt;br /&gt;FROM (SELECT (STRTOSET(@DepartmentDepartmentDescription, CONSTRAINED) ON COLUMNS &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM [MultiValueDimension]))&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;The snippet '&lt;span style="font-family: Courier New; font-size: x-small;"&gt;FROM (SELECT (STRTOSET(@DepartmentDepartmentDescription, CONSTRAINED) ON COLUMNS&amp;nbsp;FROM [MultiValueDimension]))'&lt;/span&gt; will&amp;nbsp;change the location in a&amp;nbsp;cascading parameter.&lt;br /&gt;&lt;br /&gt;Now it's time to test this changed query. Starting up the report in preview mode is shown below (department A is showing the two locations 1 and 2):&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-WmYunD1lx5M/Tha01bgcrfI/AAAAAAAAAoM/A-1CJprJSpA/s1600/cascadingparameterStartPosition.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="127" src="http://4.bp.blogspot.com/-WmYunD1lx5M/Tha01bgcrfI/AAAAAAAAAoM/A-1CJprJSpA/s320/cascadingparameterStartPosition.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Let's try another department (department C shows location 3 and location 4):&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-lKNmtign9Bc/ThbPj-mVQ0I/AAAAAAAAAoU/wbEBUnCqWtg/s1600/cascadingparameterOtherDepartment.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="122" src="http://1.bp.blogspot.com/-lKNmtign9Bc/ThbPj-mVQ0I/AAAAAAAAAoU/wbEBUnCqWtg/s320/cascadingparameterOtherDepartment.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-kSW8B7p88kQ/Tha07SeqYLI/AAAAAAAAAoQ/xzC9ZAMvcB4/s1600/cascadingparameterOtherDepartment.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;br /&gt;Main 'problem' is the usage of the M2M dimension (Location 2 Department) that is actually a n:m relation. To enforce the relation you have to use the second parameter of the NONEMPTY() function. &lt;br /&gt;&lt;br /&gt;Greetz,&lt;br /&gt;Hennie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-8932377499365218868?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/8932377499365218868/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2011/07/ssasssrs-cascading-parameters-in-ssrs.html#comment-form' title='3 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/8932377499365218868'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/8932377499365218868'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2011/07/ssasssrs-cascading-parameters-in-ssrs.html' title='SSAS/SSRS/MDX : Cascading parameters and M2M dimensions'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-J57AUB8-pak/ThaoO41DPvI/AAAAAAAAAoA/c_ipLCtn3EE/s72-c/CascadingParametersDataset.png' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-3362343322566617013</id><published>2011-07-01T15:19:00.006+02:00</published><updated>2011-07-06T10:41:36.121+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MDX'/><category scheme='http://www.blogger.com/atom/ns#' term='SSAS'/><title type='text'>SSAS: Joining issue with MDXing of M2M dimension (part III)</title><content type='html'>Hi,&lt;br /&gt;&lt;br /&gt;At this moment i'm developing a M2M (or MM) dimension for locations and departments. If you haven't seen my former posts (&lt;a href="http://bifuture.blogspot.com/2011/06/ssaskimball-modeling-nm-relation.html"&gt;part I&lt;/a&gt;, &lt;a href="http://bifuture.blogspot.com/2011/06/ssaskimball-building-multivalue.html"&gt;part II&lt;/a&gt;) about this subject, i would recommend reading these posts. One issue i have with the M2M dimensions is getting the right information in the reports (who doesn't;-)) and it took me a while to understand how to handle this. The problem is how to show the locations which don't have a fact for a specific department.&lt;br /&gt;&lt;br /&gt;Okay, this is the situation: there are departments and locations and they are n:m related to each other. Therefore i've developed a bridge table for this purpose. In this bridge table i've added a count field. In contrast with my former post i've added an extra record for simulating the scenario i have. So the records in the different tables looks like this:&lt;br /&gt;&lt;br /&gt;Query :&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;SELECT&lt;br /&gt;Location_Description,&lt;br /&gt;Department_Description,&lt;br /&gt;DT.Date_Year,&lt;br /&gt;TestFactCount&lt;br /&gt;FROM dbo.Location L&lt;br /&gt;LEFT OUTER JOIN dbo.TestFact F ON L.Location_Dim_key = F.FK_Location_Key&lt;br /&gt;LEFT OUTER JOIN dbo.DimDate DT ON F.FK_Date_Key = DT.Date_dim_key&lt;br /&gt;INNER JOIN dbo.Bridge_Location_Department B ON B.FK_Location_Key = L.Location_Dim_key&lt;br /&gt;INNER JOIN dbo.Department D ON D.Department_Dim_key = B.FK_Department_Key&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Resulting in:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-JZwJfQ_U_Qg/ThQftGhWXyI/AAAAAAAAAno/CsdxmKiNf5s/s1600/Betterpicofdata.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="127" src="http://1.bp.blogspot.com/-JZwJfQ_U_Qg/ThQftGhWXyI/AAAAAAAAAno/CsdxmKiNf5s/s320/Betterpicofdata.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-0HdKKFEE8Ao/Tg2dWn6HUsI/AAAAAAAAAnY/oeUhfgKm66A/s1600/NONEMPTYbridge.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;So when the user selects department C two locations should be shown: location 3 and 4. Location 3 has factvalues and location 4 does not have any fact values.&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: inherit;"&gt;&lt;span style="font-size: small;"&gt;&lt;b&gt;Option 1&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: inherit;"&gt;&lt;span style="font-size: small;"&gt;Okay the first attempt for building a MDX&amp;nbsp;query for this is:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;code&gt;SELECT [Measures].[Test Fact Count] ON 0,&lt;br /&gt;[Location].[Location Description].[Location Description].MEMBERS ON 1&lt;br /&gt;FROM ( SELECT (STRTOSET('[Department].[Department Description].&amp;amp;[ Department C]', CONSTRAINED) ) ON COLUMNS &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM [MultiValueDimension])&lt;/code&gt;&lt;/span&gt; &lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-riWQ514he9Q/Tg2dXgHG_uI/AAAAAAAAAnk/YDT4ynGMY30/s1600/simplemdx.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-riWQ514he9Q/Tg2dXgHG_uI/AAAAAAAAAnk/YDT4ynGMY30/s1600/simplemdx.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;As you can see all locations are shown (even the one that has no relation with department C) . Not a desired situation &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Option 2:&lt;/b&gt;&lt;br /&gt;The next thing i tried is the following query:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;code&gt;SELECT [Measures].[Test Fact Count] ON 0,NONEMPTY([Location].[Location Description].[Location Description].MEMBERS) ON 1FROM&lt;br /&gt;( SELECT (STRTOSET('[Department].[Department Description].&amp;amp;[ Department C]', CONSTRAINED) ) ON COLUMNS FROM [MultiValueDimension]) &lt;/code&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Resulting in :&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-xPrYX3QBheQ/Tg2dXK-FgPI/AAAAAAAAAng/Rgk8xS04aPM/s1600/nonempty.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-xPrYX3QBheQ/Tg2dXK-FgPI/AAAAAAAAAng/Rgk8xS04aPM/s1600/nonempty.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Also not a desirable situation here...&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Option 3&lt;/b&gt;&lt;br /&gt;Someone on the MSDN forum pointed me to a extra parameter of the nonempty() function. The nonempty() function has the following syntax:&amp;nbsp; NONEMPTY(set_expression1 [,set_expression2]) and set_expression2 is a sort of limitation of the first set_expression. So the function returns a set of tuples that are not empty, based on the cross product of the second set.&lt;br /&gt;&lt;br /&gt;So the final solution for getting the right information is this:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="font-size: x-small;"&gt;SELECT [Measures].[Test Fact Count] ON 0,NONEMPTY([Location].[Location Description].[Location Description].MEMBERS, &lt;b&gt;[Measures].[Bridge Location Department Count]&lt;/b&gt;) ON 1FROM&lt;br /&gt;( SELECT (STRTOSET('[Department].[Department Description].&amp;amp;[ Department C]', CONSTRAINED) ) ON COLUMNS FROM [MultiValueDimension])&lt;/span&gt;&amp;nbsp;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;So i'm using the bridge count of the bridge table for getting the right information. When this value is nonempty it does show me the locations and facts that are related. With this MDX query i can produce the following information: &lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-mqzYv_uzRI8/Tg2dW3JaO1I/AAAAAAAAAnc/IfoV4ok1y2Q/s1600/nonemptyfinal.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-mqzYv_uzRI8/Tg2dW3JaO1I/AAAAAAAAAnc/IfoV4ok1y2Q/s1600/nonemptyfinal.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;br /&gt;With this solution you can simulate joining in SQL for getting the right information. &lt;br /&gt;&lt;br /&gt;Greetz,&lt;br /&gt;Hennie&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-3362343322566617013?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/3362343322566617013/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2011/07/ssas-joining-issue-with-mdxing-of-m2m.html#comment-form' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/3362343322566617013'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/3362343322566617013'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2011/07/ssas-joining-issue-with-mdxing-of-m2m.html' title='SSAS: Joining issue with MDXing of M2M dimension (part III)'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-JZwJfQ_U_Qg/ThQftGhWXyI/AAAAAAAAAno/CsdxmKiNf5s/s72-c/Betterpicofdata.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-173230020929367078</id><published>2011-06-23T09:14:00.002+02:00</published><updated>2011-06-30T13:34:30.265+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Kimball'/><category scheme='http://www.blogger.com/atom/ns#' term='SSAS'/><title type='text'>SSAS/Kimball : building a multivalue dimension construction in SSAS (part II)</title><content type='html'>In my &lt;a href="http://bifuture.blogspot.com/2011/06/ssaskimball-modeling-nm-relation.html"&gt;former post&lt;/a&gt; i'll already explained the background for this post. If you didn't read this than i would advice reading this first post before reading this article. In this article i'll explain about building a multivalue dimension in SSAS (MM dimension). This post covers the following subjects:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Prerequisites.&lt;/li&gt;&lt;li&gt;Building a cube.&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;/ul&gt;&lt;br /&gt;&lt;b&gt;Prerequisites&lt;/b&gt; &lt;br /&gt;Below you can see a script i've been using for building a cube. At the end of the script i've added a couple of facts/events.&amp;nbsp; So when we will quering this cube the following results should be shown for departments:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Department A : 3&lt;/li&gt;&lt;li&gt;Department B : 2&lt;/li&gt;&lt;li&gt;Department C : 2 &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;And for the locations:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Location 1 : 1&lt;/li&gt;&lt;li&gt;Location 2 : 2&lt;/li&gt;&lt;li&gt;Location 3 : 2&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;First create a database and execute the following script:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;IF&amp;nbsp; EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[TestFact]') AND type in (N'U'))&lt;br /&gt;DROP TABLE [dbo].[TestFact]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;CREATE TABLE [dbo].[TestFact](&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [TestFactID] [int] IDENTITY(1,1) NOT NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [FK_Date_Key] [int] NOT NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [FK_Location_Key] [int] NOT NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [TestFactCount] [int] NOT NULL&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;----&lt;br /&gt;IF&amp;nbsp; EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Location]') AND type in (N'U'))&lt;br /&gt;DROP TABLE [dbo].[Location]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;CREATE TABLE [dbo].[Location](&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Location_Dim_key] [int] NOT NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Location_Code] [int] NOT NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Location_Description] [varchar](50) NOT NULL&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;----&lt;br /&gt;IF&amp;nbsp; EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Department]') AND type in (N'U'))&lt;br /&gt;DROP TABLE [dbo].[Department]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;CREATE TABLE [dbo].[Department](&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Department_Dim_key] [int] NOT NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Department_Code] [int] NOT NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Department_Description] [varchar](50) NOT NULL&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;---&lt;br /&gt;IF&amp;nbsp; EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Bridge_Location_Department]') AND type in (N'U'))&lt;br /&gt;DROP TABLE [dbo].[Bridge_Location_Department]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;CREATE TABLE [dbo].[Bridge_Location_Department](&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: x-small;"&gt;Bridge_Location_Department_&lt;/span&gt;&lt;/code&gt;&lt;code&gt;&lt;span style="font-size: x-small;"&gt;ID] [int] IDENTITY(1,1) NOT NULL,&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [FK_Location_Key] [int] NOT NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [FK_Department_Key] [int] NOT NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Valid_From] [date] NOT NULL,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Valid_Until] [date] NOT NULL&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;---&lt;br /&gt;IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DimDate]') AND type in (N'U'))&lt;br /&gt;DROP TABLE [dbo].[DimDate]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;CREATE TABLE [dbo].[DimDate](&lt;br /&gt;[Date_dim_key] [int] NULL,&lt;br /&gt;[Date_Year] [int] NULL&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;---&lt;br /&gt;&lt;br /&gt;INSERT INTO dbo.Department (Department_Dim_key, Department_Code, Department_Description) &lt;br /&gt;VALUES (1, 1, ' Department A' ),(2, 2, ' Department B' ), (3, 3, ' Department C')&lt;br /&gt;&lt;br /&gt;INSERT INTO dbo.Location (Location_Dim_key, Location_Code, Location_Description) &lt;br /&gt;VALUES (1, 1, ' Location 1' ),(2, 2, ' Location 2' ), (3, 3, ' Location 3')&lt;br /&gt;&lt;br /&gt;INSERT INTO dbo.Bridge_Location_Department (FK_Location_Key, FK_Department_Key, Valid_From, Valid_Until)&lt;br /&gt;VALUES (1, 1, '2011-01-01', '9999-12-31' ), &lt;br /&gt;(2, 1, '2005-01-01', '9999-12-31' ), &lt;br /&gt;(2, 2, '2005-01-01', '9999-12-31' ),&lt;br /&gt;(3, 3, '2005-01-01', '9999-12-31' )&lt;br /&gt;&lt;br /&gt;INSERT INTO dbo.DimDate&lt;br /&gt;VALUES (1,2000),&lt;br /&gt;(2, 2001),&lt;br /&gt;(3, 2002),&lt;br /&gt;(4, 2003),&lt;br /&gt;(5, 2004),&lt;br /&gt;(6, 2005),&lt;br /&gt;(7, 2006),&lt;br /&gt;(8, 2007),&lt;br /&gt;(9, 2008),&lt;br /&gt;(10, 2009),&lt;br /&gt;(11, 2010),&lt;br /&gt;(12, 2011),&lt;br /&gt;(13, 2012),&lt;br /&gt;(14, 2013),&lt;br /&gt;(15, 2014),&lt;br /&gt;(16, 2015)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;INSERT INTO [MultiValueDimension].[dbo].[TestFact]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ([FK_Date_Key]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,[FK_Location_Key]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,[TestFactCount])&lt;br /&gt;VALUES&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (7, 1, 1),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (7, 2, 1),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (8, 3, 1),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (9, 3, 1),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (9, 2, 1)&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Building a cube&lt;/b&gt;&lt;br /&gt;Okay, now we have to build a cube based on the tables created in SQL Server. Kimball calls this a multivalue dimension (actually it's a variant on the multivaluedimension, in my opinion). Microsoft calls this a many-to-many dimension (MM). Marc Russo published a great &lt;a href="http://www.sqlbi.com/Default.aspx?tabid=80"&gt;whitepaper&lt;/a&gt; on this subject. Many-to-many dimension (MM) is a better name&amp;nbsp;for this subject. What can we say about Many-to Many dimension construction in relation to the case we are building:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;There are two measure groups needed.&lt;/li&gt;&lt;li&gt;There are two dimnsions needed.&lt;/li&gt;&lt;li&gt;The bridge Location Department table will be Intermediate Measure Group. The intermediate Measure Group is the measure group that relates the MM dimension to the regular dimension In this case it relates the location to the department dimension.&lt;/li&gt;&lt;li&gt;Location is the intermediate dimension.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-aQoYBmQcghg/TfTUQe8xILI/AAAAAAAAAmc/HMlnGuaVEJs/s1600/MM+dimension.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="282" src="http://1.bp.blogspot.com/-aQoYBmQcghg/TfTUQe8xILI/AAAAAAAAAmc/HMlnGuaVEJs/s320/MM+dimension.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Designing this in the cube designer shows this picture:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-zV5iJmPz_Vk/TfUDWNTfaiI/AAAAAAAAAmw/iDUrd9i9QkU/s1600/cbe+structure.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="166" src="http://4.bp.blogspot.com/-zV5iJmPz_Vk/TfUDWNTfaiI/AAAAAAAAAmw/iDUrd9i9QkU/s400/cbe+structure.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;So how does this looks in the dimension usage tab of the cube designer?&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-vIV9C1FnhAg/TfUAxStFXtI/AAAAAAAAAmg/8ERXvaKxvO8/s1600/Dimension+usage.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="106" src="http://3.bp.blogspot.com/-vIV9C1FnhAg/TfUAxStFXtI/AAAAAAAAAmg/8ERXvaKxvO8/s320/Dimension+usage.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;As said earlier in the post: location and department are the dimensions. Testfact and the bridge location department table are the measure groups. So when we check the results in the browser we see the following results for the locations:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-QdgP8QJX7NM/TfUBn7tcF6I/AAAAAAAAAmo/n0IZeo7dfT0/s1600/browserlocation.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="107" src="http://4.bp.blogspot.com/-QdgP8QJX7NM/TfUBn7tcF6I/AAAAAAAAAmo/n0IZeo7dfT0/s320/browserlocation.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;And for the departments:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-bSoadaRZVAg/TfUCynAkelI/AAAAAAAAAms/cBHk96sWJ3A/s1600/browser+department.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="98" src="http://2.bp.blogspot.com/-bSoadaRZVAg/TfUCynAkelI/AAAAAAAAAms/cBHk96sWJ3A/s320/browser+department.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;br /&gt;The total is still 5 but adding the departments subtotals manually is equal to 7!!!&lt;br /&gt;&lt;br /&gt;And this is as predicted at the beginning of this post. So we have reached nirvana. Well not quite yet. What about history?&amp;nbsp; What if a location do not exist anymore between departments and locations? What if locations shift from locations to other departments? You want to count your facts at right departments in a correct timeline! I'll blog&amp;nbsp;about this in the future.&lt;br /&gt;&lt;br /&gt;So, this is it for now.&lt;br /&gt;&lt;br /&gt;Greetz,&lt;br /&gt;Hennie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-173230020929367078?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/173230020929367078/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2011/06/ssaskimball-building-multivalue.html#comment-form' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/173230020929367078'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/173230020929367078'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2011/06/ssaskimball-building-multivalue.html' title='SSAS/Kimball : building a multivalue dimension construction in SSAS (part II)'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-aQoYBmQcghg/TfTUQe8xILI/AAAAAAAAAmc/HMlnGuaVEJs/s72-c/MM+dimension.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-1782419876462938540</id><published>2011-06-17T10:27:00.000+02:00</published><updated>2011-06-17T10:27:13.129+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSRS'/><title type='text'>SSRS : Setting up a A4 page in Reporting Services</title><content type='html'>Hi,&lt;br /&gt;&lt;br /&gt;I'm always a bit rusty when i start building reports in Reporting Services after a while. One thing i always has to figure out is how to set up the page size, body and margins.&amp;nbsp;In a article on &lt;a href="http://msdn.microsoft.com/en-us/library/bb677374.aspx"&gt;Microsoft&lt;/a&gt; you can find more information about this subjct. You can set the properties in the properties window or you can set the properties with report properties window (Menu -&amp;gt; Report -&amp;gt; Report properties). The relation between page, body, header and footer looks conceptual like the diagam below.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-U2rfe2vCsjw/TfjAVUi6SmI/AAAAAAAAAnA/-12fqbCwwNA/s1600/pageandBody+properties.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="297" src="http://4.bp.blogspot.com/-U2rfe2vCsjw/TfjAVUi6SmI/AAAAAAAAAnA/-12fqbCwwNA/s400/pageandBody+properties.png" t8="true" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Below you can see how i manually set the page size of the report with A4 paper settings.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-V204MVt7bEU/Tfhroq1udwI/AAAAAAAAAm0/cAEN4PZgSe4/s1600/page+size.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/-V204MVt7bEU/Tfhroq1udwI/AAAAAAAAAm0/cAEN4PZgSe4/s320/page+size.png" t8="true" width="283" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none;"&gt;&lt;br /&gt;And don't forget to set the body properties:&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-3SInldOBXGg/TfhrsJN2dSI/AAAAAAAAAm4/gCBAKcEeX8A/s1600/Body+property.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="218" src="http://4.bp.blogspot.com/-3SInldOBXGg/TfhrsJN2dSI/AAAAAAAAAm4/gCBAKcEeX8A/s320/Body+property.png" t8="true" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div align="left" class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;The formula of setting the PageSize Width, bodysize and margins is this: Page Width = Body Width+ Left margin + Right Margin. In my case 21= 19+1+1. &lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;In case of the height of the report you need to set the pagesize. In case of A4 : 29,7cm. In case of the body height you can set whatever you wan't. By setting the PageSize Height property the height of A4 is maintained and when the body height is larger than the pageSize (minus top margin and bottom margin) more pages are displayed/printed.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;It's also possible to set the properties with the report properties window. Below you can see an example in inches.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-icpax4ZjMZo/TfiJHE1JQ0I/AAAAAAAAAm8/bhGzVuX5YbU/s1600/report+properties.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="282" src="http://3.bp.blogspot.com/-icpax4ZjMZo/TfiJHE1JQ0I/AAAAAAAAAm8/bhGzVuX5YbU/s320/report+properties.png" t8="true" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;We end up with the follow values for the proprties:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-4N9XisVdQj0/TfjHD4jNWkI/AAAAAAAAAnE/7gIAlBJIJjM/s1600/pagebody+properties.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="280" src="http://3.bp.blogspot.com/-4N9XisVdQj0/TfjHD4jNWkI/AAAAAAAAAnE/7gIAlBJIJjM/s400/pagebody+properties.png" t8="true" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Greetz,&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Hennie&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-1782419876462938540?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/1782419876462938540/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2011/06/ssrs-setting-up-a4-page-in-reporting.html#comment-form' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/1782419876462938540'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/1782419876462938540'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2011/06/ssrs-setting-up-a4-page-in-reporting.html' title='SSRS : Setting up a A4 page in Reporting Services'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-U2rfe2vCsjw/TfjAVUi6SmI/AAAAAAAAAnA/-12fqbCwwNA/s72-c/pageandBody+properties.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-2596137396819914327</id><published>2011-06-14T16:57:00.001+02:00</published><updated>2011-06-14T16:59:33.459+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Kimball'/><category scheme='http://www.blogger.com/atom/ns#' term='SSAS'/><title type='text'>SSAS/KIMBALL: modeling a N:M relation between dimensions (part I)</title><content type='html'>Hi,&lt;br /&gt;&lt;br /&gt;During the development of a dashboard for a customer i've a awkward problem. The situation is like this: There are events in the every daily business (fact) and these events can happen on certain locations (physical) locations. These locations can be shared by different (logical) departments.&amp;nbsp; So conceptually you have something like this:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-Ob9lWtDcX3E/TfSKV7955kI/AAAAAAAAAmM/oV_nj8PqP_I/s1600/DepartmentLocation.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="121" src="http://2.bp.blogspot.com/-Ob9lWtDcX3E/TfSKV7955kI/AAAAAAAAAmM/oV_nj8PqP_I/s400/DepartmentLocation.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;And if you model this in a Bachman diagram (3NF) it will look like this:&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-T5NuzH53sAg/TfSMtsgoUgI/AAAAAAAAAmQ/40WWtO23vXw/s1600/nmrelation+3NF.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="139" src="http://3.bp.blogspot.com/-T5NuzH53sAg/TfSMtsgoUgI/AAAAAAAAAmQ/40WWtO23vXw/s320/nmrelation+3NF.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;So there are two standard entities and one associative entity has been added for handling the n:m relation. This way n:m relations can be easily modeled in 3NF. So the values for the department table will be :&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Department A&lt;/li&gt;&lt;li&gt;Department B&lt;/li&gt;&lt;li&gt;Department C&lt;/li&gt;&lt;/ol&gt;The values for the location table are:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Location 1&lt;/li&gt;&lt;li&gt;Location 2&lt;/li&gt;&lt;li&gt;Location 3&lt;/li&gt;&lt;/ol&gt;And the associative table "Department_Location" contains :&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;1 (Department A), 1 (Location 1)&lt;/li&gt;&lt;li&gt;1 (Department A), 2 (Location 2)&lt;/li&gt;&lt;li&gt;2 (Department B), 2 (Location 2)&lt;/li&gt;&lt;li&gt;3 (Department C), 3 (Location 3)&lt;/li&gt;&lt;/ol&gt;And you could introduce a valid_from and a valid_to (as in temporal modeling) where you can check the validity whenever the record is valid or not. Relations exists and can no longer exist at some point in time.&lt;br /&gt;&lt;br /&gt;A first assumption of me was modeling the location and the department seperately (the grain of the fact is at location level):&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-Rk-Hj4pPcsU/TfSVKqoeeGI/AAAAAAAAAmU/Nt_Z_E_T0oQ/s1600/Wrongmodel.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://1.bp.blogspot.com/-Rk-Hj4pPcsU/TfSVKqoeeGI/AAAAAAAAAmU/Nt_Z_E_T0oQ/s320/Wrongmodel.png" width="295" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;So the grain is at Location level and therefore a 'simple' dimension is enough. But the fact can happen at different departments (e.g. in case of location 1) and therefore i introduced a bridge table. So the key of the fact table is pushed to the bridge department table and the department dimension key is also pushed to the bidge department table. But wait a minute.....there is a drawback of this modeling solution. You can't see whether which location belongs to which department, unless a fact has happen. If a fact didn't happen you can't determine whether a location belongs to a department. So i needed a better solution than this.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The solution&lt;/b&gt; &lt;br /&gt;So studying kimball's book : "the datawarehouse lifecycle toolkit, second edition" shows me a example on page 270, paragraph "many-values dimensions with bridge tables". In this example a account dimension and Customer dimension is used with a bridge table. A weighting factor can help adding facts to the right customer. But i'm my situation i don't know how the facts are related to the department. Sometimes 99% of the facts belongs to the departments and sometimes less&amp;nbsp;facts and this is not sure.&amp;nbsp; So in my case a proper modeling solution is this :&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-Ipjr1Jocfj0/TfSaNpgyGZI/AAAAAAAAAmY/HBMUuxlx7Lo/s1600/right+model.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="315" src="http://1.bp.blogspot.com/-Ipjr1Jocfj0/TfSaNpgyGZI/AAAAAAAAAmY/HBMUuxlx7Lo/s320/right+model.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;In this case it's possible to determine which location belongs to which department.&lt;br /&gt;&lt;br /&gt;Kimball&amp;nbsp;recommends adding a valid_from and a valid_to column to the bridge table (as i already explained in the 3NF example) because a relation can exist at a certain point in time and they can no longer exist at some moment.&lt;br /&gt;&lt;br /&gt;Next time i'll explain how to build this in SSAS.&lt;br /&gt;&lt;br /&gt;Greetz,&lt;br /&gt;Hennie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-2596137396819914327?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/2596137396819914327/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2011/06/ssaskimball-modeling-nm-relation.html#comment-form' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/2596137396819914327'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/2596137396819914327'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2011/06/ssaskimball-modeling-nm-relation.html' title='SSAS/KIMBALL: modeling a N:M relation between dimensions (part I)'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-Ob9lWtDcX3E/TfSKV7955kI/AAAAAAAAAmM/oV_nj8PqP_I/s72-c/DepartmentLocation.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-5406208670768171529</id><published>2011-06-12T11:30:00.000+02:00</published><updated>2011-06-12T11:30:47.109+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSAS'/><title type='text'>SSAS: NON EMPTY and INNER/LEFT OUTER JOINing</title><content type='html'>Today a post about joining in SQL, the NON EMPTY operator and the nonempty() function in MDX. The origin of this blog started when a customer asked why some months on a graph didn't show up. So i started looking at the NON EMPTY operator and the NonEmpty() function.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Prerequisites&lt;/b&gt;&lt;br /&gt;At first i tried to create a representative query on AdventureWorks cube. When i finally succeeded i tried to buid a query in SQL and at first glance building the simple MDX query to SQL seems easy but i gave up on this and i decided to built my own lab environment. This confirmed my believe that MDX is a very powerful query language. Hard to understand but when you have mastered it you can create powerful reports. Here is the SQL script is used for this small experiment.&lt;br /&gt;&lt;br /&gt;1. Execute this script in SSMS:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;USE [NonEmpty]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DimDate]') AND type in (N'U'))&lt;br /&gt;DROP TABLE [dbo].[DimDate]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;CREATE TABLE [dbo].[DimDate](&lt;br /&gt;[Date_dim_key] [int] NULL,&lt;br /&gt;[Date_Year] [int] NULL&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;--TRUNCATE TABLE dbo.DimDate &lt;br /&gt;--GO&lt;br /&gt;&lt;br /&gt;INSERT INTO dbo.DimDate &lt;br /&gt;VALUES (1,2000),&lt;br /&gt;(2, 2001),&lt;br /&gt;(3, 2002),&lt;br /&gt;(4, 2003),&lt;br /&gt;(5, 2004),&lt;br /&gt;(6, 2005),&lt;br /&gt;(7, 2006),&lt;br /&gt;(8, 2007),&lt;br /&gt;(9, 2008),&lt;br /&gt;(10, 2009),&lt;br /&gt;(11, 2010),&lt;br /&gt;(12, 2011),&lt;br /&gt;(13, 2012),&lt;br /&gt;(14, 2013),&lt;br /&gt;(15, 2014),&lt;br /&gt;(16, 2015)&lt;br /&gt;&lt;br /&gt;------------------------------------------------------------------&lt;br /&gt;USE [NonEmpty]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[TestFact]') AND type in (N'U'))&lt;br /&gt;DROP TABLE [dbo].[TestFact]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;CREATE TABLE [dbo].[TestFact](&lt;br /&gt;[TestFact_ID] [int] identity (1,1) NOT NULL,&lt;br /&gt;[FK_Date_ID] [int] NULL,&lt;br /&gt;[TestFact_Count] [int] NULL&lt;br /&gt;) ON [PRIMARY]&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;INSERT INTO dbo.[TestFact] &lt;br /&gt;VALUES (1,1),&lt;br /&gt;(2, 1),&lt;br /&gt;(3, 1),&lt;br /&gt;(4, 1),&lt;br /&gt;(5, 1),&lt;br /&gt;(6, 1),&lt;br /&gt;(7, 1),&lt;br /&gt;(8, 1),&lt;br /&gt;(9, 1),&lt;br /&gt;(10, 1),&lt;br /&gt;--(11, 1),&lt;br /&gt;(12, 1),&lt;br /&gt;(13, 1),&lt;br /&gt;(14, 1),&lt;br /&gt;(15, 1),&lt;br /&gt;(16, 1)&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;2. Build a simple cube on these tables:&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-CbsIHtFCRBY/TevTCQ6pjWI/AAAAAAAAAls/FLQwLLXWlaY/s1600/NonEmptyCube.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="294" src="http://2.bp.blogspot.com/-CbsIHtFCRBY/TevTCQ6pjWI/AAAAAAAAAls/FLQwLLXWlaY/s320/NonEmptyCube.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;Experimenting with the SQL queries&lt;/b&gt;&lt;br /&gt;So when the customer was talking about the not showing some months on the x-axis of the graph i immediately realized it had something to do with LEFT and INNER joining problem (but in MDX).&lt;br /&gt;&lt;br /&gt;So here are some SQL joining queries:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;SELECT * &lt;br /&gt;FROM dbo.TestFact F&lt;br /&gt;INNER JOIN dbo.DimDate D ON F.FK_Date_ID = D.Date_dim_key&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-yOM-2ndg8mA/TevUnaVdgOI/AAAAAAAAAl0/MgxcPOC77RI/s1600/INNER+JOINGSQL.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-yOM-2ndg8mA/TevUnaVdgOI/AAAAAAAAAl0/MgxcPOC77RI/s1600/INNER+JOINGSQL.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;code&gt;&lt;br /&gt;SELECT * &lt;br /&gt;FROM dbo.DimDate D&lt;br /&gt;LEFT OUTER JOIN dbo.TestFact F ON F.FK_Date_ID = D.Date_dim_key&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-uP7MoPWw7eE/TevU29Vm0HI/AAAAAAAAAl4/Nj6JJmI15q8/s1600/LEFTJOININGSQL.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/-uP7MoPWw7eE/TevU29Vm0HI/AAAAAAAAAl4/Nj6JJmI15q8/s320/LEFTJOININGSQL.png" width="187" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;BUT i'm building reports on cubes and therefore i can't use SQL queries and therefore i need MDX queries that can handle LEFT joining.&lt;/div&gt;&lt;br /&gt;&lt;b&gt;MDX queries&lt;/b&gt;&lt;br /&gt;In MDX you have two options (as far is i know) for simulating INNER JOIN/LEFT/RIGHT FULL OUTER JOIN and that is the NON EMPTY keyword and the Nonempty() function. I'll show them both. First the simulation of the INNER JOIN in MDX:&lt;br /&gt;&lt;br /&gt;1) INNER JOIN with the NON EMPTY keyword:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;SELECT NON EMPTY {[DimDate].[DateYear].[DateYear]} ON ROWS,&lt;br /&gt;NON EMPTY {[Measures].[TestFactCount]} ON COLUMNS&lt;br /&gt;FROM [TestFact];&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-JzLuuQJDZdc/TfSE8ucsbhI/AAAAAAAAAl8/r3zxVCp7OIY/s1600/MDXMetNonempty.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-JzLuuQJDZdc/TfSE8ucsbhI/AAAAAAAAAl8/r3zxVCp7OIY/s1600/MDXMetNonempty.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-ZpxwfonnBG4/TfSE9IqYJ1I/AAAAAAAAAmA/qpAFnaDO_0A/s1600/MDXZonderNonempty.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt; &lt;/b&gt;&lt;br /&gt;&lt;b&gt; &lt;/b&gt;&lt;br /&gt;&lt;b&gt; &lt;/b&gt;2)  INNER JOIN with the NONEMPTY() function:&lt;br /&gt;&lt;b&gt; &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;SELECT NONEMPTY({[DimDate].[DateYear].[DateYear]}) ON ROWS,&lt;br /&gt;NONEMPTY([Measures].[TestFactCount]} ON COLUMNS&lt;br /&gt;FROM [TestFact];&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-JzLuuQJDZdc/TfSE8ucsbhI/AAAAAAAAAl8/r3zxVCp7OIY/s1600/MDXMetNonempty.png" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-JzLuuQJDZdc/TfSE8ucsbhI/AAAAAAAAAl8/r3zxVCp7OIY/s1600/MDXMetNonempty.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;3) LEFT OUTER JOIN with the NON EMPTY keyword&lt;br /&gt;&lt;br /&gt;&lt;code&gt;SELECT [DimDate].[DateYear].[DateYear] ON ROWS,&lt;br /&gt;NON EMPTY{[Measures].[TestFactCount]} ON COLUMNS&lt;br /&gt;FROM [TestFact]; &lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-XqeG6HYmMcY/TfSFSDN5TII/AAAAAAAAAmI/z9E2gZE6A-o/s1600/MDXZonderNonempty.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/-XqeG6HYmMcY/TfSFSDN5TII/AAAAAAAAAmI/z9E2gZE6A-o/s320/MDXZonderNonempty.png" width="127" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;4) LEFT OUTER JOIN with the NONEMPTY() function&lt;br /&gt;&lt;br /&gt;&lt;code&gt;SELECT [DimDate].[DateYear].[DateYear] ON ROWS,&lt;br /&gt;NONEMPTY({[Measures].[TestFactCount]}) ON COLUMNS&lt;br /&gt;FROM [TestFact] &lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-XqeG6HYmMcY/TfSFSDN5TII/AAAAAAAAAmI/z9E2gZE6A-o/s1600/MDXZonderNonempty.png" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/-XqeG6HYmMcY/TfSFSDN5TII/AAAAAAAAAmI/z9E2gZE6A-o/s320/MDXZonderNonempty.png" width="127" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;Conclusion:&lt;/b&gt;&lt;br /&gt;INNER/LEFT/RIGHT OUTER/FULL OUTER joining can be simulated in MDX with the NON EMPTY keyword and/or the NonEmpty Function.&lt;br /&gt;&lt;br /&gt;Greetz,&lt;br /&gt;Hennie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-5406208670768171529?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/5406208670768171529/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2011/06/ssas-non-empty-and-innerleft-outer.html#comment-form' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/5406208670768171529'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/5406208670768171529'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2011/06/ssas-non-empty-and-innerleft-outer.html' title='SSAS: NON EMPTY and INNER/LEFT OUTER JOINing'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-CbsIHtFCRBY/TevTCQ6pjWI/AAAAAAAAAls/FLQwLLXWlaY/s72-c/NonEmptyCube.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-1045224209972445041</id><published>2011-06-02T10:29:00.001+02:00</published><updated>2011-07-29T16:55:51.833+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Best practices'/><category scheme='http://www.blogger.com/atom/ns#' term='SQLServer'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>SQL Server Query best practices</title><content type='html'>&lt;div class="MsoNormal" style="font-family: inherit;"&gt;&lt;span style="font-size: small;"&gt;This post is one in a series of posts about SQL Server best practices. I've posted best practices about the following subjects, so far:&lt;/span&gt;&lt;/div&gt;&lt;ul style="font-family: inherit;"&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://bifuture.blogspot.com/2011/03/sql-server-general-best-practices.html"&gt;General best practices&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://bifuture.blogspot.com/2011/04/best-practices-sql-server-naming.html"&gt;Naming conventions&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://bifuture.blogspot.com/2011/03/sql-server-general-best-practices.html"&gt;Tables&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://bifuture.blogspot.com/2011/04/sql-server-column-best-practices.html"&gt;Columns&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://bifuture.blogspot.com/search/label/Best%20practices"&gt;Stored procedures&lt;/a&gt;.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://bifuture.blogspot.com/2011/05/sql-server-linked-server-best-practices.html"&gt;Linked servers&lt;/a&gt;.&lt;/li&gt;&lt;/ul&gt;&lt;div class="MsoNormal" style="font-family: inherit;"&gt;&lt;span style="font-size: small;"&gt;This post is about "query" best practices:&lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;I always write my SQL statements (SELECT, WHERE, etc) in upper case and fields and tables in according to the way they're created.&lt;/li&gt;&lt;li&gt;Write comments when something is not clear. This will aid other developers understanding your code.&lt;/li&gt;&lt;li&gt;Always write case consistent code. This will enhance transitions from&amp;nbsp;Case Insensitive (CI) server/database to&amp;nbsp;Case Sensitive (CS) server/database. &lt;/li&gt;&lt;li&gt;Don't use columnnumbers in ORDER BY. This will enhance readability.&lt;/li&gt;&lt;li&gt;Use ANSI joining (INNER, LEFT OUTER, RIGHT OUTER) in stead of old school&amp;nbsp;joining&amp;nbsp; (*=, =*,=).&lt;/li&gt;&lt;li&gt;Don't use SELECT * in queries. Always use columnnames in SELECT statements. This will improve Disk I/O and performance. Another advantage is that when you execute a SELECT INTO it is more error prone because when a column is added it doesn't effect the insert.&lt;/li&gt;&lt;li&gt;Don't use a % at start of a LIKE expression. This result in a index scan and the index is not fully used.&lt;/li&gt;&lt;li&gt;Use proper size for variables in queries. This will lower the change of SQL injection and will improve performance&lt;/li&gt;&lt;li&gt;Use WHERE whenever possible. This reduces the dataset.&lt;/li&gt;&lt;li&gt;Don't use the trick of TOP 100&amp;nbsp;PERCENT and ORDER BY in a view. This trick is not applicable in 2005 and 2008 (and further). e.g.&amp;nbsp;. CREATE VIEW xxx AS SELECT TOP (100) PERCENT ....&lt;br /&gt;&lt;div&gt;(...)&lt;/div&gt;&lt;div&gt;ORDER BY SortCol;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;Don't use NOLOCK hint. This is very important because it can cause datainconsistency like dirty reads, phantom reads and lost updates.&lt;/li&gt;&lt;li&gt;Use as many "derived tables" as you can. These are faster. For example:&lt;br /&gt;SELECT FROM &lt;br /&gt;(&lt;br /&gt;SELECT&amp;nbsp; &lt;br /&gt;FROM&amp;nbsp; &lt;br /&gt;) AS A&lt;/li&gt;&lt;li&gt;Limit the usage of scalar functions in SELECT statements. Never use a scalar function in a SELECT when a lot of rows are queried. Scalar functions acts as cursor when a lot of rowd are retrieved. Change the function into an inline view.&lt;/li&gt;&lt;li&gt;Use as less possible HINTS. HINTS prohibits the SQL engine using the automated optimization. At first it could be a performence improvement but when data grows it could be slower&lt;/li&gt;&lt;li&gt;Use as less possible negative operators like &amp;lt;&amp;gt;, NOT IN&amp;nbsp;and NOT EXISTS.&lt;/li&gt;&lt;/ul&gt;Greetz,&lt;br /&gt;Hennie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-1045224209972445041?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/1045224209972445041/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2011/06/sql-server-query-best-practices.html#comment-form' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/1045224209972445041'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/1045224209972445041'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2011/06/sql-server-query-best-practices.html' title='SQL Server Query best practices'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-9117189398868027559</id><published>2011-05-30T14:43:00.002+02:00</published><updated>2011-05-30T14:48:50.817+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Business Intelligence'/><title type='text'>Strategic, tactical and operational dashboards</title><content type='html'>In my &lt;a href="http://bifuture.blogspot.com/2011/05/what-kind-of-users-will-use-my.html"&gt;former post&lt;/a&gt; i already described the different needs of the different users of dashboards. For these users we can develop operational, tactical and strategic dashboards. Operational dashboards focusses on the operational users, tactical dashboards focusses on the tactical users and strategic dashboards focusses on the strategic users. Logical.&lt;br /&gt;&lt;br /&gt;In the book of Wayne Eckerson "&lt;a href="http://www.amazon.com/Performance-Dashboards-Measuring-Monitoring-Managing/dp/0471724173"&gt;Performance dashboards&lt;/a&gt;", Wayne speaks about building a management summary on a operational dashboard (for example) and that started me thinking. Isn't building a management summary on a operational dashboard a tactical dashboard (and building a&amp;nbsp;strategic dashboard on a tactical dashboard)? In an ideal world this would be true. Yes, operational, tactical and strategic dashboard should be in line which each other. KPI's needs to be operationalized to lower levels....or lower level indicators needs to be gathered and summarized to higher levels. Otherwise said: you have a top down approach or bottom up approach. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-yYI8sw4E3n0/TeESeyCEdyI/AAAAAAAAAlo/JghE8lG_Hd4/s1600/bottomup-topdown.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="199px" src="http://3.bp.blogspot.com/-yYI8sw4E3n0/TeESeyCEdyI/AAAAAAAAAlo/JghE8lG_Hd4/s320/bottomup-topdown.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;When applying the top down method, you'll be focussed on a balanced scorecard and strategymaps at strategic levels, the tactical dashboards metrics are derived from the KPI's and operational dashboard uses further detailed metrics. Off course it's also possible to use diagnostric metrics at the different levels.&lt;br /&gt;&lt;br /&gt;In case of a bottom up approach the relevant operational metrics are summarized to higher aggregated levels for tactical analysis and again tactical metrics are collected into KPI's at strategic levels. In my opinion, with the bottom up approach is difficult to build a aligned organization. The probability that all measures are available for building a higher level dashboard is small. So aligning the dashboards will always have some top down initiatives.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;br /&gt;In my opinion there is always a need in the bottom up approach&amp;nbsp;for top down initiatives because at some certain point&amp;nbsp;on a certain level more information is needed than is available. It's much harder building a dashboard with a bottom up method. To get an aligned organization the best way to start is building a strategic dashboard, initially. When this is succesful start implementing tactical and operational dashboards.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Hennie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-9117189398868027559?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/9117189398868027559/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2011/05/strategic-tactical-and-operational.html#comment-form' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/9117189398868027559'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/9117189398868027559'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2011/05/strategic-tactical-and-operational.html' title='Strategic, tactical and operational dashboards'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-yYI8sw4E3n0/TeESeyCEdyI/AAAAAAAAAlo/JghE8lG_Hd4/s72-c/bottomup-topdown.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-4621996396196919994</id><published>2011-05-26T11:35:00.009+02:00</published><updated>2011-05-26T12:35:44.234+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Business Intelligence'/><title type='text'>What kind of users will use a dashboard?</title><content type='html'>As you may know, i've to build a dashboard for a customer. The dashboard should be build for the board of the directors as well as for workers on the workfloor. Currently reading Wayne Eckerson's book : &lt;a href="http://www.amazon.com/Performance-Dashboards-Measuring-Monitoring-Managing/dp/0471724173"&gt;Performance dashboards&lt;/a&gt;&amp;nbsp;and it gives some insights&amp;nbsp;about building dashoards. The first thing i'm interested in is which information is presented to whom. Who are my users and what are their demends and wishes? How do handle information? How can a dashboard aid their work? A director has different needs than a professional worker. So these questions come to my mind regarding usage of dashboards.&lt;br /&gt;&lt;br /&gt;I think there are three different users of a dashboard:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;em&gt;&lt;strong&gt;Strategic users&lt;/strong&gt;&lt;/em&gt;: These are the board of directors, executives, high level managers, etc. These managers monitor execution of strategic objectives and are frequently involved implementing&amp;nbsp;a balanced scorecard. They will use the dashboard to align the organization with the business objectives. You can define this as a&amp;nbsp;top down&amp;nbsp;approach. The usage is more focussed on management. A list of typical usage is this:&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Scorecarding.&lt;/li&gt;&lt;li&gt;Monitoring&amp;nbsp;KPI's.&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;strong&gt;&lt;em&gt;Tactical users:&lt;/em&gt;&lt;/strong&gt; These are the departmental users like LOB managers, business analysts to compare performance of their areas or projects to budget plans, forecasts or last period's results. For example if a customer wants to monitor defects and the improvements of a machine they want to use a dashboard to display, monitor and analyze progress during the previous 12 months, for instance. The usage is oriented on analysis: &lt;i&gt;Why did this happen&lt;/i&gt;? A list of types of usage is this:&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Tracing trends in relation to company's goals and initiatives.&amp;nbsp;&lt;/li&gt;&lt;li&gt;Rootcause analysis.&lt;/li&gt;&lt;li&gt;Issues. &lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;strong&gt;&lt;em&gt;Operational users:&lt;/em&gt;&lt;/strong&gt; Operational&amp;nbsp;users are&amp;nbsp;frontline workers and managers who deal directly with cusomers or manages the production line. This information is lightly summarized. Operational users are more focussed on monitoring.&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Real time/right time information &lt;/li&gt;&lt;li&gt;Acting very quickly on information.&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;An interesting graph i found in a internet document from "&lt;a href="http://www.tagonline.org/files/Guide_to_Dashboard_Design.pdf"&gt;Juice : A Guide to Creating Dashboards People Love to Use&lt;/a&gt;". These suggests different graphs for different usage. &lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-crEo4BtYzAs/Tdu7mw7UchI/AAAAAAAAAlk/JaBfm2gb2pY/s1600/chart+suggestions.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="291px" src="http://1.bp.blogspot.com/-crEo4BtYzAs/Tdu7mw7UchI/AAAAAAAAAlk/JaBfm2gb2pY/s400/chart+suggestions.png" width="400px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;But there's nothing mentioned about a Gauge diagram, for example. So, the idea is great but i would like more information about which diagrams should you use in which situation.&lt;br /&gt;&lt;br /&gt;Greetz,&lt;br /&gt;Hennie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-4621996396196919994?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/4621996396196919994/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2011/05/what-kind-of-users-will-use-my.html#comment-form' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/4621996396196919994'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/4621996396196919994'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2011/05/what-kind-of-users-will-use-my.html' title='What kind of users will use a dashboard?'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-crEo4BtYzAs/Tdu7mw7UchI/AAAAAAAAAlk/JaBfm2gb2pY/s72-c/chart+suggestions.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-470645234321464505</id><published>2011-05-11T16:14:00.001+02:00</published><updated>2011-05-22T10:22:33.312+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSAS'/><title type='text'>SSAS : datatype struggling</title><content type='html'>&lt;div class="separator" style="clear: both; font-family: inherit; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: inherit; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: inherit; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: inherit; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: inherit; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: inherit; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: inherit; text-align: center;"&gt;&lt;/div&gt;&lt;div style="font-family: inherit;"&gt;&lt;span lang="EN-US" style="color: #333333; font-size: small;"&gt;I'm a bit struggling with SSAS and it's about a couple of measures with datatype 'bit' in my SQL Server fact table. At first i thought that i could add them up in SSAS with aggregatefunction 'sum'. Well, that doesn't seem the case here. An error occurred: "bit fields aren't additive". So then i changed the datatype to tinyint and when i processed the cube, the following error occured:&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: inherit;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: red; font-family: inherit;"&gt;&lt;span style="font-size: small;"&gt;&lt;i&gt;&lt;span lang="EN-US"&gt;"Errors in the metadata manager. The data type of the 'field' measure must be the same as its source data type. This is because the aggregate function is not set to count or distinct count "&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: inherit;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: inherit;"&gt;&lt;span style="font-size: small;"&gt;And i changed the datatype to tinyint and then i got really strange values like -93. Stange because&amp;nbsp;there were only 0 and 1 values in this field. Reading a blog of &lt;a href="http://geekswithblogs.net/darrengosbell/archive/2006/11/27/99190.aspx"&gt;Darren Gosbell&lt;/a&gt; tells me that the -93 is probably an overflow of the datatype. Then i changed the datatype to Integer and still i got errors like the one above (in red).&amp;nbsp; Then i noticed more properties : source.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-Yq_M2lAQGj0/TclUEdZJcgI/AAAAAAAAAlY/giGxMLXRS8A/s1600/image001.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="187px" src="http://1.bp.blogspot.com/-Yq_M2lAQGj0/TclUEdZJcgI/AAAAAAAAAlY/giGxMLXRS8A/s320/image001.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: inherit;"&gt;&lt;/div&gt;&lt;div style="font-family: inherit;"&gt;&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: inherit;"&gt;&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: inherit; text-align: left;"&gt;&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: inherit; text-align: left;"&gt;&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: inherit; text-align: left;"&gt;&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: inherit; text-align: left;"&gt;It seems there is another datatype property at a measure and it's defining the source attribute. When i changed that to integer i got the correct values. So there are four places where you can see and/or set datatypes:&lt;/div&gt;&lt;ol&gt;&lt;li&gt;SQL Server table.&lt;/li&gt;&lt;li&gt;Datasource view.&lt;/li&gt;&lt;li&gt;Measure.&lt;/li&gt;&lt;li&gt;Measure (Source group properties).&lt;/li&gt;&lt;/ol&gt;&lt;div class="separator" style="clear: both; font-family: inherit; text-align: left;"&gt;1 and 2 are quite obvious. Option 3 is also an option i do understand. You need to set a datatype in your cube when you roll up values from tinyint datatype to integer or perhaps to bigint. But the fourth option is less self explainable. So what is the role of this property group "source"? Is it a sort of CAST operation of the sourceattribute? Looking in on MSDN states that the source properties are describing the source of the measure. Litterally that doesn't seems to me a true statement because when i change the source attribute to the similar datatype in the dsv i got an error.&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: inherit; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: inherit; text-align: left;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: inherit; text-align: left;"&gt;Below you can read my steps to glory: &lt;/div&gt;&lt;ol&gt;&lt;li&gt;Change the field in the fact table to Tinyint&lt;/li&gt;&lt;li&gt;Change the aggregatefunction to sum.&lt;/li&gt;&lt;li&gt;Change the property datatype to integer&lt;/li&gt;&lt;li&gt;Change the property datatype of the grouped properties 'source' to integer &lt;/li&gt;&lt;/ol&gt;&lt;div class="separator" style="clear: both; font-family: inherit; text-align: left;"&gt;I've posted a question on the &lt;a href="http://social.technet.microsoft.com/Forums/en-US/sqlanalysisservices/thread/bcf52b65-4774-4f47-b383-246ad22b46e8"&gt;MS SSAS forum&lt;/a&gt; about this issue and when i got a satisfied answer i will post it here on my blog.&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: inherit; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: inherit; text-align: left;"&gt;Thnx,&lt;/div&gt;&lt;div class="separator" style="clear: both; font-family: inherit; text-align: left;"&gt;Hennie&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-470645234321464505?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/470645234321464505/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2011/05/ssas-datatype-struggling.html#comment-form' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/470645234321464505'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/470645234321464505'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2011/05/ssas-datatype-struggling.html' title='SSAS : datatype struggling'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-Yq_M2lAQGj0/TclUEdZJcgI/AAAAAAAAAlY/giGxMLXRS8A/s72-c/image001.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-545751820011621586</id><published>2011-05-10T09:18:00.003+02:00</published><updated>2011-07-29T16:57:45.800+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Best practices'/><category scheme='http://www.blogger.com/atom/ns#' term='SQLServer'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>SQL Server Linked Server best practices</title><content type='html'>&lt;div style="font-family: inherit;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: inherit;"&gt;&lt;span style="font-size: small;"&gt;This post is one in a series of posts about SQL Server best practices. I've posted best practices about the following subjects, so far:&lt;/span&gt;&lt;/div&gt;&lt;ul style="font-family: inherit;"&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://bifuture.blogspot.com/2011/03/sql-server-general-best-practices.html"&gt;General best practices&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://bifuture.blogspot.com/2011/04/best-practices-sql-server-naming.html"&gt;Naming conventions&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://bifuture.blogspot.com/2011/03/sql-server-general-best-practices.html"&gt;Tables&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://bifuture.blogspot.com/2011/04/sql-server-column-best-practices.html"&gt;Columns&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://bifuture.blogspot.com/search/label/Best%20practices"&gt;Stored procedures&lt;/a&gt;.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="MsoNormal" style="font-family: inherit;"&gt;&lt;span style="font-size: small;"&gt;This post is about linked servers. One note of appreciation for &lt;a href="http://blog.arjanfraaij.com/"&gt;Arjan&amp;nbsp; Fraaij&lt;/a&gt;, who is a major contributor to this post. One of the serverobjects is linkedserver and is used for using data from a another server or storing data to another server. There are also other options available, like SSIS and therefore it's good to make a list of pros and cons of linked server. So when do you use a linked server? The main reason is that you need the information from another server&lt;b&gt; immediately&lt;/b&gt; and in other cases i would suggest using SSIS.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;Below you can see diagram for a DTAP environment and databases A and B. On Server A a linked server is created to server B. This should be done in every environment : Development, Test, Acceptance and Production. It should not be allowed to create linked servers from a Test environment to a Acceptance environment.&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="font-family: inherit;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;span style="font-size: small;"&gt;&lt;a href="http://1.bp.blogspot.com/-_b6b5lkRXiI/TcjkU6uFgXI/AAAAAAAAAlU/LYsQpHCz-1s/s1600/Linkedserver+OTAPStraat.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="216px" src="http://1.bp.blogspot.com/-_b6b5lkRXiI/TcjkU6uFgXI/AAAAAAAAAlU/LYsQpHCz-1s/s400/Linkedserver+OTAPStraat.png" width="400px" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: inherit;"&gt;&lt;span style="font-size: small;"&gt;Here are the Linked Server best practices: &lt;/span&gt;&lt;/div&gt;&lt;ul style="font-family: inherit;"&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;Naamconvention according to CamelCase.&lt;/span&gt;&lt;span style="font-size: small;"&gt; &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;De namingconvention of a linked server is this::&amp;nbsp; ls&amp;lt;DatabaseName&amp;gt; &lt;/span&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;eg. lsDatabaseB.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;A linked server should be related to a database (and not a server)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;A linked server name has never a servername incorporated.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;A linked server should only be created based on integrated security.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;A linked server can only point to a database in the same environment.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size: small;"&gt;If used in your organization , use a C-Name. This will enhance more flexibility in case migration scenarios.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div style="font-family: inherit;"&gt;&lt;span style="font-size: small;"&gt;Greetz,&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: inherit;"&gt;&lt;span style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: inherit;"&gt;&lt;span style="font-size: small;"&gt;Hennie&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-545751820011621586?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/545751820011621586/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2011/05/sql-server-linked-server-best-practices.html#comment-form' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/545751820011621586'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/545751820011621586'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2011/05/sql-server-linked-server-best-practices.html' title='SQL Server Linked Server best practices'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-_b6b5lkRXiI/TcjkU6uFgXI/AAAAAAAAAlU/LYsQpHCz-1s/s72-c/Linkedserver+OTAPStraat.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-5304719561187450836</id><published>2011-05-06T12:16:00.002+02:00</published><updated>2011-05-06T13:43:43.530+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSRS'/><title type='text'>SSRS : Pareto analysis</title><content type='html'>Hi,&lt;br /&gt;&lt;br /&gt;A pareto chart (by Vilfredo Pareto) is a graphical way of highlighting the most important among (typically large) set of factors. This type of chart contains both bars and a line graph. The bars display the values in descending order, and the line graph&amp;nbsp; shows the cumulative totals (cumulative percentage) for each category, left to right. In my current project i''ve to analyze all kinds of events and i'm thinking about using a pareto analysis.&lt;br /&gt;&lt;br /&gt;I used a simple query from the SSRS recipes book and i started experimenting with this:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp;SELECT NON EMPTY { [Measures].[Internet Sales Amount] } ON COLUMNS, NON EMPTY { ([Sales Reason].[Sales Reason].[Sales Reason].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS FROM [Adventure Works] CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Drag a chart on the report and put the sales reasons on the category groups and internet sales amount in the details.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-UX2Y6l1FvSo/Tb2rqLmipGI/AAAAAAAAAlI/j0be2ckOsDI/s1600/SSRS+Pareto+analysis.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="159px" src="http://4.bp.blogspot.com/-UX2Y6l1FvSo/Tb2rqLmipGI/AAAAAAAAAlI/j0be2ckOsDI/s320/SSRS+Pareto+analysis.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Experimenting with the custom attributes of the columns (chart series, clicking on the histograms) like this (don't forget to set the ShowColumnAs property&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-hSzfyXnfdVo/Tb2s6ocQ1bI/AAAAAAAAAlM/r7avpnwrOao/s1600/custom+attributes.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="181px" src="http://2.bp.blogspot.com/-hSzfyXnfdVo/Tb2s6ocQ1bI/AAAAAAAAAlM/r7avpnwrOao/s320/custom+attributes.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Will show a pareto diagram :&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-qoYDXBFwpgw/Tb2tjPTmyNI/AAAAAAAAAlQ/AqJBuPPJRRE/s1600/Pareto+analysis+diagram.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="208px" src="http://3.bp.blogspot.com/-qoYDXBFwpgw/Tb2tjPTmyNI/AAAAAAAAAlQ/AqJBuPPJRRE/s320/Pareto+analysis+diagram.png" width="320px" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;br /&gt;At first i thought that the pareto was a separate diagram in the toolbox but it is not. So the most important thing to do is setting the custom properties in the chart series (click on the bars). One thing i have to find out is get a line on 80% for determining what categories are responsible for 80% of the sales.&lt;br /&gt;&lt;br /&gt;Greetz,&lt;br /&gt;Hennie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-5304719561187450836?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/5304719561187450836/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2011/05/ssrs-pareto-analysis.html#comment-form' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/5304719561187450836'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/5304719561187450836'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2011/05/ssrs-pareto-analysis.html' title='SSRS : Pareto analysis'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-UX2Y6l1FvSo/Tb2rqLmipGI/AAAAAAAAAlI/j0be2ckOsDI/s72-c/SSRS+Pareto+analysis.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-5192534930409390562</id><published>2011-05-03T11:12:00.000+02:00</published><updated>2011-05-03T11:12:52.745+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSRS'/><title type='text'>SSRS : Report parameters</title><content type='html'>Hi,&lt;br /&gt;&lt;br /&gt;Currently building a dashboard for a customer and i wanted to understand the concept of parameters a bit better. Especially in relation with MDX queries. Using parameters isn't complicated, but you need to understand them thoroughly when you're building more complex reports. So, lets understand the scope of this post: Parameters. Where do they all appear?&lt;br /&gt;&lt;br /&gt;1. Query designer parameters&lt;br /&gt;When you're designing your MDX query in the query designer it's possible to set whether or not you want a parameter.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-NAJB1TQuTjg/TbxMZmGlGMI/AAAAAAAAAj8/oLHitzomFVo/s1600/SSRS+1+-+parameters.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="201" src="http://3.bp.blogspot.com/-NAJB1TQuTjg/TbxMZmGlGMI/AAAAAAAAAj8/oLHitzomFVo/s400/SSRS+1+-+parameters.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;The MDX query is something like this:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-GKqth0kdAcY/TbxXmWBWBbI/AAAAAAAAAkA/xzQqlmVdSXM/s1600/parameters+MDX+query.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="32" src="http://4.bp.blogspot.com/-GKqth0kdAcY/TbxXmWBWBbI/AAAAAAAAAkA/xzQqlmVdSXM/s400/parameters+MDX+query.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;2. Dataset parameters&lt;br /&gt;The dataset is built on a query and is used by the report.&amp;nbsp; &lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-TUp2kMqalVQ/TbxZ6IBXjBI/AAAAAAAAAkE/lPiSSVMzEHw/s1600/reportparameters3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/-TUp2kMqalVQ/TbxZ6IBXjBI/AAAAAAAAAkE/lPiSSVMzEHw/s320/reportparameters3.png" width="310" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;3. Report parameters&lt;br /&gt;The report parameter is used for prompting to the user. The user can select a value and execute the report. &lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-SxeSw5SdQxQ/TbxZ6fwbmLI/AAAAAAAAAkI/5Hp1cTCLNkE/s1600/reportparameters.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="200" src="http://3.bp.blogspot.com/-SxeSw5SdQxQ/TbxZ6fwbmLI/AAAAAAAAAkI/5Hp1cTCLNkE/s320/reportparameters.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;So i decided to rename the parameter. The first thing i did is renaming the query parameter (@dateCalendarYear into @qryDateCalendarYear) and executing the query and the following error occurs&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-G2O6aazobO0/TbxbnbrrwzI/AAAAAAAAAkM/DQ8wk-ea9Ks/s1600/query+parameter+renaming.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="78" src="http://1.bp.blogspot.com/-G2O6aazobO0/TbxbnbrrwzI/AAAAAAAAAkM/DQ8wk-ea9Ks/s320/query+parameter+renaming.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;i&gt;Parser: The query contains the qryDateCalendarYear parameter, which is not declared. (msmgdsrv)&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Then i noticed there is a another window in the query designer where information about a parameter is stored.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-aiYEKvwqFNY/Tbxc72htJpI/AAAAAAAAAkQ/gVyWF0P1aeM/s1600/query+parameter+renaming2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="206" src="http://4.bp.blogspot.com/-aiYEKvwqFNY/Tbxc72htJpI/AAAAAAAAAkQ/gVyWF0P1aeM/s320/query+parameter+renaming2.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So i changed that from DateCalendarYear into qryDateCalendarYear.and now the query is executed.&amp;nbsp; When i take a look in the parameters window in the dataset properties window an&amp;nbsp; empty Parameter value is shown. So i choose the suggested option.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-36WBCR4W6Zg/TbxeI-IeqMI/AAAAAAAAAkY/860bAkeBJ4M/s1600/query+parameter+renaming3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://1.bp.blogspot.com/-36WBCR4W6Zg/TbxeI-IeqMI/AAAAAAAAAkY/860bAkeBJ4M/s320/query+parameter+renaming3.png" width="310" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Okay let's see whether the reports run and it does.....Now lets change the report parameter and see whether if the report still runs.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-Lm2pCKQanM4/Tbxe7FpSWZI/AAAAAAAAAkg/km9GBDETll8/s1600/query+parameter+renaming4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="261" src="http://4.bp.blogspot.com/-Lm2pCKQanM4/Tbxe7FpSWZI/AAAAAAAAAkg/km9GBDETll8/s320/query+parameter+renaming4.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-Gquuowe2c9U/Tbxevb9vx_I/AAAAAAAAAkc/t3isrWEHvZ8/s1600/query+parameter+renaming4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;An error occurs.....&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-sibYmu0Z1_I/TbxfPJbUOVI/AAAAAAAAAkk/p7-f3ZQPSBU/s1600/report+parameter+renaming+error.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="51" src="http://2.bp.blogspot.com/-sibYmu0Z1_I/TbxfPJbUOVI/AAAAAAAAAkk/p7-f3ZQPSBU/s640/report+parameter+renaming+error.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;So let's go the dataset properties window and that indicates that there is a mismatch between the parameter name and parametervalue.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-TQbMKR2nAfY/Tbxf4jFW_MI/AAAAAAAAAko/rMlrZSVrt1I/s1600/report+parameter+renaming5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://2.bp.blogspot.com/-TQbMKR2nAfY/Tbxf4jFW_MI/AAAAAAAAAko/rMlrZSVrt1I/s320/report+parameter+renaming5.png" width="310" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Correcting this will let the report run.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;br /&gt;So renaming the different parameters needs some different adjustments. There are four places where you can change something regarding parameters:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Query designer&lt;/li&gt;&lt;li&gt;Parameter window in the query desgner window&lt;/li&gt;&lt;li&gt;Parameters at the dataset properties window&amp;nbsp;&lt;/li&gt;&lt;li&gt;Report parameters in the main report development window.&lt;/li&gt;&lt;/ul&gt;It's a bit confusing that the parameter name and parameter value ara actually both parameter names (and not values). One is the report parameter name and the other is the query parameter name.&lt;br /&gt;&lt;br /&gt;So that's it for now.&lt;br /&gt;&lt;br /&gt;Greetz,&lt;br /&gt;&lt;br /&gt;Hennie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-5192534930409390562?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/5192534930409390562/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2011/05/ssrs-report-parameters.html#comment-form' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/5192534930409390562'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/5192534930409390562'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2011/05/ssrs-report-parameters.html' title='SSRS : Report parameters'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-NAJB1TQuTjg/TbxMZmGlGMI/AAAAAAAAAj8/oLHitzomFVo/s72-c/SSRS+1+-+parameters.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-6004585782212385289</id><published>2011-05-01T18:49:00.002+02:00</published><updated>2011-05-01T19:01:08.326+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSRS'/><title type='text'>SSRS : experimenting with sparklines</title><content type='html'>Hi,&lt;br /&gt;&lt;br /&gt;Today a post about sparklines in SQL Server Reporting Services. As reading in the book ""SSRS recipes" from Paul Turley and Robert Bruckner, sparklines are invented by &lt;a href="http://www.edwardtufte.com/tufte/"&gt;Edward Tufte&lt;/a&gt;. Sparklines are "small word sized graphics that are embedded in a context of words, numbers and images". I used the following query to experiment with. You can download this from the WROX site.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;SELECT&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUM(t.ExtendedAmountSum) AS ExtendedAmountSum&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; , t.EnglishProductCategoryName&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; , t.CalendarYear&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; , t.MonthNumberOfYear&lt;br /&gt;FROM&lt;br /&gt;(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; SUM(FactInternetSales.ExtendedAmount) AS ExtendedAmountSum&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; , DimProductCategory.EnglishProductCategoryName&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; , DimDate.CalendarYear&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; , DimDate.MonthNumberOfYear&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; FactInternetSales &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; INNER JOIN&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; DimProduct ON FactInternetSales.ProductKey = DimProduct.ProductKey &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; INNER JOIN&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; DimProductSubcategory ON DimProduct.ProductSubcategoryKey = DimProductSubcategory.ProductSubcategoryKey &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; INNER JOIN&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; DimProductCategory ON DimProductSubcategory.ProductCategoryKey = DimProductCategory.ProductCategoryKey &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; INNER JOIN&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; DimDate ON FactInternetSales.OrderDateKey = DimDate.DateKey&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GROUP BY&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; DimProductCategory.EnglishProductCategoryName&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; , DimDate.CalendarYear&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; , DimDate.MonthNumberOfYear&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; UNION ALL&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; SUM(FactResellerSales.ExtendedAmount) AS ExtendedAmountSum&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; , DimProductCategory.EnglishProductCategoryName&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; , DimDate.CalendarYear&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; , DimDate.MonthNumberOfYear&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; FactResellerSales &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; INNER JOIN&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; DimProduct ON FactResellerSales.ProductKey = DimProduct.ProductKey &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; INNER JOIN&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; DimProductSubcategory ON DimProduct.ProductSubcategoryKey = DimProductSubcategory.ProductSubcategoryKey &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; INNER JOIN&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; DimProductCategory ON DimProductSubcategory.ProductCategoryKey = DimProductCategory.ProductCategoryKey &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; INNER JOIN&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; DimDate ON FactResellerSales.OrderDateKey = DimDate.DateKey&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; GROUP BY&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; DimProductCategory.EnglishProductCategoryName&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; , DimDate.CalendarYear&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; , DimDate.MonthNumberOfYear&lt;br /&gt;) t&lt;br /&gt;GROUP BY&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; t.EnglishProductCategoryName&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; , t.CalendarYear&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; , t.MonthNumberOfYear&lt;br /&gt;ORDER BY&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CalendarYear, EnglishProductCategoryName&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1. And i started building the following report. Insert a table into the report body and delete the original row group and associated rows. Drag the calendar year and english productcategory into the row groups window. Drag the field extendedAmountSum on the data fields region. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.blogger.com/goog_1155599901" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="211" src="http://3.bp.blogspot.com/-vn8yNs2X6IU/Tb0PUoD1rKI/AAAAAAAAAkw/Qj1TYLC3qbQ/s320/startpoint+report.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.blogger.com/goog_1155599901" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Running the report will show this:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-Jp21IU_CL0o/Tb0PUNGgtwI/AAAAAAAAAks/w8nsvUc6JQI/s1600/startpoint+report2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="319" src="http://3.bp.blogspot.com/-Jp21IU_CL0o/Tb0PUNGgtwI/AAAAAAAAAks/w8nsvUc6JQI/s320/startpoint+report2.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Now drag a sparklines component from the toolbox on the report body. Setup the fields calendaryears and the Salesamount for the sparklines.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-24CZneKUjAE/Tb2OSeCLQYI/AAAAAAAAAlE/obZJm5MevtM/s1600/sparklines+report+opties.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="287" src="http://3.bp.blogspot.com/-24CZneKUjAE/Tb2OSeCLQYI/AAAAAAAAAlE/obZJm5MevtM/s320/sparklines+report+opties.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;And drag the sparkline into the tabel and run the report and you will get something like this:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-2HeZUqZAMa0/Tb2KDdcNT_I/AAAAAAAAAk0/GDhe46w0uqI/s1600/sparklines+report.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="279" src="http://1.bp.blogspot.com/-2HeZUqZAMa0/Tb2KDdcNT_I/AAAAAAAAAk0/GDhe46w0uqI/s320/sparklines+report.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;If you change the sparkline type to "smooth area" and you get this: &lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-UDkL8uOvKt4/Tb2KvZHVQ1I/AAAAAAAAAk4/8BxZq3Snz3I/s1600/sparklines+report2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="279" src="http://1.bp.blogspot.com/-UDkL8uOvKt4/Tb2KvZHVQ1I/AAAAAAAAAk4/8BxZq3Snz3I/s320/sparklines+report2.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-_l81ay07yNQ/Tb2L1_HVuQI/AAAAAAAAAk8/TqpIeiqTv4s/s1600/pie++report2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&amp;nbsp;Change the chart type to pie and you get this:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-_l81ay07yNQ/Tb2L1_HVuQI/AAAAAAAAAk8/TqpIeiqTv4s/s1600/pie++report2.png" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="281" src="http://2.bp.blogspot.com/-_l81ay07yNQ/Tb2L1_HVuQI/AAAAAAAAAk8/TqpIeiqTv4s/s320/pie++report2.png" width="320" /&gt;&lt;/a&gt; &lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;I've some difficulty understanding what's length of the period of a sparkline. With a marker points you get a marker for every row for&amp;nbsp; grouped records. For instance for 2005 and accessoires there are 6 months, 6 records and 6 markerpoints. Playing with background colors and markerpoints and you get this:&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-ZEyYL9K9fek/Tb2NmrExoaI/AAAAAAAAAlA/lfPJ0jMnJis/s1600/sparklines+report+markerpoints.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="278" src="http://2.bp.blogspot.com/-ZEyYL9K9fek/Tb2NmrExoaI/AAAAAAAAAlA/lfPJ0jMnJis/s320/sparklines+report+markerpoints.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;So that's it with playing with sparklines.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Greetz,&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Hennie&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-6004585782212385289?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/6004585782212385289/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2011/05/ssrs-experimenting-with-sparklines.html#comment-form' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/6004585782212385289'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/6004585782212385289'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2011/05/ssrs-experimenting-with-sparklines.html' title='SSRS : experimenting with sparklines'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-vn8yNs2X6IU/Tb0PUoD1rKI/AAAAAAAAAkw/Qj1TYLC3qbQ/s72-c/startpoint+report.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-2105484027677958114</id><published>2011-04-30T12:10:00.002+02:00</published><updated>2011-07-29T16:58:25.784+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Best practices'/><category scheme='http://www.blogger.com/atom/ns#' term='SQLServer'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>SQL Server stored procedures best practices</title><content type='html'>Today a post about SQL Server naming conventions. I've gathered these naming conventions in the last couple of years and i've implemented them at projects at my customers. This is the fourth post in a serie of best practice posts (&lt;a href="http://bifuture.blogspot.com/2011/03/sql-server-general-best-practices.html"&gt;part I&lt;/a&gt;, &lt;a href="http://bifuture.blogspot.com/2011/03/sql-server-general-best-practices-part.html"&gt;part II&lt;/a&gt;, &lt;a href="http://bifuture.blogspot.com/2011/04/sql-server-column-best-practices.html"&gt;part III&lt;/a&gt;&amp;nbsp;and &lt;a href="http://bifuture.blogspot.com/2011/04/best-practices-sql-server-naming.html"&gt;part IV&lt;/a&gt;&amp;nbsp;). As said, this post is about naming conventions and these naming conventions can be subdivided in server objects-, database objects- and T-SQL naming conventions. &lt;br /&gt;&lt;ul&gt;&lt;li&gt;Naamconvention&amp;nbsp;according to&amp;nbsp;Camel Casing.&lt;/li&gt;&lt;li&gt;Never prefix&amp;nbsp;a stored procedure&amp;nbsp;with sp_.&lt;/li&gt;&lt;li&gt;Think about schemas when you're using a lot prefixing in the names of stored stored procedures.&lt;/li&gt;&lt;li&gt;Create stored procedures in the database where they're used.&lt;/li&gt;&lt;li&gt;Stored procedures that are used in OLEDB Sources has the following conventions usp&amp;lt;manipulation&amp;gt;_&amp;lt;name&amp;gt;.&lt;/li&gt;&lt;li&gt;Use 'par' as a prefix for parameter variables (eg @intParTableName). This will help reading stored procedures and it distinguishes SP variables and parameter variables.&lt;/li&gt;&lt;li&gt;Write comment if something is not quite clear. Length of comment doesn't effect performance.&lt;/li&gt;&lt;li&gt;Always write case consistent names in your code. Meaning that when you move your code from Case insensitive database to a case sensitive database it will still work.&lt;/li&gt;&lt;li&gt;Add a debug parameter to a stored procedure. This could be a bit type. When you pass a 1 all SQL statements are printed and nothing is executed. This way you can debug your stored procedure and it's even more helpfull when you're using dynaminc SQL.&lt;/li&gt;&lt;li&gt;If you're using multiple times a function in a stored procedure, store the result once in a variable and use this variable instead.&lt;/li&gt;&lt;li&gt;Make sure that&amp;nbsp; a stored procedure always return a returnvalue. Return values are standardized and are used for returning the status of the execution of a stored procedure. Use the OUTPUT parameter for returning data.&lt;/li&gt;&lt;li&gt;Use SET NOCOUNT ON at the beginning of a stored procedure (and triggers) as will messsage be suppressed, like&amp;nbsp;&amp;nbsp;'(1 row(s) affected)' . this enhance performance and reduces netwerktraffic&lt;/li&gt;&lt;li&gt;Use a less possible SET statements because they can issue a recompilation of the stored procedure.&lt;/li&gt;&lt;li&gt;Use a proper length of input parameter variable. Using a to large input parameter variable can cause SQL injection and it reduces memory usage.&lt;/li&gt;&lt;li&gt;don't use WITH RECOMPILE with your stored procedures&lt;/li&gt;&lt;li&gt;Keep your stored procedures short. Break long stored procedures in smaller stored procedures.&lt;/li&gt;&lt;li&gt;Use as less possible "WITH ENCRYPTION". Only use this when end users have access to the database and/or when you're using source control software.&lt;/li&gt;&lt;/ul&gt;Greetz,&lt;br /&gt;Hennie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5650243067310933543-2105484027677958114?l=bifuture.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bifuture.blogspot.com/feeds/2105484027677958114/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://bifuture.blogspot.com/2011/04/sql-server-stored-procedures-best.html#comment-form' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/2105484027677958114'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5650243067310933543/posts/default/2105484027677958114'/><link rel='alternate' type='text/html' href='http://bifuture.blogspot.com/2011/04/sql-server-stored-procedures-best.html' title='SQL Server stored procedures best practices'/><author><name>Hennie</name><uri>http://www.blogger.com/profile/04946694074745643589</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-F70Yky42vcU/TlJYwg-63hI/AAAAAAAAAy8/cYaFI88M-80/s220/186%2Bvoor%2BSocial%2BMedia%2BClose-up.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5650243067310933543.post-8510816179781831131</id><published>2011-04-23T07:23:00.000+02:00</published><updated>2011-04-23T07:23:06.163+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSAS'/><title type='text'>SSAS : Connecting to a cube with excel</title><content type='html'>Hi,&lt;br /&gt;&lt;br /&gt;For one of my clients i'm building a cube for analysis of&amp;nbsp; information. An interesting project because the data is never analyzed before. The situation is as follows; there are datasources which has been developed in the last couple of years and there is data gathered in earlier OLAP development projects. The trick is to combine these measures into an analysis tool with a cube, reporting services and (off course) excel.&lt;br /&gt;&lt;br /&gt;This blog is about how to connect to an analysis cube with Excel.&amp;nbsp;I'm not talking about building a cube but on how to connect to the cube with Excel.&lt;br /&gt;&lt;br /&gt;When to choose for a cube:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;A technical reason : performance. The performance of aggregated data is very well certainly in case of huge amounts of data.&amp;nbsp;&lt;/li&gt;&lt;li&gt;Pivoting possiblility. In my opinion a very handy functionality of cubes. The flexibility of dynamically playing with data is very handy for getting insight in your data.&lt;/li&gt;&lt;li&gt;Seamless integration with Excel. The integration with excel is great.&lt;/li&gt;&lt;li&gt;Prototyping. Certainly in combination with excel you can let the key users play with the data to get some insights, thoughts and ideas. When ideas have come to mind, you can build the reports and dashboard on it.&lt;/li&gt;&lt;/ul&gt;Okay lets start building an Excel sheet based on a cube. If reporting accesses to cubes can be provided from Microsoft Excel, then report building can be performed by an end user. Majority of the time, using this method, users can construct reports the way they wish. Improvements in Excel 2007 have p
