The WorkerThread Blog

we know stuff so you don't have to

SQL Server 2012 – Fixing Up Post-Patch Issues

Posted by workerthread on October 11, 2012

I have an “all in one” virtual machine for demonstrating the Business Intelligence features of SQL Server 2012 in combination with SharePoint 2010.   My VM is based on the “Kiwi Build” setup documented in the TechNet Wiki article here (although mine is using VMWare Workstation instead of Hyper-V).  As well as all varieties of Analysis Services (Tabular, MultiDimensional, PowerPivot) my VM also runs SharePoint, Master Data Services and Data Quality Services.

Since the initial release of SQL Server 2012, there have so far been three Cumulative Updates and this week a very large security update.  I generally check these patches out using my VM and each time I’ve come across specific post-patch issues which need to be addressed.  I thought it would be worth sharing these here, both for my own future reference and hopefully to assist others.   Note that these issues are my experience on my VM – you may encounter very different problems when you apply the patches, most of which are caused by the updated assembly versions that the patch installed – I probably can’t help you with those.

So this week, as usual, I first took a snapshot of the VM, then applied the security update. This installed without problem and I could see following the update that all of the expected SQL Server services were running as was SharePoint Server.   The post-patch fixing up is only needed once you start using the various SQL Server services -

PowerPivot Service in SharePoint

First I went to a PowerPivot Gallery in SharePoint, opened a workbook to display a pivot table with slicers.   When I clicked on a slicer to filter the data, I immediately got a message saying “an error occurred during an attempt to establish a connection to the external data source” -

PowerPivotError

To fix this and get PowerPivot working again, you need to re-run the PowerPivot Configuration Tool.   When this loads it checks the current farm status and in my case returned the following message telling me “newer versions of the PowerPivot solution files have been detected” -

PowerPivotConfigMsg

And as you can see, the “Upgrade” option is already selected -

PowerPivotConfigTool

I did as I was told, ran the “upgrade features” option and once this completed, the error message had gone from SharePoint and I could once again use my published PowerPivot models.

Data Quality Services

Next I opened the Data Quality Services Client and attempted to make a connection to the server.  I got a very verbose error message essentially telling me “an error occurred in the Microsoft .NET Framework while trying to load assembly id 65627” -

DQSError

A quick online search led me to this document which discusses installing Cumulative Updates or patches on Data Quality Services.   It doesn’t explicitly mention assembly ID 65627 (although other online articles do) but as it says, you do have to run DQSInstaller.exe – upgrade to fix the issue above which did the job for me. 

Master Data Services

Finally (for me anyway) Master Data Services.   When I opened the Master Data Manager web client, the message I got was “the client version is incompatible with the database version” and a request to update components using Master Data Configuration Manager -

MDSError

So, off I went to Master Data Services Configuration Manager, connected to my MDS database, and got the same advice about upgrading the database -

MDSConfig

Which I duly did, and once complete Master Data Services and Manager were back up and running (actually I think this is a little misleading because the original MDS error suggests that the client version is out of step, but the database upgrade fixes it).

So there you have it.   From what I’ve seen so far all or some of the above steps will be needed after patching SQL Server 2012, depending upon which features you have installed.   At the time of writing I haven’t tried applying Service Pack 1 which is currently at CTP level but if anyone has, please leave a comment.

Update December 2012 – I can confirm that after applying SQL Server 2012 Service Pack 1 it was again necessary to complete the steps outlined above fix the issues.   As Cumulative Update 1 for SQL Server Service Pack 1 arrived fairly soon after I also tested this and found that SP1 CU1 didn’t cause anything to break.

Posted in Microsoft SharePoint, PowerPivot, SQL Server | 2 Comments »

Excel 2013 Preview – Webservice Function and Flash Fill

Posted by workerthread on August 9, 2012

From everything I’ve seen so far Excel 2013 has some great new features for anyone interested in data analysis and Business Intelligence tools.   Both PowerPivot and Power View are included in this release (more on this later) and there are lots of new OLAP-specific features for anyone using Excel as a front end for multi-dimensional tools.

I saw this blog post from Chris Webb with an example of the new WEBSERVICE function.   As it happened I was recently looking at a file of locations for London bicycle hire stations – I thought it might be interesting to use this with some bike journey statistics against Excel 2013 Power View and maybe use the new mapping feature to show the busiest hire locations.   My file showed geographical location info as Easting and Northing and I thought I would be a good exercise to see if I could convert these to latitude/longitude columns for use in a Power View map.

Hunting around online, I found this article on converting easting/northing to latitude/longitude for an interactive map project.  The article uses a web service at uk-postcodes.com to send an easting/northing pair and return the lat/long data in JSON format.   So will this work with Excel 2013 –

Excel2013WebService

