Search code examples
countmdxchildren

how count the selected children of a hierarchy


I'm in this situation. I have a cube that has data aggregated by day. This cube has a dimension with hierarchy (year-> month-> day). in this hierarchy are visible every day for the last 4 months.

my problem is counting the days selected, because I need to do calculations based on the days observed (on a pivot).

example: There are data for the day 11/11/2013 (amount orders), but in the hierarchy I select values from 10.11.2013 to 20.11.2013 ..

how do I calculate (amount orders) / 11?

11 is the number of days 10-20.


Solution

  • See my answer at MDX average fact items count by time dimension.

    Having the day count as a measure in the cube would automatically apply all filters etc. without you having to take care of it.