SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


mdx calculated measure issue


mdx calculated measure issue

Author
Message
niha.736
niha.736
SSC Veteran
SSC Veteran (218 reputation)SSC Veteran (218 reputation)SSC Veteran (218 reputation)SSC Veteran (218 reputation)SSC Veteran (218 reputation)SSC Veteran (218 reputation)SSC Veteran (218 reputation)SSC Veteran (218 reputation)

Group: General Forum Members
Points: 218 Visits: 233
Hi everyone,

I have wriiten 2 calculated measures for my cube..
my cal measures are:

create member [Measures].[A]
as
iif([measures].[sales]=0,NULL,
[measures].[Latencydays]/[measures].[sales]),
visible=1

create member [Measures].
as
iif([measures].[Responses]=0,NULL,
[measures].[Latencydays]/[measures].[Responses]),
visible=1

but results are different from database to cube..
those are...

[b]below result is from DB:

avgsaleslatency avgResplatency latency days sales responses
Null Null 0 Null Null
15 Null 15 1 Null
Null 23 23 Null 1


cube result

latencydays sales responses avgsaleslatency avgresplatency
38 1 1 38 38

but as aggregate is sum for latencydays it showing the results as below:

But Here what the expected result is :

avgsaleslatency avgresponseLatency
15 23


can anybody correct me, if my measure are wrong or if there is any other way to fix it..



Thanks in advance,
Niharika
PB_BI
PB_BI
SSCarpal Tunnel
SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)

Group: General Forum Members
Points: 4496 Visits: 2745
Hi,
It's a little hard to tell without knowing your data structure but it seems as if your measure called "LatencyDays" needs to be split via a dimension.
It looks as if what your cube is reporting is correct in that it's summing up ALL of your latency days (15+23=38) without the context of a dimensional member to slice it by.

So, say you had a dimension that was joined to whatever measure group your LatencyDays measure is in, let's call it LatencyType and assume it has one attribute called LatencyType. Then your calculated measure would look like this:

MEMBER [Measures].[SalesLatency]
AS
SUM([LatencyType].[LatencyType].&[Sales], [Measures].[LatencyDays])



Hope this helps :-)




I'm on LinkedIn
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search