I am writing my own MDX query inside Reporting Services, bypassing the graphic MDX generator.
Both MDX query and SQL query return identical results and both have detail level values and high level values.
During the flattenning process, null value from MDX is still null, but null value from SQL is translated into blank.
Thus only the MDX result works for Aggregate() function, not the SQL result. Because Aggregate() function is triggered by null value, not blank.
Someone suggested to use MDX stored procedure to do custom calculations. Thus my report is calling a MDX query, not a SQL query. I have tried this approach already, but MDX is not as flexible as SQL. For example, in SQL, I can easily join, pivot, order by, group by, filter...None of these is easy in MDX.
If I know how to make reporting services treat null as null or to make Aggregate() function be triggered by a blank value, then my problem is solved.
Does Aggregate() funciton only works with MDX, not SQL?
Thanks,
Bo Dong
bo_dong@.yahoo.com
The Aggregate() function only works in combination with a data extension that implements the IDataReaderExtension interface (see: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSPROG/htm/rsp_ref_clr_dataproc_9lit.asp).
The "Analysis Services" data extension available in RS 2005 implements this interface and internally detects aggregation rows based on nulls in hierarchies and exposes that information through the IDataReaderExtension interface.
Note: The "SQL Server" data extension available in RS 2005 does not implement this interface.
You can implement your own custom data extension (http://msdn2.microsoft.com/en-us/library/ms154655.aspx) and then implement the IDataReaderExtension interface - based on that you have full control in your custom data extension of how exactly aggregate rows from your relational query are marked.
-- Robert
No comments:
Post a Comment