dbTalk Databases Forums  

MDX for across level aggregation ?

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


Discuss MDX for across level aggregation ? in the microsoft.public.sqlserver.olap forum.



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

Default MDX for across level aggregation ? - 08-09-2003 , 12:54 AM






Is the below possible in Analysis services? How do I write MDX for this

Lets say Hierarchy is as below :-
Drugs
Brand (e.g Bayer, GV,Generic)
DrugName (e.g Asprin,PainReliever etc)

Measure = Unit Sales
Now asprin could be present across brands.
I want to see total asprin sales across brands. or regardless of brand
Is it possible to represent above query as MDX ?
Regards,
Akshay



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

Default Re: MDX for across level aggregation ? - 08-11-2003 , 05:18 AM







WITH MEMBER MEASURES.[Asprin sales] as
'SUM({[product].[drugname].MEMBERS},
(IIF([PRODUCT].Currentmember.name = "Asprin",MEASURES.[unit
sales], 0)))'
SELECT MEASURES.ALLMEMBERS ON COLUMNS from sales

not that the comparison of "IIF" is case sensitive.

I am assuming the name of the dimension of drugs is "product"

Please let me now if this worked or not.

Thanks,

Asim Naveed

--
Posted via http://dbforums.com

Reply With Quote
  #3  
Old   
Mosha Pasumansky [MS]
 
Posts: n/a

Default Re: MDX for across level aggregation ? - 08-18-2003 , 11:46 PM



SUM(Filter(DrugName.MEMBERS, Drugs.CurrentMember.Name = "Aspirin"),
Measures.[Unit Sales])

--
==================================================
Mosha Pasumansky - www.mosha.com/msolap
Development Lead in the Analysis Server team
All you need is love (John Lennon)
Disclaimer : This posting is provided "AS IS" with no warranties, and
confers no rights.
==================================================
"akshayk" <akshay349 (AT) hotmail (DOT) com> wrote

Quote:
Is the below possible in Analysis services? How do I write MDX for this

Lets say Hierarchy is as below :-
Drugs
Brand (e.g Bayer, GV,Generic)
DrugName (e.g Asprin,PainReliever etc)

Measure = Unit Sales
Now asprin could be present across brands.
I want to see total asprin sales across brands. or regardless of brand
Is it possible to represent above query as MDX ?
Regards,
Akshay





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.