Quantcast
Channel: SQL Server Analysis Services forum
Viewing all 14337 articles
Browse latest View live

Aggregating the calculated measure

$
0
0
Hello Team,
I need an urgent solution for the below problem. Your immediate help is hoghly appreciated.
I would explain in steps for clear:
1. I have a Measure, [Measure] which is  calculated from three different measures as [Qty1]+[Qty2]-[Qty3]
2. [Measure4] is a running sum calculated from the function PeriodsTodate() of [Measure]( [Qty1]+[Qty2]-[Qty3])
3. [Measure5]  is positive values of [Measure4] which users wants to see as final results.This is defined as  (IF[Measure4] > 0 then [Measure4] ELSE NULL)
Now My problem is here with aggregation for the measure [Measure5] which evaluates on excel pivot level. For Time dimension this is OK. But for Product Dimension, they want to see sum of its children than pivot level evaluation. Since calcuted measure do not aggragate up by default, I have applied the below logic to solve this problem.
I have created a dummy real measure, [Measure6], and assign the values of [Measure5] to the leaf level of Production dimension like below:
SCOPE (Leaves(Product), [Measure6]))
THIS = [Measure5]
END SCOPE:

This solution works fine. But using Leaves() function is creating a huge performance issues in user reports.
So we decided to move the changes to the Database level:
In database we created the measure [Measure6], completing all the steps above and values looks fine. But bringing database values [Measure6] to cube, again  we will have aggregation problem.  Because we need to  define the aggregation function in the cube strcture for measures added from the datasource. Product dimension is SUM() at the higher level, which is OK. But for Time dimension this should not aggregate up, as this is running sum caculated now in the database(which is results of PeriodsTodate()), and should display as is received from the data source.
Now I am running out of solutions. Can you please help me to implement this in alternate way?

Thanks and Regards,
Prema

Processing a ROLAP dimension...

$
0
0

I have a ROLAP dimension which contains the list of error messages generated during fact generation such that we can retrieve the error messages related to a job via the cube. I know, not ideal insofar as using Analysis Services is concerned but users like to use Excel and all the data is in one place yada-yada-yada. You get the idea.

On the up side this all works really really well and performance is no where near as bad as I expected it to be from when we implemented this over 2 years ago now. I have, however, since discovered the issuette with regards setting "IgnoreError" for duplicate keys (really Microsoft, please tell me this is fixed in 2012) and the requirement to process the ROLAP dimension to stop AS erroring during MDX queries with "missing key" errors and causing AS to fallback to cell-be-cell mode and raise the 4 billion tuple error message.

Now the question... While testing the ROLAP dimension processing, which I understood to be essentially a clearance of the dimension cache, I can see in profiler that it generates "Notification" event class events with a subclass of "8 - Object Altered" seemingly for every partition in the database. As we have on the order of 3000 partitions on our test server this takes a little while. (32 seconds to process a ROLAP dimension) Note that we have close to 17000 partitions on our production server so I suspect that that time will increase.

Anyone know why it is doing this? The Error Message dimension isn't even linked to most of the partitions being altered so is this maybe a versioning thing, where AS has to go update each partition to indicate that there is now a new processed object version or something? Anyone know of any way I can avoid this whilst still mainly keeping the current implementation?


http://bi-logger.blogspot.com/

SQL subquery

$
0
0

Hi, I am new to SQL and I am having a difficulty concerning a problem where Im forced to use subquery's. It's on AdventureWorks. I need to find the employees that had the least vacationHours. I need their FirstName, LastName , and their JobTitle.I can't use joins. 

This is what I tired : 

SELECT JobTitle , VacationHours,  (SELECT FirstName, LastName 

FROM Person.Person

) 

FROM HumanResources.Employee

Orderby VacationHours

Error : Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.

Can someone help me please?

thank you ! 

Doing it with Join works but I need to find a way without it :

SELECTSUM(e.VacationHours) ,e.JobTitle, p.FirstName, p.LastName

FROM HumanResources.Employee e

INNERJOIN Person.Person pON e.BusinessEntityID=p.BusinessEntityID

GROUPBY e.JobTitle, p.FirstName, p.LastName

ORDERBY SUM(e.VacationHours) 

How to use = operator in MDX expression

$
0
0

Hi Guys,  

I am new to MDX, trying to create report in excel(Power Pivot OLAP) using tabular model cube.

I need convert below DAX expression into MDX expression,

DAX Experssion

