Link to home
Start Free TrialLog in
Avatar of Daniel Djuracic
Daniel Djuracic

asked on

SSAS Calculated Measure Using Link Member

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
Avatar of lcohan
lcohan
Flag of Canada image

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?
Avatar of Daniel Djuracic
Daniel Djuracic

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of Daniel Djuracic
Daniel Djuracic

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Workaround provides required result.