Solved

SSAS Calculated Measure Using Link Member

Posted on 2014-10-08
4
188 Views
Last Modified: 2016-02-18
Hello,

I have been trying to get a calculated measure working in SSAS to show the number of open records against a date dimension.

My fact table contains "Created Date" and "Resolved Date". Measure i am using is simply "Record Count".

I have 3 Date Dimensions "Created Date", "Resolved Date" and another with no relationships called "Open Date".

I have been able to get a Calculated Measure working using the following:

CREATE MEMBER CURRENTCUBE.[Measures].[Open Records]
 AS AGGREGATE(
    {NULL:LINKMEMBER([Open Date].[Year - Month - Date].CurrentMember
        ,[Created Date].[Year - Month - Date])}
    * {LINKMEMBER([Open Date].[Year - Month - Date].CurrentMember
        ,[Resolved Date].[Year - Month - Date]):NULL}
    ,[Measures].[Record Count])

When I utilise this measure in Excel i can open up year and month, but when I open date, it takes an exceptionally long time to run, however it does eventually complete (I estimate it takes at least 30mins).

Am i doing something obviously wrong or is there a better method I could be using to get the result I am after?

I am using SQL2014.

Thanks,
Daniel
0
Comment
Question by:Daniel Djuracic
  • 3
4 Comments
 
LVL 39

Expert Comment

by:lcohan
ID: 40380224
I believe that is because when you try to open it in Excel by the day it will have to count with a "GROUP BY" at that date part level and proper data type/indexes could help in this case.  Can you please check to see the underlying data type for the three date columns and to see if there are any indexes on them?
0
 

Author Comment

by:Daniel Djuracic
ID: 40381269
Thanks for the reply, the date dimension table had a Clustered Index on the Primary Key (which is a datetime) data type. I have added a non-clustered index to the "CreatedDateKey" and "ResolvedDateKey" fields with no effect.
0
 

Accepted Solution

by:
Daniel Djuracic earned 0 total points
ID: 40412314
I worked around the issue by creating a whole new cube based on a view. The view unions 2 versions of the fact table, 1 uses created date as "Open Date" and the other uses resolved date as "Open Date" it then has another field which is 1 when open and -1 when closed, summing this measure produces the required results.

SELECT        CreatedDateKey AS OpenDateKey, 1 AS OpenCount
FROM            [DataWarehouse].[dbo].[FactITSMRecords]
UNION ALL
SELECT        ResolvedDateKey AS OpenDateKey, - 1 AS OpenCount
FROM            [DataWarehouse].[dbo].[FactITSMRecords]

Open in new window

0
 

Author Closing Comment

by:Daniel Djuracic
ID: 40419068
Workaround provides required result.
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Hello, In my precious Article  (http://www.experts-exchange.com/Database/Reporting/A_15280-Create-Project-in-Microstrategy-Part-I.html)we saw the Configuration part for Microstrategy which included Metadata Creation and DataSource Preparation as …
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question