dbTalk Databases Forums  

SELECT TOP

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


Discuss SELECT TOP in the microsoft.public.sqlserver.olap forum.



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

Default SELECT TOP - 08-12-2005 , 04:25 AM






Hi

I am new to MDX coming from SQL, basically what I what is to convert
this type of statement to MDX

-- Weighted Handling
SELECT [T2].*
FROM (
SELECT [BrandFamily],
[GlobalPlayer]
FROM (
SELECT *
FROM (
SELECT TOP 20 [BrandFamily],
[Volume]
FROM [Channel]
) [T1]
UNION ALL
SELECT *
FROM (
SELECT TOP 5 [BrandFamily],
[Volume]
FROM [Channel]
WHERE [GlobalPlayer] = 'GP'
) [T2]
UNION ALL
SELECT *
FROM (
SELECT [BrandFamily],
[Volume]
FROM [Channel]
WHERE [BrandFamily] IN ('A1', 'A2', 'A3')
) [T3]
) [Players]
) [T1]
INNER JOIN (
SELECT [BrandFamily],
[Value]
FROM [Channel]
) [T2]
ON .......

So basically I need to extract from the table the TOP 20 [Brand
Family], The TOP 5 [Brand Family] when the [Global PLayer] is 'GP' and
the [Brand Family] ('A1', 'A2', 'A3'). These are extracted based on
their Volume, I then link these in and extract the [Brand Family] with
their [Value]. (I appreciate that the SQL could be different but I had
to do it this way for a reason).

So basically I need to extract these specific [Brand Family].

WHat is the best way to do this in MDX

Thanks in advance for you help

This is a great group!!

Denver


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.