dbTalk Databases Forums  

FoodMart 2000 TopCount question...

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


Discuss FoodMart 2000 TopCount question... in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
crw
 
Posts: n/a

Default FoodMart 2000 TopCount question... - 05-23-2005 , 01:05 PM






Hi all,
I need to calculate TopCount within TopCount based on the different
levels from the same dimension. Here is an example from the FoodMart
db:

WITH
SET [TOP 1] AS 'TopCount ([Customers].[City].members,
3,[Measures].[Unit Sales] )'
SET [TOP 2] AS 'Generate({[TOP 1]},TopCount (Descendants([TOP
1].currentmember, 1), 2, [Measures].[Unit Sales]))'
SELECT
{[Measures].[Unit Sales]} on columns,
{[TOP 1], [TOP 2]} on rows
from sales

As you can see, year and quarter are stored in one column - I need two
columns, one for year and one for qtr. So the result should be like:

City Name UnitSales
Olympia Name1
Olympia Name2
Olympia Name3


I tried to use CrossJoin but couldn't make it work.
Thanks


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.