dbTalk Databases Forums  

MDX Qury Very Much Urgent

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


Discuss MDX Qury Very Much Urgent in the microsoft.public.sqlserver.olap forum.



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

Default MDX Qury Very Much Urgent - 08-25-2004 , 09:51 AM






SELECT {
CrossJoin({Customer.[Customer_Type].[Local],Customer.[Customer_Type].[Upcoun
try]},{Measures.[Sales],Measures.[Last_Sales]})} ON COLUMNS,

{Filter
({CrossJoin({Market.[Country].[Pakistan]},{Product.[Team].[Cardiovascular
Team],Product.[Team].[Feldene Team],
Product.[Team].[Norvasc
Team],Product.[Team].[Others],Product.[Team].[Ponstan Team]})},
[Measures].[sales] > 900000000)}
ON ROWS


FROM [Sales]
CELL PROPERTIES [VALUE],[FORMATTED_VALUE],[CELL_ORDINAL]


The Above Query give a wrong result, the Filter is not working Properly i
think it is only Consider the Measure Value on the ROW axis I want to be on
Both of the Axis. Please Answer it Urgently.




Reply With Quote
  #2  
Old   
Martin Mason
 
Posts: n/a

Default Re: MDX Qury Very Much Urgent - 08-25-2004 , 09:20 PM






Try using the following on the Row Axis

UNION({Filter({CrossJoin({Market.[Country].[Pakistan]},{[Product].[Team].[Cardiovascular
Team], [Product].[Team].[Feldene Team], [Product].[Team].[Norvasc Team],
[Product].[Team].[Others], [Product].[Team].[Ponstan Team]}),
([Measures].[Sales], [Customer_Type].[Local]) > 9000000000)},

{Filter({CrossJoin({Market.[Country].[Pakistan]},{[Product].[Team].[Cardiovascular
Team], [Product].[Team].[Feldene Team], [Product].[Team].[Norvasc Team],
[Product].[Team].[Others], [Product].[Team].[Ponstan Team]}),
([Measures].[Sales], [Customer].[Customer_Type].[Upcountry]) > 9000000000)}
)

You may want to switch gears and use the NonEmptyCrossJoin function. Then
the UNION statement above can be simplified

{
Filter(NonEmptyCrossJoin({Market.[Country].[Pakistan]},{[Product].[Team].[Cardiovascular
Team], [Product].[Team].[Feldene Team], [Product].[Team].[Norvasc Team],
[Product].[Team].[Others], [Product].[Team].[Ponstan Team]},
{[Customer].[Customer_Type].[Local],[Customer].[Customer_Type].[Upcountry]},
2), ([Measures].[Sales]) >900000000)

HTH
Martin

"Burhan" <burhanist (AT) yahoo (DOT) com> wrote

Quote:
SELECT {
CrossJoin({Customer.[Customer_Type].[Local],Customer.[Customer_Type].[Upcoun
try]},{Measures.[Sales],Measures.[Last_Sales]})} ON COLUMNS,

{Filter
({CrossJoin({Market.[Country].[Pakistan]},{Product.[Team].[Cardiovascular
Team],Product.[Team].[Feldene Team],
Product.[Team].[Norvasc
Team],Product.[Team].[Others],Product.[Team].[Ponstan Team]})},
[Measures].[sales] > 900000000)}
ON ROWS


FROM [Sales]
CELL PROPERTIES [VALUE],[FORMATTED_VALUE],[CELL_ORDINAL]


The Above Query give a wrong result, the Filter is not working Properly i
think it is only Consider the Measure Value on the ROW axis I want to be
on
Both of the Axis. Please Answer it Urgently.






Reply With Quote
  #3  
Old   
Burhan
 
Posts: n/a

Default Re: MDX Qury Very Much Urgent - 08-27-2004 , 02:00 AM



OK the First MDX is Working Fine
But what if we have More Then 2 Sets does UNION works B/C it takes 2 Sets
Only



"Martin Mason" <martin.mason (AT) earthlink (DOT) net> wrote

Quote:
Try using the following on the Row Axis


UNION({Filter({CrossJoin({Market.[Country].[Pakistan]},{[Product].[Team].[Ca
rdiovascular
Quote:
Team], [Product].[Team].[Feldene Team], [Product].[Team].[Norvasc Team],
[Product].[Team].[Others], [Product].[Team].[Ponstan Team]}),
([Measures].[Sales], [Customer_Type].[Local]) > 9000000000)},


{Filter({CrossJoin({Market.[Country].[Pakistan]},{[Product].[Team].[Cardiova
scular
Quote:
Team], [Product].[Team].[Feldene Team], [Product].[Team].[Norvasc Team],
[Product].[Team].[Others], [Product].[Team].[Ponstan Team]}),
([Measures].[Sales], [Customer].[Customer_Type].[Upcountry])
9000000000)}
)

You may want to switch gears and use the NonEmptyCrossJoin function. Then
the UNION statement above can be simplified

{

Filter(NonEmptyCrossJoin({Market.[Country].[Pakistan]},{[Product].[Team].[Ca
rdiovascular
Quote:
Team], [Product].[Team].[Feldene Team], [Product].[Team].[Norvasc Team],
[Product].[Team].[Others], [Product].[Team].[Ponstan Team]},

{[Customer].[Customer_Type].[Local],[Customer].[Customer_Type].[Upcountry]},
2), ([Measures].[Sales]) >900000000)

HTH
Martin

"Burhan" <burhanist (AT) yahoo (DOT) com> wrote in message
news:eM1p5JriEHA.3612 (AT) TK2MSFTNGP12 (DOT) phx.gbl...
SELECT {

CrossJoin({Customer.[Customer_Type].[Local],Customer.[Customer_Type].[Upcoun
try]},{Measures.[Sales],Measures.[Last_Sales]})} ON COLUMNS,

{Filter

({CrossJoin({Market.[Country].[Pakistan]},{Product.[Team].[Cardiovascular
Team],Product.[Team].[Feldene Team],
Product.[Team].[Norvasc
Team],Product.[Team].[Others],Product.[Team].[Ponstan Team]})},
[Measures].[sales] > 900000000)}
ON ROWS


FROM [Sales]
CELL PROPERTIES [VALUE],[FORMATTED_VALUE],[CELL_ORDINAL]


The Above Query give a wrong result, the Filter is not working Properly
i
think it is only Consider the Measure Value on the ROW axis I want to be
on
Both of the Axis. Please Answer it Urgently.








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.