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

Query Performance on Case statement

$
0
0

Hello ,

   Can anyone kindly suggest how can I improve the below query .

WITH
SET [AS] AS
TOPCOUNT(CASE 'MF' WHEN  "MF" THEN [MANUFACTURER].[Manufacturer].ALLMEMBERS WHEN "R" THEN [Geography].[State].ALLMEMBERS WHEN "C" THEN [Product].[OTC1].ALLMEMBERS END,20,(CASE 'MT'
WHEN "MT" THEN [Measures].[Indirect Universe Retail Value]
WHEN  "WT" THEN [Measures].[Indirect Retail Value] END))
select [AS] on 0 from Cube

Presently its takes around 25 sec to run would like to get it down by 10 sec.

Regards,

Bharath


How to do Year to Date over a specified set of customers?

$
0
0

Scenario : Perform YTD on measure total score of patients for every doctor and display the measure by months, but the condition is to only include patients who have had a visit within that month. 

For example, Doctor A has total 10 patients but only 8 patients have visits in Jan, all 10 in Feb, and 6 in March. While performing YTD for this doctor, we only have to consider 8 patients for Jan, 10 for feb and 6 for March. 

We tried to create a set to identify patients with visits by selected months using following :

With SET PatientVisits AS 

EXISTS(([DimDate].[Calendar].currentmember,[DimPatient].[Patient ID],members),Measures.[Visits])

But we have trouble getting period to date or YTD function to work over this set along with date hierarchy to get total YTD of Measures.[TotalScore]. 

DimDate has date hierarchy Calendar with levels Year and YearMonth. 

Patient ID in DimPatient identifies unique patients. 

Measures.Visits and Measures.TotalScore are measures. 

Any help is appreciated! Let me know if I need to provider any more information or clarification.

Thank you!



Hope this Helps!

Measure needs to be created using Dimension Attributes and then the measure attribute needs to be linked to other Measure groups for slicing and dicing

$
0
0

As per current design there are three Measure Groups (FACT 1,FACT 2 and FACT 3) and a Dimension (DIM_SHIFT). Please refer the screen shot attached below :

1. Now the requirement is that the two measures needs to be created from Dimension "DIM_SHIFT" using the attributes of the dimension. Please suggest how to implement the logic to fulfill the requirement

2. I have a logic but I do not know whether I should proceed in this direction or not . It is as follows:
a. I was thinking to created a SQL view of the Dimension and make it as source for both Dimension and Fact in the Cube.

Please guide with your suggestions so that I can proceed in the right direction

GUID data type attribute contain addational square brackets

$
0
0

Hi All,

i have a attribute empid in dimension, this attribute data type in physical table is GUID, but when i browse in cube it's adding additional  square brackets

Regards,

Manish

MDX - Subtotals not correct using Descendants , Leaves

$
0
0

Hi all,

I have a calculated member that calculates the number of active POS based on the usage of the POS hierarchy.

The hierarchy is designed as followed 

North

  • Antwerp
  • Gent ...

South

  • Brussels
  • Liege ...

The problem is that if I filter on something, lets say only Antwerp, the cube shows for example :

Antwerp 5

Subtotal North 200

Grand total (north & south) 500

So even though I only selected Antwerp, the cube shows me the total of Antwerp, Gent etc. Is there anything I can change to my measure?

COUNT(
    FILTER(
    Exists(Descendants([Point Of Sale].[POS Hierarchy].CurrentMember,, LEAVES), [Measures].[Sales amount])
    *[Point of sale].[Status].&[A]
    *[Product].[Game type].&[ONL]
    ,[Measures].[Sales amount] <> 0
)
)


SSAS CUBE LIMITATIONS

$
0
0

Hi,

Could you please let me know ssas cube limitaions.

In my db we have 80 gigs data.so we need to create cube.

does it support  mdx performance better?

or give me some other tools for giving better performance.


indu

Calculation that excludes filters

$
0
0

Hi all, thank you in advance for having a look at this....

I'm trying to calculate the average number of sick days per person so that it can be broken down by person role or department or some other dimension.

I have a calculation for sick days that works ok and is [measures].[sick days]

I'm trying to create another calculation that is [total staff] but it doesn't work. My final calculation will be [avg sick days] =  [measures].[sick days] / [measures].[total staff]

The bit I can't get to work is making it ignore any filters. For example I have a measure called [staff] and as you would expect it can be broken down by [person].[role] or [department].[department]. I'm trying to get [total staff] to return the total when it's used with [person] or [department]. I've managed to get it to work with [person] by using ROOT([Person]) but then I will need to do this for all different hierarchies that will use it. I tried to use a scope statement but I couldn't get it to work. Is there an easy way to do this?


Brian Searle

How to use the Stored procedure in SSAS to combine result from more than two cubes

$
0
0

Hi,

Recently started working on the SSAS, i am looking to find is there a way in which following can be achieved.

I have two cube and i would like to get data from both cube and combine the results from both cubes to get final result to display result in SSRS reports like we can do in Stored procedure using temporary tables/Joins.

