Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SSAS IDataReader Issue...

3 views
Skip to first unread message

brandontrabon

unread,
Dec 8, 2009, 3:30:47 PM12/8/09
to
I'm pulling data from an OLAP cube (SQL Server Analysis Services 2008) and am seeing a wierd issue. When I run the MDX query in Management Studio I get a value back in both fields being requested, but when the results come back in my IDataReader object only the first field has a value; the second field contains a null. I thought it might be an issue with the way I was using the data reader so I tried a simple test where I used the AdomdDataAdapter object to call the same MDX query and fill the results into a simple DataSet, but still got the same issue. The fields I'm trying to return are calculated members so I'm not sure if the problem is that I have two members defined at the top of my MDX or if something else is wrong. My MDX looks like the following below:


WITH
MEMBER [Measures].[Measure1] AS
'[Measures].[Calculated Field 1] + [Measures].[Calculated Field 2]'
MEMBER [Measures].[Measure2] AS
'[Measures].[Calculated Field 3] + [Measures].[Calculated Field 4]'
SELECT NON EMPTY
{
[Measures].[Measure1],
[Measures].[Measure2]
}
ON COLUMNS
FROM [MyCube]
WHERE
(
[Dimension1].[Dimension1 Value].[Dimension1 Value].[123],
[Dimension2].[Dimension2 Value].[Dimension2 Value].[456]
)
CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS

Then my code to load the data into the simple dataset looks like this:

AdomdDataAdapter tempAdapter = new AdomdDataAdapter(comm);
DataSet tempDataSet = new DataSet();
tempAdapter.Fill(tempDataSet);
AdomdDataAdapter tempAdapter = new AdomdDataAdapter(comm);
DataSet tempDataSet = new DataSet();
tempAdapter.Fill(tempDataSet);

The comm variable is an AdomdCommand object with the MDX query loaded into it. At this point if I look at the data loaded into the tempDataSet variable I will see that "Measure1" has a value while "Measure2" does not. Has anyone else ever run into an issue like this? Any clues or hints would be greatly appreciated.


Submitted via EggHeadCafe - Software Developer Portal of Choice
License ASP.NET Applications - Desaware vs Microsoft SLP
http://www.eggheadcafe.com/tutorials/aspnet/d7bad06f-dc88-4254-98ef-45699c35efd9/license-aspnet-applicati.aspx

Will Alber

unread,
Dec 8, 2009, 3:41:10 PM12/8/09
to
Hi Brandon - if you could send me a simple (small) cube with which to
reproduce this problem I'd gladly investigate - sounds like an interesting
problem, am thinking it could be down to connection settings, although this
is a long shot.

If you define the two calculations as constants instead of the sums e.g.

WITH
MEMBER [Measures].[Measure1] AS

'1'


MEMBER [Measures].[Measure2] AS

'2'
..

do you get both cells back and non-NULL?

<Brandon Trabon> wrote in message news:2009128153...@hotmail.com...

> __________ Information from ESET NOD32 Antivirus, version of virus
> signature database 4671 (20091208) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com
>
>
>

__________ Information from ESET NOD32 Antivirus, version of virus signature database 4671 (20091208) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


0 new messages