Showing posts with label aggregate. Show all posts
Showing posts with label aggregate. Show all posts

Sunday, March 11, 2012

AS2005. Distinct count meausure + aggregate seems to be a bug.

Look at following Query

-- the first query

with

member [Promotion].[Promotion Category].[No Discount und Reseller] as

aggregate({[Promotion].[Promotion Category].&[No Discount], [Promotion].[Promotion Category].&[Reseller]}, Measures.CURRENTMEMBER)

SELECT ADDCALCULATEDMEMBERS([Promotion].[Promotion Category].members)

ON COLUMNS,

CROSSJOIN({[Product].[Category].[All Products],[Product].[Category].[All Products].children},

{[Measures].[Customer Count],[Measures].[Internet Sales Amount]})

ON ROWS

FROM [Adventure Works]

--and the second query

with

member [Promotion].[Promotion Category].[No Discount und Reseller] as

aggregate({[Promotion].[Promotion Category].&[No Discount], [Promotion].[Promotion Category].&[Reseller]}, Measures.CURRENTMEMBER)

SELECT ADDCALCULATEDMEMBERS([Promotion].[Promotion Category].members)

ON COLUMNS,

CROSSJOIN({[Product].[Category].[All Products],[Product].[Category].[All Products].children},

{[Measures].[Customer Count]})

ON ROWS

FROM [Adventure Works]

The first query gets wrong result for the distinct count measure, the second one gets the right result.

I have tested it against build 2184 and buld 2195. Both have the same result.

Is the bug already fixed in SP2?

Yes, the problem was fixed in SP2. A public CTP release is scheduled to come out in a few weeks.|||

It would be more exectly if you wrtie "is scheduled to come out in a few weeks - 1", because you wrote more then a week ago the same words "a public beta release is scheduled to come out in a few weeks."

|||Nothing has changed to the release schedule since last time but unexpected things could happen before the software is actually released. Just don't want to promise you a specific date since it is out of my control, or any individual's control for that matter.

AS2005. Distinct count meausure + aggregate seems to be a bug.

Look at following Query

-- the first query

with

member [Promotion].[Promotion Category].[No Discount und Reseller] as

aggregate({[Promotion].[Promotion Category].&[No Discount], [Promotion].[Promotion Category].&[Reseller]}, Measures.CURRENTMEMBER)

SELECT ADDCALCULATEDMEMBERS([Promotion].[Promotion Category].members)

ON COLUMNS,

CROSSJOIN({[Product].[Category].[All Products],[Product].[Category].[All Products].children},

{[Measures].[Customer Count],[Measures].[Internet Sales Amount]})

ON ROWS

FROM [Adventure Works]

--and the second query

with

member [Promotion].[Promotion Category].[No Discount und Reseller] as

aggregate({[Promotion].[Promotion Category].&[No Discount], [Promotion].[Promotion Category].&[Reseller]}, Measures.CURRENTMEMBER)

SELECT ADDCALCULATEDMEMBERS([Promotion].[Promotion Category].members)

ON COLUMNS,

CROSSJOIN({[Product].[Category].[All Products],[Product].[Category].[All Products].children},

{[Measures].[Customer Count]})

ON ROWS

FROM [Adventure Works]

The first query gets wrong result for the distinct count measure, the second one gets the right result.

I have tested it against build 2184 and buld 2195. Both have the same result.

Is the bug already fixed in SP2?

Yes, the problem was fixed in SP2. A public CTP release is scheduled to come out in a few weeks.|||

It would be more exectly if you wrtie "is scheduled to come out in a few weeks - 1", because you wrote more then a week ago the same words "a public beta release is scheduled to come out in a few weeks."

|||Nothing has changed to the release schedule since last time but unexpected things could happen before the software is actually released. Just don't want to promise you a specific date since it is out of my control, or any individual's control for that matter.

AS2005. Aggregate - Last Argument = Bug?

Hi,

some people say that the function aggregate() perfoms quicker without last argument. It's right.
But witout last argument it can returns wrong result. It is nasty :-(

For example

WITH
member [Date].[Calendar].[Column 0] as AGGREGATE({
[Date].[Calendar].[Month].&[2004]&[1],
[Date].[Calendar].[Month].&[2004]&[2],
[Date].[Calendar].[Month].&[2004]&[3],
[Date].[Calendar].[Month].&[2004]&[4],
[Date].[Calendar].[Month].&[2004]&[5],
[Date].[Calendar].[Month].&[2004]&Devil,
[Date].[Calendar].[Month].&[2004]&[7],
[Date].[Calendar].[Month].&[2004]&Music}
)
--, Measures.CurrentMember)

SET [RowSet0] AS {[Customer].[Customer].[All Customers].children}
SET [RowSet1] AS topcount([RowSet0],100,([Date].[Calendar].[Column 0],[Measures].[Internet Sales Amount]))
SET [TotalSet] AS [RowSet1]

SELECT {[Date].[Calendar].[Column 0]} ON COLUMNS,
CROSSJOIN({[Customer].[Customer].[All Customers],[RowSet1]},{[Measures].[Internet Sales Amount], [Measures].[Internet Order Count]})
ON ROWS
FROM [Adventure Works]

I wonder... is this the same problem as I describe here:
http://cwebbbi.spaces.live.com/blog/cns!7B84B0F2C239489A!889.entry
? Looks very much like it. In which case it's a feature and not a bug, but I agree, it's a pretty confusing one and something that does need to be changed.

Chris