SSAS | Under the kover of business intelligence https://sqlkover.com BI, SQL Server and data by Koen Verbeeck Thu, 21 Jan 2021 11:19:03 +0000 en-US hourly 1 https://sqlkover.com/wp-content/uploads/2019/11/cropped-sitelogo-32x32.jpg SSAS | Under the kover of business intelligence https://sqlkover.com 32 32 Unable to validate source query in Tabular Editor https://sqlkover.com/unable-to-validate-source-query-in-tabular-editor/?utm_source=rss&utm_medium=rss&utm_campaign=unable-to-validate-source-query-in-tabular-editor https://sqlkover.com/unable-to-validate-source-query-in-tabular-editor/#respond Thu, 21 Jan 2021 11:18:18 +0000 https://sqlkover.com/?p=1501 When you have a very large fact table in Analysis Services Tabular, you most likely have it partitioned. Suppose you are making some changes to the underlying source of the table and you hit “refresh table metadata” to add some new columns for example. What happens behind the scenes is that Tabular Editor will run […]

The post Unable to validate source query in Tabular Editor first appeared on Under the kover of business intelligence.]]>

When you have a very large fact table in Analysis Services Tabular, you most likely have it partitioned. Suppose you are making some changes to the underlying source of the table and you hit “refresh table metadata” to add some new columns for example.

What happens behind the scenes is that Tabular Editor will run the query from the first partition against the source. If this is SQL Server, it will surround the query with SET FMTONLY ON to return only metadata. However, if for whatever reason this query takes a long time, you might encounter a timeout. This throws the error “Unable to validate source query”.

Not good. A quick fix is to go to your first partition, edit the query and just add WHERE 1 = 0 to the end of the query. (Note that I’m using the legacy sources, meaning I’m not using Power Query to extract data. But you should be able to add such a filter there as well.)

Now the table metadata should refresh instantaneously. I’ve logged a bug for Tabular Editor here. Just don’t forget to remove your filter from the partition when you’re done 😉

The post Unable to validate source query in Tabular Editor first appeared on Under the kover of business intelligence.]]>
https://sqlkover.com/unable-to-validate-source-query-in-tabular-editor/feed/ 0
Installing SSDT for Visual Studio 2017 https://sqlkover.com/installing-ssdt-for-visual-studio-2017/?utm_source=rss&utm_medium=rss&utm_campaign=installing-ssdt-for-visual-studio-2017 https://sqlkover.com/installing-ssdt-for-visual-studio-2017/#comments Tue, 19 Jun 2018 13:21:56 +0000 http://sqlkover.com/?p=1064 I had SSDT for VS 2017 installed some time ago, but due to some issues I had to uninstall it. I also have SSDT for VS 2015 installed, as an add-on in Visual Studio 2015 Enterprise (because that’s the only way to get TFS working in VS 2015). I tried to re-install SSDT 2017 (stand-alone […]

The post Installing SSDT for Visual Studio 2017 first appeared on Under the kover of business intelligence.]]>
I had SSDT for VS 2017 installed some time ago, but due to some issues I had to uninstall it. I also have SSDT for VS 2015 installed, as an add-on in Visual Studio 2015 Enterprise (because that’s the only way to get TFS working in VS 2015). I tried to re-install SSDT 2017 (stand-alone or integrated into Visual Studio), but every time it crashed. Someone on the SSDT team told me there were some issues with the internal build numbers, but a fix would be coming soon.

So today I tried again with the latest version of SSDT. On the first attempt, the installer crashed again with the error message “the requested metafile operation is not supported”. I contacted the SSDT team again and they told me to reboot my machine and try again (no seriously, they did).

Afbeeldingsresultaat voor have you tried turning it off and on again

Anyway, when I launched the installer again after the reboot, it seemed the stand-alone SSDT shell was already installed and I just had to add SSIS/SSRS/SSAS. The installer gave same weird error about needing to close devenv (while nothing was open at the time), but I ignored the error and continued with the set-up. And lo and behold, SSDT 2017 was installed just fine. So sometimes a reboot really does work.

When opening VS 2017 for the first time, I was greeted with the following strange messages:

And team explorer:

And when I tried to close everything:

