Quantcast
Channel: SQL Server Analysis Services Forum
Viewing all articles
Browse latest Browse all 2472

Problem with a calculated measure that needs to ignore a dimension

$
0
0

Hi all, any suggestions with this would be much appreciated. I’ve tried to explain this as concisely as possible to save your time but if you need more info please let me know.

The cube structure:

Dimensions: P&LAccount, Department and FinancialPeriod. Two measure groups one containing transaction values and another containing percentage allocations. The latter is used to calculate overheads. The percentage overheads measure group has a write back partition and the idea is the fact table is pre-populated with percentages, users can change them with write back. That part works fine and the bit I’m working on is creating the calculated measures that use the write back values.

P&LAccount, Department and FinancialPeriod have a relationship to the transactions measure group. Just Department and FinancialPeriod have relationships to percentage allocations measure group.

What I’m trying to do is:

For a FinalcialPeriod calculate the total for a particular set of account codes in P&LAccount on the transactions measure group, call this measure AdminCostForPeriod.

I then want to calculate Overheads across the departments by multiplying the percentage allocation (in the percentage allocation measure group) by the AdminCostForPeriod.

The problem is I want to use the measures with a query that’s using the department dimension. The AdminCostForPeriod is broken down across departments which is what you would expect (normally) but in this situation I just want the total. Is there a way of making the  AdminCostForPeriod ignore the department dimension?

I’ve read a post that seems to suggest this is possible using sets but I don’t understand how to apply that to my situation. The post is http://social.msdn.microsoft.com/Forums/eu/sqlanalysisservices/thread/f2bddd39-b7ce-429b-a1f6-beadc6cadc60

My example query with calculations:

with

member measures.[AdminCostForPeriod] as

(

([Profit And Loss].[Profit And Loss].[Admin expenses], [Measures].[STG Amount GL]) +

([Profit And Loss].[Profit And Loss].[T&S costs], [Measures].[STG Amount GL])

)

member measures.[OverheadsForDepartment] as

(measures.[AdminCostForPeriod] * ([Measures].[Period Department Percent]/100))

select

{measures.[AdminCostForPeriod], measures.[OverheadsForDepartment]} on 0,

[Department].[Business Line Breakdown].[Bussiness Line].members on 1

from [Reporting]

where [Financial Period].[Financial Period Breakdown].[Period].&[282]

The results are

AdminCostForPeriodOverheadsForDepartment
Dep1(386,212.11)(124,070.64)
Dep2(27,720.00)(735.13)
Dep3(70,787.53)(6,301.51)
Dep4(74,316.00)(7,852.23)
Dep5(417,103.16)(171,984.14)

AdminCostForPeriod should be the same value for each department then my calculation would work.

Happy Christmas…



Brian Searle


Viewing all articles
Browse latest Browse all 2472

Trending Articles