TOPCOUNT giving different results
- From: "Gautham Kamath via SQLMonster.com" <u9571@uwe>
- Date: Tue, 27 Feb 2007 11:04:30 GMT
The following are the three queries and their respective results that I tried
Against Adventure Works cube in Adventure Works DW SSAS database
Query 1:
Select [Measures].[Internet Sales Amount] on 0,
TOPCOUNT([Product].[Product Categories].[SubCategory].Members, 5,
([Customer].[Customer Geography].[Country].&[United States],[Measures].
[Internet Sales Amount])) on 1
from [Adventure Works]
Query 1 Results:
Internet Sales Amount
Road Bikes - $14,520,584.04
Mountain Bikes - $9,952,759.56
Touring Bikes - $3,844,801.05
Tires and Tubes - $245,529.32
Helmets - $225,335.60
Query 2:
Select [Measures].[Internet Sales Amount] on 0,
TOPCOUNT([Product].[Product Categories].[SubCategory].Members, 5, [Measures].
[Internet Sales Amount]) on 1
from [Adventure Works]
WHERE [Customer].[Customer Geography].[Country].&[United States]
Query 2 Results:
Internet Sales Amount
Road Bikes - $4,289,925.90
Mountain Bikes - $3,417,457.74
Touring Bikes - $1,292,475.90
Tires and Tubes - $88,769.73
Helmets - $76,768.06
Query 3:
Select ([Measures].[Internet Sales Amount], [Customer].[Customer Geography].
[Country].&[United States]) on 0,
TOPCOUNT([Product].[Product Categories].[SubCategory].Members, 5,
([Customer].[Customer Geography].[Country].&[United States],[Measures].
[Internet Sales Amount])) on 1
from [Adventure Works]
Query 3 Results:
Internet Sales Amount
Road Bikes - $4,289,925.90
Mountain Bikes - $3,417,457.74
Touring Bikes - $1,292,475.90
Tires and Tubes - $88,769.73
Helmets - $76,768.06
Query 2 and Query 3 return the correct results that I want (Top 5 Internet
Sales Amount for [Product SubCategory members in US) .
But Query 1 gets me the top 5 total of [Product].[Product Categories].
[SubCategory].Members despite the presence of the tuple ([Customer].[Customer
Geography].[Country].&[United States],[Measures].[Internet Sales Amount]).
Why is this happening? Any help is appreciated.
--
Message posted via http://www.sqlmonster.com
.
- Follow-Ups:
- Re: TOPCOUNT giving different results
- From: amish
- Re: TOPCOUNT giving different results
- Prev by Date: Re: Installed SSAS 2005 SP2 causes frequent crashes
- Next by Date: SUBCUBE issue
- Previous by thread: Re: Installed SSAS 2005 SP2 causes frequent crashes
- Next by thread: Re: TOPCOUNT giving different results
- Index(es):
Relevant Pages
|