dbTalk Databases Forums  

topcount help

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss topcount help in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
pmak via SQLMonster.com
 
Posts: n/a

Default topcount help - 08-28-2006 , 01:48 PM






I am using SQL 2005 AS and I have an olap cube with the "total costing" as
one of the "measure" and one diamension consisting with several attributes,
"account period", "product", "fiscal year" ... etc. I need to create a "Top
10 highest Cost Product" from this cube. As a result end-user can select any
"account period" or "fiscal year" and to find out the top 10 product cost.

Under the "Calculations" tab I created a new "named set" and called it "Top
10 Product Cost" and assigned the expression as follows:

TOPCOUNT([Pharmacy DW By Account Period].[Product].[Product],10,[Measures].
[Total Cost] )

Under the "Browser" tab I browsed the data on the cube and applied this new
named set to it, the result set does not match the number of records and some
of the records does not show up as to the result querying directly from the
table. Thanks

--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums...-olap/200608/1


Reply With Quote
  #2  
Old   
yongli
 
Posts: n/a

Default RE: topcount help - 08-29-2006 , 04:25 PM






The name set is not dynamic, it will always return the top 10 for all
periods. To achieve the dynamic nature, you need to dynamically define the
set within your MDX statement. For example

TOPCOUNT([Pharmacy DW By Account Period].[Product].[Product],10,([Measures].
[Total Cost], [fiscal year].currentmember )


"pmak via SQLMonster.com" wrote:

Quote:
I am using SQL 2005 AS and I have an olap cube with the "total costing" as
one of the "measure" and one diamension consisting with several attributes,
"account period", "product", "fiscal year" ... etc. I need to create a "Top
10 highest Cost Product" from this cube. As a result end-user can select any
"account period" or "fiscal year" and to find out the top 10 product cost.

Under the "Calculations" tab I created a new "named set" and called it "Top
10 Product Cost" and assigned the expression as follows:

TOPCOUNT([Pharmacy DW By Account Period].[Product].[Product],10,[Measures].
[Total Cost] )

Under the "Browser" tab I browsed the data on the cube and applied this new
named set to it, the result set does not match the number of records and some
of the records does not show up as to the result querying directly from the
table. Thanks

--
Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums...-olap/200608/1



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.