dbTalk Databases Forums  

Using aggregation with TopCount (PLEASE HELP!)

comp.databases.olap comp.databases.olap


Discuss Using aggregation with TopCount (PLEASE HELP!) in the comp.databases.olap forum.



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

Default Using aggregation with TopCount (PLEASE HELP!) - 10-14-2004 , 08:41 AM






I am trying to get subtotaling and totaling by dimension as well as
trying to apply ranking. I want the totaling to only include what
meets the ranking filter. I can seem to do it. I have tried the
following MDX. The subtotal line is corrent and the very last total
line is correct. But, the totaling in the "TOTAL" level of DATE is
wrong. Help!!!!

WITH
set [a] as 'nonemptyCROSSJOIN([CARS].[CAR].MEMBERS,[DATE].[DTE].MEMBERS)'
set [b] as 'ORDER({a}, ([Measures].[SALES_SUM]), DESC)'
set [c] as 'TopCount([b], 10, [Measures].[SALES_SUM])'

SET [Ca] AS '[CARS].[CAR].MEMBERS'
MEMBER [CARS].[All CARS].[SubTotal] AS 'AGGREGATE([ca])'
SET [CarsTOTAL ] AS '{[cars].[All CARS].[SubTotal]}'
SET [aa] AS '{[CA], [CarsTOTAL ]}'

SET [Da] AS '[DATE].[DTE].MEMBERS'
MEMBER [DATE].[All DATE].[Total] AS 'AGGREGATE([c])'
SET [DateTOTAL ] AS '{[DATE].[All DATE].[Total]}'
set [bb] as '{[da],[datetotal ]}'

set [rows] as 'nonemptyCROSSJOIN([bb],[aa])'

SELECT ({[Measures].[SALES_SUM]}) ON COLUMNS, [rows] ON ROWS FROM
MDDBCARS

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.