all groups > sql server data warehouse > march 2005 >
You're in the

sql server data warehouse

group:

Problem MDX query and topcount


Problem MDX query and topcount Tobias via SQLMonster.com
3/17/2005 2:03:28 PM
sql server data warehouse:
I have a little problem with a mdx query using topcount.

My query looks like:
SELECT
{SOMEMEASURES} ON COLUMNS,
NON EMPTY(TOPCOUNT([Dim1].AllMembers, 50, ONEMEASURE)) ON ROWS
FROM MyCube
WHERE ([Dim2].&[SomeValue])

The problem is that the query does not return all rows I expect (mybe 10,
but not more than 50). I think the problem is that the query-processor
first starts with topcount of all members of Dim1 and than filters on Dim2.
Here some extra information about my dimensions:
Dim1 is a regular dimension having two levels (All + 1)
Dim2 is a parent-child dimension

I decided to change my query to:
SELECT
{SOMEMEASURES} ON COLUMNS,
NON EMPTY(TOPCOUNT(CROSSJOIN({[Dim2].&[Value1]}, [Dim1].AllMembers), 50,
ONEMEASURE)) ON ROWS
FROM MyCube

But the same problem occours. I only get 8 instead of 10 results without
setting topcount.

Where is the problem ?

Thanks
Tobi

--
RE: Problem MDX query and topcount bc
3/19/2005 7:09:02 AM
try removing NON EMPTY to see if you see all the rows...
I think there are non matching rows in your dimensions.


[quoted text, click to view]
AddThis Social Bookmark Button