The answer is, yes it will, and I get JSON data returned which looks like this –

{"lat":"51.523344763137","lng":" -0.1838464075195"}

And of course I can copy the formula containing the WEBSERVICE function down the column -

Excel2013JSON

Next I need to parse the JSON data so I end up with two new columns, one each for Latitude and Longitude.   Now it is of course possible to split strings of single-column data into separate columns using various combinations of MID, FIND and LEN functions and this would certainly work.  And there are various Excel VBA JSON parser examples around online.  But Excel 2013 has a new, interesting Flash Fill feature which you can read more about in this Excel Team blog post.   Giving Excel 2013 sample patterns to work with is the key here.  I wanted to try this with the data in my web service results column.

It’s worth noting a point made in step 3 of the Excel team post: “We decided to disable automatic Flash Fill for numeric data. After all, there are only 10 unique characters in our numbering system, and it’s just too easy to come up with random patterns that don’t make good sense”.   So to pull out the latitude values as numerical values I needed to to format the numerical precision on the column (in this case to 12 decimal points) and use the Data tab “Flash Fill” option –

And it worked!

Excel2013Lat

My longitude values didn’t flash fill with numbers so successfully.   I think the problem here lay with the variable number of decimal places, so I got this message -

Excel2013precision

But the good news is if I entered the first example value with a label prefix, as soon as I start typing the second value, Flash fill recognises what I’m doing and suggests the fill I’m looking for -

Excel2013lng

UPDATE – if I settle for a lower precision and go for lowest common denominator of decimal places this does actually work with numbers.  So for example entering first 2 values with 8 digits of decimal value (such as –0.1838464) will allow me to flash fill with numeric data all the way down the column with no errors.

So overall pretty encouraging results.   Moving forward, if I were going to use the cleaned up web service results mashed up with other data in PowerPivot/Power View I would probably remove the web service function calls leaving behind just the cleaned-up data, thereby minimising the workbook refresh time.

One slightly disappointing finding, the WEBSERVICE function doesn’t currently seem to work in either SkyDrive or Office Web Apps in the Office 365 preview but maybe this will change by the time Excel 2013 is released.

Next up, a post on Excel 2013 PowerPivot and Power View.

Posted in Business Intelligence, Office | 2 Comments »

SSAS Cubes, Excel and SharePoint – Keeping Contributors Happy

Posted by workerthread on January 10, 2012

OK, I know this isn’t exactly cutting edge stuff and we now have PowerPivot, the forthcoming Power View, tabular data models and more in SQL Server 2012 but let’s face it, there are a great many organisations for whom none of these new features will actually be in production in 2012.  These organisations have invested in SQL Server 2008 R2 and spent time in 2011 building SQL Server Analysis Services (SSAS) cubes from their line of business data – and getting SharePoint 2010 up and running.  Now they want to get a return on their investment before they spend more on licences, upgrades and more hardware. 

Now Excel pivot tables and charts aren’t perfect, certainly not cutting-edge.  But if the infrastructure is in place then using Excel 2010 as a client for your SSAS cubes and publishing workbooks or workbook items to SharePoint 2010 is an excellent “self-service BI” entry-point.  In my opinion Excel 2010 is still the best choice for validating the quality and accuracy of the data in your cube and I often get users who know what to expect from the data to play a major part in this task.  And of course Excel Services pivot tables and charts can become part of the bigger BI picture later as a part of PerformancePoint dashboards. 

However you still need to make it as easy as possible for your “self-service BI” contributors to find their data and publish it.   This is what I’ll cover here.  Note that I’m not intending this post as a guide to creating Excel reports with SSAS Cubes and SharePoint (see links at bottom of post for various walk-through examples and tutorials).  My main objective is to show how to put together a SharePoint environment which your Excel Services user population (both contributors and consumers) are comfortable using.

Before Your Contributors Get Started

To kick off, let’s briefly cover some things that need to be in place before you let your Excel Services contributors loose (all of which assumes you are working with Office 2010 and SharePoint 2010):

You need SharePoint Server 2010 Enterprise – I mention this because I still frequently see the “which SharePoint version do I need” question asked online.   Excel Services is a feature of SharePoint Server 2010 Enterprise, so if you have SharePoint Foundation or SharePoint 2010 Standard you are out of luck.

You need Office 2010 Professional or higher – many of the Office 2010/SharePoint 2010 integration features aren’t available in Standard Edition.

Decide where your Office data connection files will be located in SharePoint – all of your published Excel workbooks that connect to SSAS cubes should use an Office data connection (ODC) file stored in data connection library.  If you are using the default SharePoint Business Intelligence Centre site collection template then you will already have a Data Connections library in place.  If you are using your own site you will need to create a Data Connections library – and don’t forget that data connection files created in these will by default require approval once created and uploaded, so make sure that this isn’t overlooked.