Weird stuff. But a reboot of Visual Studio fixed it again (yes, there’s a theme!). Everything seems to work fine and even the source control integration works, so I’m pleased to announce it’s safe to use SSDT 2017 (at least, when you have rebooted 😉

The post Installing SSDT for Visual Studio 2017 first appeared on Under the kover of business intelligence.]]>
https://sqlkover.com/installing-ssdt-for-visual-studio-2017/feed/ 1
Change SSAS Tabular Data Source using TOM https://sqlkover.com/change-ssas-tabular-data-source-using-tom/?utm_source=rss&utm_medium=rss&utm_campaign=change-ssas-tabular-data-source-using-tom https://sqlkover.com/change-ssas-tabular-data-source-using-tom/#comments Tue, 08 May 2018 10:03:43 +0000 http://sqlkover.com/?p=1047 We’ve all been there. You made some adjustments to your Tabular model and you deploy it to the production server using Visual Studio. Whoops, you forgot to change the server name in the data sources, so now your Tabular model in production is trying to read from the test database. Either it crashes – depending […]

The post Change SSAS Tabular Data Source using TOM first appeared on Under the kover of business intelligence.]]>
We’ve all been there. You made some adjustments to your Tabular model and you deploy it to the production server using Visual Studio. Whoops, you forgot to change the server name in the data sources, so now your Tabular model in production is trying to read from the test database. Either it crashes – depending on your impersonation settings – or it doesn’t and it can take a while before someone notices the data in production is a little off.

Afbeeldingsresultaat voor facepalm

There are many ways to avoid this scenario. The first one is to not deploy from Visual Studio at all, but rather use a script or the wizard. But you know those rogue BI developers, there will always be one who just right-clicks the Tabular project in Visual Studio and chooses “Deploy”. You could also use configurations in Visual Studio, which were introduced in Tabular 2016. You can find more info in this article. But of course you can still forget to pick the correct configuration before you deploy.

So I created a little script that can be executed in a SSIS script task. You execute it right before you start processing your models in your daily/nightly/hourly/weekly/… batch run. It will loop over the databases in your Tabular server using the Tabular Object Model (TOM), inspect the connections and make sure they are all set to point to the correct server. In the script, I assume SSAS is installed on the same server as the data sources. If this isn’t the case, it’s pretty easy to change. The server name is passed along as a SSIS project variable.

To make the script work, you need to install the correct libraries. More info can be found here. The script itself can be downloaded from Github.

The post Change SSAS Tabular Data Source using TOM first appeared on Under the kover of business intelligence.]]>
https://sqlkover.com/change-ssas-tabular-data-source-using-tom/feed/ 1
Stop Previewing the bim.layout File in SSAS Tabular https://sqlkover.com/stop-previewing-the-bim-layout-file-in-ssas-tabular/?utm_source=rss&utm_medium=rss&utm_campaign=stop-previewing-the-bim-layout-file-in-ssas-tabular https://sqlkover.com/stop-previewing-the-bim-layout-file-in-ssas-tabular/#respond Thu, 22 Mar 2018 09:53:32 +0000 http://sqlkover.com/?p=1029 A quick blog post for future reference, because I know I’ll bump into this again someday. When you’re working with a team on a Analysis Services Tabular project, you most likely will check your code into some sort of source control (yes, you do. If not, start tomorrow). One of the problems is the layout […]

The post Stop Previewing the bim.layout File in SSAS Tabular first appeared on Under the kover of business intelligence.]]>
A quick blog post for future reference, because I know I’ll bump into this again someday.

When you’re working with a team on a Analysis Services Tabular project, you most likely will check your code into some sort of source control (yes, you do. If not, start tomorrow). One of the problems is the layout of the measure grid. This is stored in the model.bim.layout file and of course this isn’t kept in source control by default. This means that when I create new measures and organize them neatly in the grid and check in my changes, the layout file isn’t updated on the server (because it’s not included). Every developer has its own layout file. Which means that when another dev opens the model, the nicely organized measure grid is gone; all measures are typically splashed across two rows.

Annoying.

You can “solve” this by adding the .bim.layout file to source control (right-click the project, choose Add and then Existing Item).

