MDX Sum all values from one dimension hierarchy -
i´m new mdx. work team system cube team foundation server in visual studio business intelligence environment. questions sounds easy don´t know solution.
1) have field has datetime datatype. 1 dimension of field (hierarchy week) use show calendar weeks in report. have second field has integer datatype (it´s measure). created datasets , looks @ moment:
- week 1: 50
- week 2: 34
- week 3: 46
- ...
- week n: nn
i understand allocation of values in second field , depending of values on dimension. requirement, sounds quite simple: need sum of field values following table:
- week1: 200 (54+34+46+...)
- week2: 190
- week3: 186
if try sum there no changes.
iif(isempty([measures].[remainingworkproductbacklogitem]) or not mid([work item]. [plannedweek__hierarchybyweek].currentmember.uniquename,58,10) <= format(now(), "yyyy-mm-dd"), sum( [measures].[remainingworkproductbacklogitem]),null)
(the mid function shows actual values, shouldn´t play role here.)
i tried ytd function combined sum function didn´t succeed, still no changes (it shows null). there functions can use or must make changes in cube?
2) further question in general: if have 2 fields (both datetime) 2 different dimensions, possible arrange mapping? e.g.
dimension1:
- week1: data
- week2: data
- week3: data
dimension2:
- week2: data
- week3: data
both dimensions contain week2 , 3. report oriented on dimension1, possible show data dimension2 too? (i´m sure must possible, searched in cube options didn´t find it).
thank in anticipation
eugen
1) ytd
works correctly if label time dimension (it must whole dimension, not attributes of dimension time, , give correct type attributes of dimension. type configured dimension attributes type
property in bids. , works first such dimension of cube. use like
sum(ytd([dim time].[plannedweek__hierarchybyweek].currentmember))
or
sum(ytd([dim time].[plannedweek__hierarchybyweek].currentmember), [measures].[remainingworkproductbacklogitem])
2) should have 1 time dimension attributes year, quarter, month, week, day, weekday, etc. (you not need of these, some) in cube. not mix other attributes. reference there without further effort. see no problem linking several fact tables dimension. , able apply ytd
function well, have 1 time dimension.
mdx can hard if have wrong cube design, harder sql wrong table design.
Comments
Post a Comment