Is there any way in SSAS to combine the data from multiple cubes? Data needs to be retrieved from the cubes based on the user inputs

Thanks 


Unary Operator not working in Ragged Utility dimension (not parent child)

$
0
0

Hi all,

I have a disconnected utility dimension with the following data and a waterfall->subwaterfall hierarchy. I have ignore if same as parent set on sub water fall. The unary operator is assigned to the relevant level

WaterFallWaterFallUnarySubWaterFallSubWaterFallUnary
Opening~Opening~
Price~Price~
Total Composition~Composition L1+
Total Composition~Composition L2+
Total Composition~Composition L3+
Total Composition~Composition L4+
Total Composition~Composition L5+
Closing~Closing~


I'm using MDX to set values to the members

SCOPE(Measures.Waterfall,[Dim Waterfall].[Water Fall].&[Price]);
    THIS=Measures.LowestPrice;
END SCOPE;

SCOPE(Measures.Waterfall,[Dim Waterfall].[Sub Water Fall].&[Composition L1]);
    THIS=Measures.[Composition L1];
END SCOPE;

SCOPE(Measures.Waterfall,[Dim Waterfall].[Sub Water Fall].&[Composition L2]);
    THIS=Measures.[Composition L2];
END SCOPE;

SCOPE(Measures.Waterfall,[Dim Waterfall].[Sub Water Fall].&[Composition L3]);
    THIS=Measures.[Composition L3];
END SCOPE;

SCOPE(Measures.Waterfall,[Dim Waterfall].[Sub Water Fall].&[Composition L4]);
    THIS=Measures.[Composition L4];
END SCOPE;

SCOPE(Measures.Waterfall,[Dim Waterfall].[Sub Water Fall].&[Composition L5]);
    THIS=Measures.[Composition L5];
END SCOPE; 


But when i run a simple select query

SELECT
{[Measures].[Waterfall]} ON COLUMNS,
[Dim Waterfall].[Water Fall].[Water Fall] ON ROWS
FROM [GPA]

I only get a value for price. Total Composition is NULL. If I change my query to look at the subwaterfall level then I see values for composition L1->L5, so I know there are values there

I was expecting the unary operator to aggregate my composition measures into Total Composition.

I should point out that every measure that's being assigned to my utility dim is calculated with in excess of a dozen or so steps and intermediate calcs, is this causing some kind of solve order issue?

I know that as a workaround i could probably do something like

SCOPE(Measures.Waterfall,[Dim Waterfall].[Water Fall].&[Total Composition]);     
    THIS=SUM([Dim Waterfall].[Hierarchy].[Water Fall].&[Total Composition].Children,Measures.Waterfall);     
END SCOPE;

but that defeats the purpose of the unary operators

Any hints?

this is sql server 2014 multidimensional

cheers,

Jakub


Jakub @ Melbourne, Australia Blog

Advices related with the arquitecture

$
0
0

Hello

Right now I am finding information about the best option for building a solution relating with Datawarehouse and the use of Analisys Services Tabular Project, but I don't have clearly some points:

1) In my case I will take the information from a OLTP SQL Server Databases and other resources, the idea is put the "purified" information of the Datawarehouse in this new Server, but It would be a OLTP SQL Server Dabase or it's required another specification.

2) I will work with SQL Server Analisys Services Tabular Project, is a good choice? In my case I will get only statistics related with count and agregated information through a measure.

Is a problem (performance, etc) if a put in the same Server both instances, one with SQL Server Database for Datawarehouse and another with the Analisys Services Tabular Project.

Someone has examples related with LINQ to DAX nugget.

Many Thanks with your information and support.


"How many years can some people exist before they're allowed to be free" Bob Dylan Email: info@geohernandez.com Blog: geeks.ms/blogs/ghernandez

Common attribute in two many-to-many dimensions

$
0
0
Current design is as follows: we have a Sales fact table, and the two dimensions relevant to the question are Product and Address. We have a many-to-many relationship between Products and Product Groups, no problems here. Another many-to-many relationship is between Addresses and Sales Teams, straightforward as well. However, each Sales Team works with only one Product Group (an N:1), and what we're struggling to achieve is to calculate for each Sales Team the amount of sales of products from its product group to addresses it's responsible for. Unfortunately Carthesian product of Products and Addresses would be way too many millions of records, so we're primarily looking for a calculated measure, but are willing to consider design improvements.

Dimension Data Security in a cube

$
0
0

Hi Everyone,

I am designing a BI project that will use Excel and PowerView in SharePoint for reporting, and I want to implement a security in the cube.

I want the security to be able to hide attributes that are not related to user (e.g. based on department)

For instance, 

Employee Name          Department             Salary

Smith Adams               Finance                   10,6000

Kate Henz   Finance                   20,0000

XXXXXX                     Sales                       15,0000

XXXXXX          Operations               12,9900

XXXXXX                       IT                         12,4000

So in this case, the Employee Name marked XXXXX will not display for someone who does not have access to names of employees in that department.


me

Linking Multiple Fact Table at different grains to same dimensions

$
0
0

Hello Folks,

I am seeking your advice on dimensional modelling problem I have.

