Reporting Services aggregation does not work for parent-child relationships
I have a parent-child attribute relationship in an Analysis services dimension, say [Dim].[Child]
is a child [Dim].[Parent]
, and I have a query that returns a set
UNION(
[Dim].[Parent].Members * [Dim].[Child].Members,
[Dim].[Parent].[ALL] * [Dim].[Child].Members
)
on axis 1 and some output on axis 0. The query works fine when run in control studio.
Now I am trying to make a chart in Reporting Services with an [Dim].[Child]
x-axis and Aggregate(some_output)
a y-axis. I expect to see the children on the x-axis, with the result being aggregated for all parents (which is just one in this case), i.e. Data taken from a string { [Dim].[Parent].[ALL], [Dim].[Child].&[TheChildID] }
. As stated above, the query does indeed return this string with correct data.
However, the function Aggregate
returns NULL in this case. This behavior is always present when using the parent-child attributes and places the child on the x-axis. The same thing happens when placing the child on a tablix row and adding aggregated output to a column. The Reporting Server seems to know that the aggregation will only happen for one member and refuses to do so.
If I make another identical request, just put in the attributes that have different relationships, eg. [Time].[Month]
and [Time].[DayOfMonth]
, the aggregation works great, since on the same day on the same day many months can belong and the data must be aggregated.
Now I have no idea why this is happening. The report server is so actively querying the OLAP data source to figure out a relationship or what? Or is there some magic in the query that returns ALL rows that I am not aware of? The only correlation is for cases that work and that don't seem to be relationships.
EDIT: some observations after playing around: the report works if I remove the row [Parent].Members * [Child].Members
from the query, causing it to only fetch rows [Parent].ALL * [Child].&[ID]
. The chart is now aggregating the data, but obviously I no longer have individual members.
a source to share
Just a few observations that I hope will help.
- Aggregate function in Reporting Services requires a "scope" parameter ... eg Aggregate (Fields! Child.value, "ParentGroup")
- Your data provider must support this feature. If not, "Nothing" is returned. See link below ...
For more help / info check Aggregate documentation by function.
a source to share