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


How do I calculate totals for a distributed measure in SSAS?


How do I calculate totals for a distributed measure in SSAS?

Author
Message
Hans Riis
Hans Riis
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 29
I'm not sure if this is the right place to post my question but here goes.

I have an OLAP cube consisting of quite a few tables.

In this scenario there's only reason to look at one fact table with costs.
This table constructed by a join in SQL with a table of distribution keys.
The purpose is to split costs across Company, Cost Center, etc.

The joining keys are Company, CostCenter, AccountGroup, DateFrom, and DateTo.

As such, the number of rows can be blown up a multitude of times.
If we look at a simple case with just one variable:

Cost Distribution Distributed Cost Count DistrCalc
Company A 100 0.8 80 1 0.8
Company B 200 0.2 40 1 0.2
Total 300 1.0 120 2 0.5

I need to show the Distribution figure in the cube.
I do that by dividing Distribution with Count as you can see in the final column in the table above, DistrCalc.

Here's the cube formula
Iif( [Measures].[Count] = 0 Or [Measures].[] is NULL
, NULL
, [Measures].[Distribution] / [Measures].[Count])

The Total of 0.5 for DistrCalc is clearly wrong. I should be 1.0 (or if not possible, NULL).

Since we use Excel as the frontend tool we could easily switch off totals but totals are relevant for other measures.

So how do I get around this problem?

I'm thinking that some sort of Scope statement could it. But it has to span across all the variables from the SQL join.

My level of expertise in MDX is unfortunately not very high, and Google hasn't provided me with a usable result.

Thank you in advance!
Hans Riis
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