CALCULATE(
sum('Finance GL'[Value in Origin Currency]),
'Measure Name'[Measure Name] = "GSR", 
filter('Customer',Customer[Customer PLTO Level 4 Name]="P3-TH KEY ACCOUNTS"  ||
Customer[Customer PLTO Code]="339883" ||
Customer[Customer PLTO Code]="339801" ||
Customer[Customer PLTO Code]="339879" || 
Customer[Customer PLTO Code]="339899" ||
Customer[Customer PLTO Code]="339830" ||
Customer[Customer PLTO Code]="339878" || 
Customer[Customer PLTO Code]="339928" || 
Customer[Customer PLTO Code]="339929" ))

-----------

For MDX

Equivalent Dimensions  and attribute to use from cube are as follows,

[Measure Name].[Measure Name]=[Measure Name].[Measure Name].&[GSR],

[Customer].[Customer PLTO Level 4 Name]=[Customer].[Customer PLTO Level 4 Name].&[P3-TH KEY ACCOUNTS]

[Customer].[Customer PLTO Code].

[Customer].[Customer PLTO Code].&[339883], 
[Customer].[Customer PLTO Code].&[339801],
[Customer].[Customer PLTO Code].&[339879],
[Customer].[Customer PLTO Code].&[339899],
[Customer].[Customer PLTO Code].&[339830],
[Customer].[Customer PLTO Code].&[339878],
[Customer].[Customer PLTO Code].&[339928],
[Customer].[Customer PLTO Code].&[339929]

-------------

I have tried to use OR operator in MDX 

My approach in MDX :

sum(
{
(  
   [Measure Name].[Measure Name].&[GSR],
   [Customer].[Customer PLTO Level 4 Name].&[P3-TH KEY ACCOUNTS],
   strtomember("[Customer].[Customer PLTO Code].&[339883]") or 
   strtomember("[Customer].[Customer PLTO Code].&[339899]")
  -- [Customer].[Customer PLTO Code].&[339879] 

)
},
[Measures].[Total Value in Origin Currency]
)

but it is throwing  Infinite recursion detected as an error message

Please advise me, any help is much appreciated.

Thanks,

Regards,

Kedarnath

RANKX not working when RLS filter applied?

$
0
0

Hi All,

I am running into a weird situation.

My tublar model is setup as

UserPermission <M:1> SecurityKeys   (Bi-directional filtering + RLS Here)

Employee <M:1> SecurityKeys            (Filter direction << toEmployee)

Feedback <M:1> DimEmployee           (Filter direction << toFeedback) 

RLS Filter on UserPermission[Logon] = USERNAME()

My RANKX Measure on Feedback is as follows

Overall Feedback Rank:= 

IF ( HASONEVALUE(Feedback[GUI]),       

RANKX ( ALLSELECTED(Feedback), [Avg Overall Feedback],,,Dense)       

,

BLANK()

)

[Avg Overall Feedback] is a measure in Feedback table.

I have 3 roles, 1 has no RLS DAX filters

When I analyze this measure in excel through that role or through default admin behavior "Analyze in Excel" as current windows user, the RANKX works correctly

When I go through RLS, the RANKX() is producing incorrect results

Any guidance on what is going on ?




custom rollup returns all nulls for cube

$
0
0

I've been practicing building cubes with the Adventure Works DW.

I build a hierarchy for postal code, city, state province and country.

Whenever I use the custom rollup and rollup Postal Code into City, City into State Province and State Province into Country I get nulls for all the values in the Fact Internet sales.

Am I missing something?

I thought the purpose of custom rollup was to aggregate values at each level so you do not have to go all the way down to the detail level to get the totals.

For example if I aggregate all the quarters, then I just have to add all the quarters to get the year, rather than having to go down to the lowest level (day for example)

Can someone help with this.

Thanks

Partition Processing error - "The restrictions imposed on partition slice where violated"

$
0
0

Hello,

I'm getting a weird error message on Process of a partition. It says "Errors in the OLAP storage engine: The restrictions imposed on partition slice where violated".

I have a MDX expression defined as Slice property which is syntactically correct. I tried removing the Slice property, but even after removing it gives the same error message which is really surprising.

I'm creating partition using AMO, so I have set the Slice property usign Partition object.Slice = "<MDX Expression>".

I couldn't find any reasonable help on the internet on this. Please help me understand what this error message actually means.

Thanks

Pavan

Tool that can generate ERD of SSAS tabular model deployed in Azure Analysis Services

$
0
0

Hi,

anyone here already used a tool to generate ERD of a tabular model? I am looking for a tool that can connect from my tabular model deployed in Azure Analysis Services and generate the ERD (dynamcally)? 


Restoring AdventureWorks Reseller Database

$
0
0

