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

Cube Calculated Measure, dependant on attribute value

$
0
0

Hi Folks,

I am struggling with a cube problem and i would greatly appreciate some assistance.

For simplicity the problem can be summarised as this: I have a fact table with a Measure, Delta and a FK to a Term

dimension.  In Term_dim i have term number and max term number for items:

Term dim:

Key Item Term MaxTerm
1      Oil        1      3
2      Oil        2      3
3       Oil       3       3
4       Oil       4       3
5       Oil       5       3
6       Gas       1       2
7       Gas       2       2
8       Gas       3       2
9       Gas      4       2


The fact table has a Delta for every Term for every Item.

The user wants to see Delta for all these, but also an additional Measure in the cube called DeltaMaxTerm.  The

definition of  DeltaMaxTerm is

DeltaMT = (If Term is < MaxTerm THEN Delta), (If Term > MaxTerm THEN NULL), (IF Term = MaxTerm THEN SUM(Delta where

Delta >= MaxTerm)

I cannot modify the fact table or dimension table directly (i have no control over the ETL or underlying data structures), except through named queries and calculations in the DSV.

I feel that the answer lies in Calculated Measures, but i cannot quite figure out how to do it.

Should I add a hidden property or attribute to the dimension like IsMaxTermFlag, or GreaterThanMaxTermFlag? Should i set an attribute

relationship between these flags? how would I use this in the calculated measure expression to get the desired results? There are no hierarchies in this

dimension that the user wants to see, he only wants to see a list of items and term numbers.


Any ideas would be grately appreciated!

Thanks

Guy


Guy


Viewing all articles
Browse latest Browse all 2472

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>