Friday, March 9, 2012

Problem MDX query and topcount

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].All
Members), 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
Message posted via http://www.droptable.comtry removing NON EMPTY to see if you see all the rows...
I think there are non matching rows in your dimensions.
"Tobias via droptable.com" wrote:

> 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
> --
> Message posted via http://www.droptable.com
>

No comments:

Post a Comment