Decide where your Published Excel workbooks will be stored –  I normally create a specific document library for these (and as you will see later, may well enable content types).  

You must configure Trusted File Locations and Trusted Data Connection Libraries in your SharePoint Excel Services application – This is frequently overlooked and needs to be planned and configured in advance.  If things aren’t configured correctly here then your Excel workbooks may not open in the browser (trusted file location not configured) or refresh data connections (trusted data connection libraries not configured).   TechNet has more details on this here and there is a good troubleshooting guide available for download here.

Assign appropriate permissions to the Excel document library in SharePoint – you need to assign Contribute permissions to the group of users who will be allowed to publish workbooks (this gives them permissions to view, add, update and delete workbooks).   Typically I recommend other users be assigned View Only permissions within the library as this ensures they can view the published workbook items in a browser but only download a snapshot containing values and formatting (users with next-highest Read permission can open the workbook in Excel and view all underlying details).  If your Excel contributors are also creating/editing dashboard pages containing Excel Web Access components then you will need to assign Design permissions to them.

Assign appropriate permissions in the Analysis Services Cube – if you are using Integrated Windows Authentication to connect to your cube, you need to do more than grant appropriate SharePoint permissions.  All users connecting to the cube via Excel and SharePoint will also need to be given permissions to access the cube itself.  I would recommend that when the cube is designed in Business Intelligence Developer Studio, a “cube readers” role is set up and an Active Directory group is assigned the appropriate permissions, then all that is needed is to add existing and new users via Active Directory.

Making Data Connections Easier

I’m assuming here that your Excel contributors are already familiar with pivot tables and charts and may already have connected to a cube themselves.   However, connecting using an Office Data Connection file stored in SharePoint may well be new to them and the process of creating a new analysis and re-using the existing data connection isn’t that intuitive.   Here are some suggestions:

Create the Data Connection files for them, before they get started – you won’t normally need a lot of data connection files (typically one for each cube or cube perspective) so I would absolutely recommend getting the data connection files created, published and approved before your contributors get to work.  Here is a Microsoft Office article on creating and using Office Data Connections – it dates back to Excel 2007 but most of the instructions still apply.  The article does talk about using a “DataConnections” web part.  Just to clarify, what they mean here is view of your data connections library which in the article is called DataConnections.  Below is an example in SharePoint 2010 where a view of approved ODC files in my  DataConnections library is shown on a site page (click image to open full-size) -

data connections list - click to view full size

The default action that will take place when clicking on either of the links is for a new Excel workbook to be opened with an empty pivot table created, using the stored data connection you clicked.

Consider using Content Types in your Excel document library – this is another way of making it easier for your contributors to create new cube-connected Excel reports.  There are already a great many online tutorials on how to create and use SharePoint content types (here for example).  What I’m suggesting here is that the document library which will be used for your Excel workbooks has “allow management of content types” enabled.   Each content type added to the library can then use a different Excel document template which already contains a data connection pointing to the appropriate Office Data Connection file that you’ve already uploaded.   Your contributors then just need to select the appropriate new document from within the library:

New Document from Content Type

then create a new pivot table in the workbook and select “Use an External Data Source”:

Create Pivot Table

and choose the existing connection in the workbook:

Existing Connection

So the contributor creating the workbook doesn’t need to find the connection file, and you have the added advantages of being able to add other metadata columns to your content type and of course re-use in other libraries.  Additional metadata columns are particularly useful if your library is likely to contain a large number of Excel documents – they will allow you to create custom list views of your reports by type, department, owner etc.  Something else you may find useful here is enabling content rating on your document library.

Make Sure Published Workbook Items Refresh

One other quick point to note before I finish this post – I frequently see published workbooks which don’t show the most up to date data when opened in the browser.  It’s important to ensure that workbook connection properties have “Refresh data when opening the file” checked, otherwise you will be looking at stale data:

ConnectionProperties

Links for those Getting Started

Here are some links you might find useful if you are just getting started with Analysis Services,  Excel and SharePoint –

Getting Started with Business Intelligence in SharePoint Server 2010 (well worth downloading the PDF or Visio document)

Excel Services in SharePoint 2010 Dashboard Improvements

Excel Services Data Refresh Troubleshooting Flowchart

Connecting to Cubes and External Data with Excel in SharePoint (excellent blog post from John White)

Excel Services Module of SharePoint Server Business Intelligence Insights Training – good info in this video series and you can download the accompanying Lab02 here.

That’s it for now – I hope the points I’ve covered help you with a successful SharePoint BI solution.   If you’re interested in more posts on this topic leave a comment and I’ll see what I can do.

Posted in Business Intelligence, Office, SQL Server | 3 Comments »