When you say that there are fact table rows where the UnitBuys column is
null, I suspect that [Measures].[Unit Buys] in the cube is not empty in
those cells. For example, if you defined [Unit Buys] as a "Sum
Aggregation" measure on the "UnitBuys" column in the fact table, [Unit
Buys] would aggregate to 0, not empty, where "UnitBuys" is null.
This earlier post gives you some work-around options:
http://groups.google.com/groups?hl=e...8&selm=3C6D2C7
B.43074146%40dsslab.com
Quote:
|
From: George Spofford (george (AT) dsslab (DOT) com)
|
Subject: Re: NULL values in fact table with NUMERIC data type handled
incorrectly
View: Complete Thread (5 articles)
Original Format
Newsgroups: microsoft.public.sqlserver.olap
Date: 2002-02-15 08:48:36 PST
What you are seeing is a limitation of MS OLAP. (Various resources say
that
Analysis Services doesn't store empty cells; NULL measures is a case
where this
is still true albeit not in the spirit of the statement, because they
convert
NULLs to zeroes.)
There are three workarounds, which will both impact cube size and query
processing time somewhat but probably not in any meaningful way:
1) create two separate cubes, with one measure in one cube and the other
measure
in the other cube. Combine them in a virtual cube. This virtual cube
will have
appropriate NULLs
2) pivot the measures and add a dimension called something like
"measurement
type". This dimension will have two rows/members, for pressure and
temperature.
A single measure called "value" can hold the readings. You can do a
little work
with views and the one new dimension table so that you don't need to
change the
tables you already have.
3) add a measure to the cube whose column expression is the column for
temperature and whose aggregation function is COUNT. My recollection is
that the
COUNT aggregation will only count up non-NULL values. You can take
accurate
averages using this COUNT. Then, add a calculated measure for display
whose
expression is:
iif (
[Measures].[Temperature Count] > 0,
[Measures].[Temperature Count],
NULL
)
and hide the original temperature measure. Now, users will see NULLs in
the
right place.
Not sure which one of these is truly better- my bias would be to opt for
workaround #1.
HTH
- Deepak
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!