Hi Everyone,

I'm going through an exercise to restore a database (pg 21 of the following Github file). As instructed, I try to run the following script in PowerShell:

Invoke-ASCmd –InputFile "F:\Labs\Setup\Scripts\Lab01-Setup-Reseller_Sales.xmla" -Server "localhost\MD"
pause

But then I get the following message: 

<return xmlns="urn:schemas-microsoft-com:xml-analysis"><results xmlns="http://schemas.microsoft.com/analysisservices/2003/xmla-multipleresults"><root xmlns="urn:schemas-microsoft-com:xml-analysis:empty"></root><root xmlns="urn:schemas-microsoft-com:xml-analysis:empty"><Exception xmlns="urn:schemas-microsoft-com:xml-analysis:exception" /><Messages xmlns="urn:schemas-microsoft-com:xml-analysis:exception"><Error ErrorCode="-1056964601" Description="Internal error: The operation terminated unsuccessfully." Source="Microsoft SQL Server 2017 Analysis Services" HelpFile="" /><Error ErrorCode="-1056571392" Description="OLE DB error: OLE DB or ODBC error: Login failed for user &#39;NT SERVICE\MSOLAP$MD&#39;.; 28000; Cannot open database &quot;AdventureWorksDW2016&quot; requested by the login. The login failed.; 42000." Source="Microsoft SQL Server 2017 Analysis Services" HelpFile="" /><Error ErrorCode="-1055784860" Description="Errors in the high-level relational engine. A connection could not be made to the data source with the DataSourceID of &#39;AdventureWorksDW2016&#39;, Name of&#39;AdventureWorksDW2016&#39;." Source="Microsoft SQL Server 2017 Analysis Services" HelpFile="" /><Error ErrorCode="-1054932980" Description="Errors in the OLAP storage engine: An error occurred while the dimension, with the ID of &#39;Product&#39;, Name of &#39;Product&#39; was being processed." Source="Microsoft SQL Server 2017 Analysis Services" HelpFile="" /><Error ErrorCode="-1054932979" Description="Errors in the OLAP storage engine: An error occurred while the &#39;Color&#39; attribute of the &#39;Product&#39; dimension from the &#39;Reseller Sales&#39; database was being processed." Source="Microsoft SQL Server 2017 Analysis Services" HelpFile="" /><Error ErrorCode="-1055129594" Description="Server: The current operation was cancelled because another operation in the transaction failed." Source="Microsoft SQL Server 2017 Analysis Services" HelpFile="" /><Error ErrorCode="-1056571392" Description="OLE DB error: OLE DB or ODBC error: Login failed for user &#39;NT SERVICE\MSOLAP$MD&#39;.; 28000; Cannot open database &quot;AdventureWorksDW2016&quot; requested by the login. The login failed.; 42000." Source="Microsoft SQL Server 2017 Analysis Services" HelpFile="" /><Error ErrorCode="-1055784860" Description="Errors in the high-level relational engine. A connection could not be made to the data source with the DataSourceID of &#39;AdventureWorksDW2016&#39;, Name of &#39;AdventureWorksDW2016&#39;." Source="Microsoft SQL Server 2017 Analysis Services" HelpFile="" /><Error ErrorCode="-1054932980" Description="Errors in the OLAP storage engine: An error occurred while the dimension, with the ID of &#39;Product&#39;, Name of &#39;Product&#39; was being processed." Source="Microsoft SQL Server 2017 Analysis Services" HelpFile="" /><Error ErrorCode="-1054932979" Description="Errors in the OLAP storage engine: An error occurred while the &#39;Category&#39; attribute of the &#39;Product&#39; dimension from the &#39;Reseller Sales&#39; database was being processed." Source="Microsoft SQL Server 2017 Analysis Services" HelpFile="" /></Messages></root></results></return>

I'm not knowledgeable enough to figure out what it means or, more precisely, why it seems to be saying it could not open the database, or that login failed. If there's any other detail you need from me to try to figure out this question then I'm happy to provide it.

Thanks!

GL2018

 

Column with IsAvailableInMDX set to false - unable to filter on such a column in DAX

$
0
0

Hi team,

i am currently using SSAS 2017 CU12 version.

as per https://blogs.msdn.microsoft.com/analysisservices/2018/06/08/new-memory-options-for-analysis-services/  documentation, i did for few of the columns IsAvailableInMDX set it to false. 

After that i seen huge improvement in recalc time.

but the only drawback is that

          unable to filter the Column which has IsAvaiableInMDX set it to flase in DAX(Power BI).

Please help me out, if there is any workaround is available.