I am modelling two fact tables of Actuals and Budget which are at different granularity, Actuals are at day, customer and product sub category level. Budgets are at month, Region and Product catgeory level.Month, Region and Product Category is present in Date, Region and Procut Category dimension respectively. I have only three dimensions as Customer, Product and Date. Linking those dimensions to Actual Fact table is not an issue, what is the best way and options are there to link budget fact table to those three dimensions.

Please advise.

Regards,
Haroon

LastNonEmpty issue

$
0
0

Hi guys,

I have a big issue with a LastNonEmpty. Please help!

My cube has one measure with LastNonEmpty and a Hierarchy with 3 levels.

For a report I have to write something like this:

"Do the LastNonEmpty on the leafs (level 3) for a given period, then sum up these values to the parent levels (level 2 and level 1)"

Basically, the mdx will have level 2 members on the rows, and these sums on the columns.

How can I do this?

I've tried this but its not working:

WITH
MEMBER test1 AS AGGREGATE((DESCENDANTS([Dimension].[Hierarchy].CURRENTMEMBER, 2)), [Measures].[Value])
SELECT	test1 ON COLUMNS
		, NON EMPTY [Dimension].[Hierarchy].MEMBERS ON ROWS
FROM	[CUBE]
WHERE	([Time].[YM].[Month Name].&[201501]:[Time].[YM].[Month Name].&[201507])

Backup Analysis Services Database

$
0
0

I am having an issue backing up SQL Server Analysis services Databases.  I have seen some threads on ensuring SQLServerAgent service account has write access to the folder containing the backup, be a sysadmin in SQL Server Instance, and be a server administrator in SSAS.  All are currently set.  An receive access Denied when backing up the database via SSMS, or via powershell using SMO/AMO.

One thing that is odd, I can Backup the SSAS Databases to the folder containing the OLAP Logs without any problems, and the permissions are even more restrictive.

I have other servers where we backup the SSAS databases just fine, and the Folder permissions, Database and SSAS are the same.  It's just 2 or 3 servers that we are having an issue, and we don't understand why.

In the grand scheme of things what permissions are required to successfully backup SSAS Databases?

SQL Server Instance Permissions

SQL Server Analysis Services Permissions

File and Folder Permissions

Any other type of permission not mentioned above

Any information would be appreciated.

DJ


Connection forcibly closed - while initiating conneciton between app and cube server

$
0
0

Hi

We are getting an error while connecting and initiating a process from app server to cube server.

Error: System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

any help would be appreciated.

Thanks

Karthick

Rownumber

$
0
0

Hi,

I'm working with DAX and I have the following use case:

user and orders

I would like to know the total amount (ordered) according to what n-th order it is per user. In words: 100 for the 1st order, 190 for the 2nd order, 180 for the 3rd and so on.

Logically I think I need to give each order it's "row" number partitioned by user order by date (that's how I'll do it with SQL). 

How can this be done with DAX ?

Installation of SQL Server 2008 MDX Step By Step MDX Sample

$
0
0

Hello,

I'm having trouble installing the sample from the SQL Server 2008 MDX Step By Step MDX Book.

I downloaded the sample data file from http://go.microsoft.com/fwlink/?LinkId=139491

which created a directory called:

C:\Microsoft Press\MDX SBS\Setup\SQL Server

I tried attaching the MdxStepByStep.mdf database, using the script

Msg 5173, Level 16, State 1, Line 1

One or more files do not match the primary file of the database. If you are attempting to attach a database, retry the operation with the correct files.  If this is an existing database, the file may be corrupted and should be restored from a backup.

Log file 'C:\Microsoft Press\MDX SBS\Setup\SQL Server\MdxStepByStep_log.LDF' does not match the primary file.  It may be from a different database or the log may have been rebuilt previously.

Msg 1813, Level 16, State 2, Line 1

Could not open new database 'MdxStepByStep'. CREATE DATABASE is aborted.

I've tried copying the file to the SSAS subdirectory and attaching, but no luck either.

Any ideas?

Thanks,


John

Olap design _Card

$
0
0

Hello friends 

  Need Help , i do have a sales BI Application working  . i need to implement the Card Details in my BI Application 

I do have a fact table F1 . that is calculating the sales of the salesman as well date wise. Now i need to implement the Point of sales details also . i need to implement the credit card details also . so that the data can be analysed

Where to implement the Credit card details (credit card Number,Type,Amount, etc details ) should i implement it in a new  Dimension Table  (getting all the credit card Numbers from source table ), in Fact table (but in this case i dont need any aggregations on Card Basis) or a Fact generated dimension.

Please help /Suggest


TAIL issue

$
0
0

Hi guys,

I have this type of a member that takes too long to run:

MEMBER test AS SUM(DESCENDANTS([Dim].[Hierarchy].CURRENTMEMBER, 2),
TAIL(NONEMPTY({[Date].[Date].&[201406]:[Date].[Date].&[201407]} * [Measures].[Total Market Gross Sales])).ITEM(0))

How can I change it to run faster without moving date filter on WHERE clause?

Thanks!

Viewing all 14337 articles
Browse latest View live


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