Every time you work on the model, you check out the .bim.layout file as well. When you’re done, you check in all changes. When another dev starts working on the project, a get latest is performed to get the latest version of the layout file (typically you get a conflict error and you have to tell TFS to overwrite the local file). Case closed? Now we introduced a new issue: every time you want to check out the layout file, Visual Studio insists on opening it first. And that can take quite some time. Luckily you can disable this (hence the title of this blog post).

Go to Tools > Options… > Environment > Tabs and Windows. Deselect “Allow new files to be opened in the preview tab”. All done.

The post Stop Previewing the bim.layout File in SSAS Tabular first appeared on Under the kover of business intelligence.]]>
https://sqlkover.com/stop-previewing-the-bim-layout-file-in-ssas-tabular/feed/ 0
SQL Server Data Tools 2017 and TFS Integration https://sqlkover.com/ssdt-2017-and-tfs-integration/?utm_source=rss&utm_medium=rss&utm_campaign=ssdt-2017-and-tfs-integration https://sqlkover.com/ssdt-2017-and-tfs-integration/#respond Thu, 30 Nov 2017 11:31:32 +0000 http://sqlkover.com/?p=947 UPDATE 2018-06-20: I was finally able to install the stand-alone version of SSDT for VS 2017 with working TFS integration. Read more about it here. I’ve blogged a while back on how SSIS 2017 was finally here. Not much has changed; there is still no Visual Studio extension for SSIS, so if you want to […]

The post SQL Server Data Tools 2017 and TFS Integration first appeared on Under the kover of business intelligence.]]>
UPDATE 2018-06-20: I was finally able to install the stand-alone version of SSDT for VS 2017 with working TFS integration. Read more about it here.

I’ve blogged a while back on how SSIS 2017 was finally here. Not much has changed; there is still no Visual Studio extension for SSIS, so if you want to create SSIS projects you still need to install SQL Server Data Tools (which makes it a bit useless that there are SSRS and SSAS extensions).

At my current client we are migrating to SQL Server 2017, so happy as I am I downloaded SSDT for Visual Studio 2017 (currently in the 15.4.0 preview version). I was happy because

  • I could use Visual Studio 2017
  • I didn’t need a full-blown Visual Studio, since there is a TFS Source Control Explorer for Visual Studio 2017 (VS 2015 doesn’t have this)

So I installed SSDT and the TFS plug-in. I configured the connection to the TFS server and the mapping and downloaded all our project objects. Then I tried to open an SSIS project. I was greeted with the cheerfully “The source control provider associated with this solution could not be found. The projects will be treated as not under source control.
Do you want to permanently remove the source control bindings from this project?“. Euh, what?

Afbeeldingsresultaat voor The source control provider associated with this solution could not be found. The projects will be treated as not under source control. Do you want to permanently remove the source control bindings from this project?

Turns out, the latest version of SSDT for VS 2017 breaks the TFS mappings. Happy days. Here’s a whole thread of people with the same issue. Also for giggles, check out the comments at the download page of SSDT. Of course there’s no older version available for VS 2017, only for VS 2015 or 2013. Funny, that download page says:

“The last few downloads are provided for the unlikely event that you experience issues with the latest release.”

Unlikely event?

So I removed SSDT and the TFS plug-in. I installed the full-blown Visual Studio (not happy, but you can choose which parts to install so you can go for a very light-weight install. Still not free like SSDT) and then I installed the SSDT 15.4.0 preview again. Finally, I removed the SSRS extension (version 1.17) and installed the last version (1.19). This time, the TFS integration seems to work fine. Another option would be to downgrade to Visual Studio 2015, but then again, there you also need the full Visual Studio for TFS integration.

On a sidenote: every time you close a solution in VS 2017, the annoying start page pops up. There’s a thread on StackOverflow on how to disable this (hint: it involves the registry).

Moral of the story: even Microsoft doesn’t know how to do integration testing. 😉