-Srini



Through IIS manager not able to connect to Analysis Services in 2017 version

$
0
0
Through IIS manager not able to connect to Analysis Services in 2017 version

http://server_name/olap/msmdpump.dll is not working while connecting to SSAS 2017 version, till 2016 version it's working fine

Different complexity of data extraction from cube via excel 2013

$
0
0

When user connect to SSAS cubes 2015(cube size is approx 15-16 GB) from excel 2013. they browse the cube data by selecting the different combination of dimensions attributes and facts measures.
This combination in excel to fetch the cube data can be simple or complex.
I have a requirement from client where I have to come up with the different types of these combination to fetch data which can be described as Simple, Moderate and Complex.

[For example(I have to come up with something like this):

1. fetching data for less than 5 measures within the same measure group  against less than 10 dimension is Simple Extraction.
2. Fetching  data for more than 5 and less than 10 measures against more than 10 dimesions within the same measure group is moderateExtraction.
3. fetching ata for more than 10 measure across multiple measure groups against more than 15 multiple dimensions attributes considered as Complex Extraction]

Do anyone has any experience /knowledge/idea on working on such type of request.  Any comment / idea / suggestion will be a great help.

How to only select the hobby that has more than 2 players?

$
0
0

Hi, 

I want to select only the hobbies that have more then 2 players. Can anyone help me out here?

As of now I have 

SELECT hobby, COUNT(hobby) FROM klas GROUP BY hobby ORDER BY COUNT(hobby) DESC;

Here is the data.

CREATE TABLE klas (id INTEGER, naam TEXT, P1 REAL, P0 REAL, Hobby TEXT ) ;

INSERT INTO klas VALUES ( 133944, "Jeroen" ,6.5,6.00,"zwemmen" );

INSERT INTO klas VALUES ( 134131,"Thomas" ,8.0,6.00,"rugby" );

INSERT INTO klas VALUES ( 128081,"Pascal" ,6.0,6.50,"schaken" );

INSERT INTO klas VALUES ( 133838, "Jitka" ,7.5,6.50,"gamen" );

INSERT INTO klas VALUES ( 133783, "Chantal" ,7.3,6.50,"fietsen" );

INSERT INTO klas VALUES ( 133774, "Jan" ,9.5,9.50,"korfbal" );

INSERT INTO klas VALUES ( 128261, "Wietse" ,6.5,7.30,"gamen" );

INSERT INTO klas VALUES ( 133759, "Lisanne" ,6.5,7.30,"korfbal" );

INSERT INTO klas VALUES ( 134296, "Martijn" ,6.0,6.00,"rugby" );

INSERT INTO klas VALUES ( 133901, "Koen" ,8.0,8.00,"racen" );

INSERT INTO klas VALUES ( 133815, "Marijn" ,6.5,6.50,"gamen" );

INSERT INTO klas VALUES ( 127597, "Sieuwert" ,6.0,7.30,"rugby" );

INSERT INTO klas VALUES ( 133797, "Henk" ,6.0,7.50,"schaatsen" );

INSERT INTO klas VALUES ( 133861, "Maike" ,6.5,6.50,"turnen" );

INSERT INTO klas VALUES ( 133826, "Arman" ,7.3,8.00,"dans" );

INSERT INTO klas VALUES ( 133779, "Milou"  ,7.3,8.00,"zwemmen" );

INSERT INTO klas VALUES ( 133805, "Tom" ,8.0,6.50,"korfbal" );

INSERT INTO klas VALUES ( 133866, "Twan" ,8.0,8.00,"voetbal" );

INSERT INTO klas VALUES ( 128778, "Waalko" ,6.5,6.00,"voetbal" );


C03NL


MDX

$
0
0
how to implemented MDX dynamic Scope calculation/Calculation which will evaluate calculated measures and it's grand total irrespective of any selection in row level in Pivot.

Correct syntax inside OPENROWSET

$
0
0

HI,

I have the following query that works fine in a mdx environment:

SELECT last_schema_update FROM $system.mdschema_cubes 
where cube_name = 'Sales'

I want to insert this  in  a OPENROWSET query:

