dbTalk Databases Forums  

MDX query , MAX ( ) puzzle!!

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


Discuss MDX query , MAX ( ) puzzle!! in the microsoft.public.sqlserver.olap forum.



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

Default MDX query , MAX ( ) puzzle!! - 11-27-2003 , 09:14 AM






Hi ,

Have a problem with a query , appreciate any help, the query is as follows :

WITH SET [Number Set] as '{

[Number].[customer].[08009525150],

[Number].[customer].[08452345005]

}'

SET [Set Of Members] AS

'nonemptycrossjoin(

[customer].[customer].members,

[Number Set]},

[Date].[Month].[Date].members,

[Time].[time].members,

[Date Set],

4

)'

SET [Date Set] as

'{[Date].[27 Aug 2002] : [Date].[27 Apr 2003]}'



SET [Max Vol Tot] as

' FILTER( [Set Of Members] ,[measures].[volume tot]=MAX( { [Set Of
Members] },[measures].[Volume Tot])) '



SELECT

{[Max Vol Tot]} on rows,

{[Volume tot]} on columns

FROM [Call Legs]

Now when I run this query I get one MAX measure value =590 for customer
[Number].[customer].[08009525150], the Max measure value for
[Number].[customer].[08452345005] = 290 but this value is not displayed
because it is less than 590 , is there anyway that I can display both values
together?? I mean I want to display the Maximum measure values for both
customer members & NOT the comparison result of the two.



Thanks!!





Reply With Quote
  #2  
Old   
Brian Altmann
 
Posts: n/a

Default MDX query , MAX ( ) puzzle!! - 11-28-2003 , 07:02 AM






Ahmed:

It is easier to answer these questions if you express them
as Foodmart queries.
That said, you might try to :

1 - Remove [Number Set] from [Set of Members]
2 - Redefine [Max Vol Tot] as:

Member Measures.[Max Vol Tot] as
' MAX( { [Set Of Members] },[measures].[Volume Tot])) '

3 - Use this SELECT:

SELECT

{[Number Set]} on rows,

{[Max Vol Tot]} on columns

HTH,
Brian
www.geocities.com/brianaltmann/olap.html



Quote:
-----Original Message-----
Hi ,

Have a problem with a query , appreciate any help, the
query is as follows :

WITH SET [Number Set] as '{

[Number].[customer].[08009525150],

[Number].[customer].[08452345005]

}'

SET [Set Of Members] AS

'nonemptycrossjoin(

[customer].[customer].members,

[Number Set]},

[Date].[Month].[Date].members,

[Time].[time].members,

[Date Set],

4

)'

SET [Date Set] as

'{[Date].[27 Aug 2002] : [Date].[27 Apr 2003]}'



SET [Max Vol Tot] as

' FILTER( [Set Of Members] ,[measures].[volume tot]=MAX(
{ [Set Of
Members] },[measures].[Volume Tot])) '



SELECT

{[Max Vol Tot]} on rows,

{[Volume tot]} on columns

FROM [Call Legs]

Now when I run this query I get one MAX measure value
=590 for customer
[Number].[customer].[08009525150], the Max measure value
for
[Number].[customer].[08452345005] = 290 but this value is
not displayed
because it is less than 590 , is there anyway that I can
display both values
together?? I mean I want to display the Maximum measure
values for both
customer members & NOT the comparison result of the two.



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.