The post SQL Server Data Tools 2017 and TFS Integration first appeared on Under the kover of business intelligence.]]>
https://sqlkover.com/ssdt-2017-and-tfs-integration/feed/ 0
Can’t Connect to Analysis Services – Invalid Connection Information https://sqlkover.com/cant-connect-to-analysis-services-invalid-connection-information/?utm_source=rss&utm_medium=rss&utm_campaign=cant-connect-to-analysis-services-invalid-connection-information https://sqlkover.com/cant-connect-to-analysis-services-invalid-connection-information/#comments Mon, 30 Oct 2017 14:45:21 +0000 http://sqlkover.com/?p=928 I have a new installation of SQL Server 2017, along with an instance of Analysis Services Tabular 2017. I tried to connect to the SSAS instance for the first time, and I was greeted with the following error: “Invalid connection information to establish the server connection” I was using SSMS 17.3 to connect to the […]

The post Can’t Connect to Analysis Services – Invalid Connection Information first appeared on Under the kover of business intelligence.]]>
I have a new installation of SQL Server 2017, along with an instance of Analysis Services Tabular 2017. I tried to connect to the SSAS instance for the first time, and I was greeted with the following error:

“Invalid connection information to establish the server connection”

I was using SSMS 17.3 to connect to the instance, so I wasn’t doing anything wonky with connection strings. I tried the following, without any success:

  • repair the SSAS instance (when does a repair ever work?)
  • uninstall and re-install the SSAS instance
  • uninstalling SSMS 17.3 and installing a slightly older version (17.0)

Nothing worked. I got a similar error when I tried to create a new project in Visual Studio using an integrated workspace. However, I could create an SSAS project using a local workspace server. I could create a model and deploy it to the server. And I could connect with Power BI Desktop to the SSAS instance. The plot thickens. Turns out I’m not the only one either who ever encountered this error:


I took a quick look at Event Viewer, and there were a bunch of errors in there as well for the OLAP service. Of course with pretty error messages:

Googling for this kind of messages led to one forum thread where someone had locale issues. Note the 8192 number, which isn’t even featured in the list of locale identifiers. Anyway, I fired up SQL Server Profiler and ran a trace while I was trying to log into the SSAS server. An error popped up:

Device attached to the system not functioning

wut

This really didn’t make any sense. However, in one of the Discover Begin/End events, the same number appeared again: 8192 (this time explicitly marked as locale identifier). Hmmm, I had problems with weird locales before. I dug into my system, and yes, the English (Belgium) locale was lingering around. I removed it from my system and lo and behold, I could log into SSAS with SSMS again. Morale of the story: if you get weird errors, make sure you have a normal locale on your machine because apparently the SQL Server client tools go bonkers.

(note: there are some references to the en-be locale: here, here and here)

The post Can’t Connect to Analysis Services – Invalid Connection Information first appeared on Under the kover of business intelligence.]]>
https://sqlkover.com/cant-connect-to-analysis-services-invalid-connection-information/feed/ 9
Error Processing Tabular – Method Not Found https://sqlkover.com/error-processing-tabular-method-not-found/?utm_source=rss&utm_medium=rss&utm_campaign=error-processing-tabular-method-not-found https://sqlkover.com/error-processing-tabular-method-not-found/#respond Fri, 15 Sep 2017 08:23:30 +0000 http://sqlkover.com/?p=907 Very quick blog post today. While setting-up a development server at a client who is still using SQL Server 2012, I was greeted with the following error while processing a Tabular model: Errors in the high-level relational engine. The following exception occurred while an operation was being performed on a data source view: Method not […]

The post Error Processing Tabular – Method Not Found first appeared on Under the kover of business intelligence.]]>
Very quick blog post today. While setting-up a development server at a client who is still using SQL Server 2012, I was greeted with the following error while processing a Tabular model:

Errors in the high-level relational engine. The following exception occurred while an operation was being performed on a data source view: Method not found: ‘System.Threading.Tasks.Task`

A quick search indicated other people have struggled with this issue, but no solution were provided in the forums. After digging a bit more, I found related issues but rather for .NET developers, so it’s not for Tabular only. The solution was actually quite easy: upgrade the server to the latest .NET environment. After rebooting the server, I could finally process my Tabular model.

Afbeeldingsresultaat voor meme successful kid

The post Error Processing Tabular – Method Not Found first appeared on Under the kover of business intelligence.]]>
https://sqlkover.com/error-processing-tabular-method-not-found/feed/ 0
CALCULATE and FILTER: A Love Story? https://sqlkover.com/calculate-and-filter-a-love-story/?utm_source=rss&utm_medium=rss&utm_campaign=calculate-and-filter-a-love-story https://sqlkover.com/calculate-and-filter-a-love-story/#comments Wed, 06 Sep 2017 13:28:58 +0000 http://sqlkover.com/?p=895 There have already been many posts/articles/books written about the subject of how CALCULATE and FILTER works, so I’m not going to repeat all that information here. Noteworthy resources (by “the Italians” of course): Filter Arguments in CALCULATE How CALCULATE works in DAX From SQL to DAX: Filtering Data In this blog post I’d rather discuss […]

The post CALCULATE and FILTER: A Love Story? first appeared on Under the kover of business intelligence.]]>

There have already been many posts/articles/books written about the subject of how CALCULATE and FILTER works, so I’m not going to repeat all that information here. Noteworthy resources (by “the Italians” of course):

In this blog post I’d rather discuss a performance issue I had to tackle at a client. There were quite a lot of measures of the following format:

CALCULATE(measureX,FILTER(tableY,columnZ = "expression"))

We can create a very similar measure using the WideWorldImporters data warehouse:

It simply calculates the number of orders placed in the SouthEast Sales Territory:

Now, the problem with this formula is that it uses FILTER, which means an in-memory table is constructed to evaluate the rows and calculate the output of the filter. For every row. Don’t get me wrong, FILTER is very flexible and powerful, but because of its iterator behavior it can cause problems for certain models, as here was the case. The performance issue is also described in a blog post by Rob Collie: Quick Tip: Don’t Over-Use FILTER().

The problem is easily fixed (as outlined in Rob’s post): just remove FILTER(), because DAX will re-add it implicitly but now it’s optimized.

However, this has a small side effect:

When you include Sales Territory on the axis, the measure without filter repeats the same value for all values. This is correct though, as the ‘City'[Sales Territory] = “SouthEast” filter in CALCULATE overrides the current filter context of Sales Territory. The original measure however keeps the original filter context when it calculates the temporary results table of the FILTER function. This is why we get NULL values for all values except for the Southeast Sales Territory. Guess which one looks correct for the typical end user? The original measure of course. Which has performance issues.

My first instinct was to include some IF clauses to get rid of all the superfluous values of the second measure:

IF(HASONEVALUE(City[Sales Territory])
	,IF(VALUES(City[Sales Territory]) = "SouthEast"
		,COUNT('Order'[WWI Order ID])
		,BLANK()		
		)
	,CALCULATE(COUNT('Order'[WWI Order ID]), City[Sales Territory]="SouthEast" )
	)

The formula works, but looks a bit clunky. Luckily I got some assistance on Twitter when I discussed the issue with Marco Russo:


With the KEEPFILTERS function, we can rewrite the measure as follows:

KEEPFILTERS will keep the original filter context, which means if Sales Territory is on the axis, it will actually filter the data:

The good news is of course the measure with KEEPFILTERS doesn’t suffer the same performance problem as the original measure, but it produces the same results. If you’re interested in all the nitty-gritty specifics, you can read chapter 5 and 10 of the excellent The Definitive Guide to DAX book.

The post CALCULATE and FILTER: A Love Story? first appeared on Under the kover of business intelligence.]]>
https://sqlkover.com/calculate-and-filter-a-love-story/feed/ 6
Not An Administrator For Analysis Services Tabular https://sqlkover.com/not-an-administrator-for-analysis-services-tabular/?utm_source=rss&utm_medium=rss&utm_campaign=not-an-administrator-for-analysis-services-tabular https://sqlkover.com/not-an-administrator-for-analysis-services-tabular/#comments Tue, 28 Feb 2017 13:00:12 +0000 http://sqlkover.com/?p=744 A couple of weeks back I installed SQL Server 2016 on my personal machine, including SSAS Tabular. Yesterday I created a new Tabular model project in SQL Server Data Tools. When I had to choose where to locate the model – integrated or a server workspace – I got the nice error message saying I […]

The post Not An Administrator For Analysis Services Tabular first appeared on Under the kover of business intelligence.]]>
A couple of weeks back I installed SQL Server 2016 on my personal machine, including SSAS Tabular. Yesterday I created a new Tabular model project in SQL Server Data Tools. When I had to choose where to locate the model – integrated or a server workspace – I got the nice error message saying I wasn’t a server administrator on the Tabular server.

I was almost 100% certain I added myself as an administrator during SQL Server set-up and the configuration of the Tabular server. I logged in the server, went to properties and then to security. The list of server administrators was as empty as a merchant’s soul (yep, I googled that one). I either forgot to add myself as an admin (not likely, because according to the docs the set-up doesn’t continue if you don’t select an admin), or something fishy was going on.

server admin is empty

So I tried to add myself as an administrator, however no dice: I didn’t have the correct permissions. A quick search engine search (sorry) revealed I should be able to, because local administrators do have admin permissions in SSAS Tabular. This was starting to get annoying.

However, a bit more thorough search showed me the solution: you had to launch SSMS as an administrator. Good old UAC, you strike again, old foe.

run as administrator

And lo and behold, I could add myself as an admin! Which means I don’t have to run SSDT as an admin every time I want to create a new Tabular project.

The post Not An Administrator For Analysis Services Tabular first appeared on Under the kover of business intelligence.]]>
https://sqlkover.com/not-an-administrator-for-analysis-services-tabular/feed/ 2
SSRS and MDX: Think about Cell Properties https://sqlkover.com/ssrs-and-mdx-think-about-cell-properties/?utm_source=rss&utm_medium=rss&utm_campaign=ssrs-and-mdx-think-about-cell-properties https://sqlkover.com/ssrs-and-mdx-think-about-cell-properties/#respond Wed, 04 May 2016 12:00:59 +0000 http://sqlkover.com/?p=481 I stumbled across a small MDX performance tuning trick when using SSRS reports (or any other client tool where you can edit the MDX). When you create the MDX query using the designer, it will append some cell properties at the end of the query. Basically it’s just metadata about the cells of the result […]

The post SSRS and MDX: Think about Cell Properties first appeared on Under the kover of business intelligence.]]>

I stumbled across a small MDX performance tuning trick when using SSRS reports (or any other client tool where you can edit the MDX). When you create the MDX query using the designer, it will append some cell properties at the end of the query. Basically it’s just metadata about the cells of the result set.

mdxtuning03

An example of what those values can contain:

  • Value: 6360
  • Formatted value: € 6.360,00
  • Format string: \€ #,##0.00;\€ -#,##0.00

Some of them are quite useful, especially the FORMAT_STRING property as you can use it to force SSRS to display the formatting you configured in the cube. Be sure to check Jason Thomas’ excellent blog post on this: Using SSAS formatting in SSRS. FORMATTED_VALUE seems very useful, but since it’s a string value SSRS doesn’t know how to aggregate it, so using it in a tablix might result in an error.

However, most likely you won’t need most of those cell properties. So you can leave out the cell properties that you don’t need and it saves you some data that has to be retrieved from the cube and sent to the SSRS report. Don’t expect a 10-minute query to suddenly run under 5 seconds, but every little bit counts to make your reports as fast as possible.

I tested a simple query using MDX Studio, where you can easily wipe the cache of the cube.

mdxtuning04

It also has a nice Perfmon pane showing you some performance metrics about the executed query.

Here’s the query on a cold cache, with all cell properties:

mdxtuning01_coldcache

On a cold cache with only two cell properties:

mdxtuning02_coldcache

Warm cache with all properties:

mdxtuning01_warmcache

Warm cache with two properties:

mdxtuning02_warmcache

On a cold cache we got about 14.9% performance increase. On a warm cache about 16.5% increase. Quite a nice result for just deleting a couple of lines at the end of the MDX query. The more measures you include in your query, the bigger the impact that this trick has. If you only have one single measure, you probably won’t notice much difference.

The post SSRS and MDX: Think about Cell Properties first appeared on Under the kover of business intelligence.]]>
https://sqlkover.com/ssrs-and-mdx-think-about-cell-properties/feed/ 0