select *
from OPENROWSET ('MSOLAP','Datasource=mysource;Initial Catalog=mycat;','SELECT * FROM $system.mdschema_cubes  where cube_name  = '''Sales''') 

The problem is - how to correctly put the apostrophes for the 'Sales' filter in order for it to work.

No matter what I tried, I could not figure it out

Thanks,

Dani


OlapPivotTableExtension Connection timeout

$
0
0
We are trying to utilize the OLAP PivotTable Extension on https://olappivottableextensions.github.io/. This works fine on our internal network. We have a user who is outside our network and connects to excel by launching excel a user that is on our internal network. The user is able to refresh cube data just fine. We receive a "The connection either timed out or was lost" error. Does this extension use a different connection or can one be defined for it?

IIS, Constrained Delegation, Kerberos

$
0
0

Hi,

we are accessing SSAS via msmdpump.dll and using Constrained Delegation (Kerberos Only)

So we have a Website A with

Application 1 (XLCube Website which hosts Xlcubed Reports)

Application 2 (msmdpump.dll)

Application 3 (customized SSAS Proxy which impersonates an technical user and passes username via CustomData() to SSAS)

So when I connect from my local client via Application 3 (SSAS Proxy) to my SSAS-> works perfect.

When the connection should be made from my Application 1 I get no connection. Log from Application 3 shows 401 error. Microsoft Network Monitor shows KDC_BAD_OPTION for SPN HTTP/Websitename. SPN was created.

Constrained Delegation is set up for the OLAP Services.

Any Ideas. Could it be possible that there is a neccessary to delegate on its own on the Webserver?

Thanx in advance

Dynamic Filtering and Calculation in SSAS cube

$
0
0
Hello everyone,

I am quite new to SSAS and looking for some help. I want to filter the data and perform some calculations within my SSAS cube based on the a date value selected by user. I have a dimension table containing contract related informations e.g. 

Contract    SignedOn     StartDate     Price     Profit   RecordValidFrom RecordValidUntil
1             10.01.2018   10.01.2018   200        5         10.01.2018        12.01.2018
1             10.01.2018   10.01.2018   300       10        13.01.2018             NULL
Formula for calculated column is e.g. Price+Profit*(ParameterDate-StartDate)
In my fact table I have. 

FactId ContractID   Price   Profit   CalculatedColumn
1            1             200     5              at run time
2            1             300    10             at run time

Requirment is that the user selects a date as a parameter and the 'CalculatedColumn' gets populated based on the value selected in parameter + RecordValidFrom<= ParameterDate & RecordValidUntil >= ParameterDate. 

E.g. if the user selects 11.01.2018 as parameter then record 1 should get displayed and the calculated column should have 200+(5*1) = 205

if the user selects 15.01.2018 as parameter then record 2 should get displayed and the calculated column should have 300+(10*5) = 350. 

I can achieve this through SSRS. However, I wanted to know if I can pre-calculate this within the cube instead of doing it in SSRS. 

Any help in this regard would be highly appreciated. Thanks in advance. 

Best Regards,

Ali


SSAS Multidim - Detect if a user use filter on Excel ?

$
0
0

Hello,

I have a problem with my cube, and I need some help...

My client use Excel as reporting tool.

I would like to create a calculated measure and my issue is that I want to do something different when the user put an attribut in filter.

I checl with a profiler and it's seems that when the user do filter, the query behind that is a WHERE clause.

My example : 

Calculated Measure : A * B 

When the user use filter :  A * B (filter on category C)   I want to change the calculation to ===>   A * Z (only on that filter).

I explore the SCOPE() instructions but I don't find any answer...

It's possible to detect if the user use a filter ?

Thanks you in advance.

Ratanou

MDX Calculated Member PeriodsToDate / Sum / IsEmpty very slow

$
0
0

Hi,

I wonder if anyone could help me, I've been battling with a cube issue for a good few weeks no, no amount of googling or general trying different things seems to help.

We have a calculated cube measure (SSAS 2014) with this definition :

iif(isempty([measures].[Gas]),null,SUM(PERIODSTODATE([Year Calendar Year].[(All)]),[Measures].[Gas]))

It simply creates a cumulative total for the Gas measure but stops producing results after there no longer years with any Gas assigned to them.

If used with several cross joins (6 in the case of the query causing the problem) and about 1000 rows of data (approx based on the views that support the cube) it sends SSAS into melt down and the server pretty much crashes. It does this in every environment and I can reproduce on my local machine.

I've tried rewriting the calculation in many ways, if I remove the isempty function it works ok.

Things I've tried :

Using the "non-empty behaviour" is visual studio, I thought for a while that was the magic bullet but this doesn't seem to do anything.

Creating a measure that had 1 or 0 for the Gas measure and using that instread of isempty, same issue.

I've had some luck forcing the calculation down to the view that populates the cube but it's very tricky and would require a lot of rows to support the above as you can rollup at any mix of dimensions.

I've googled this and read everything I can but I just can't find a solution.

Any takers ?

Thanks,

Andy



Viewing all 14337 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>