dbTalk Databases Forums  

MDX Query - logical AND - fastest way

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


Discuss MDX Query - logical AND - fastest way in the microsoft.public.sqlserver.olap forum.



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

Default MDX Query - logical AND - fastest way - 07-03-2003 , 07:53 AM







Does anyone know the fastest (best!) way to answer the following
question:

Give me all Customers who spent more than 2$ on Good Imported Beer AND
more than 3$ on Good Light Beer?

Here's my attempt:

'Filter(NonEmptyCrossjoin(Extract(Filter(NonEmptyC rossjoin({[Customers]-
.[Name].Members},{[Product].[Product Name].[Good Imported
Beer]},2),([Measures].[Store Sales])>3),Customers),{[Product].[Product
Name].[Good Light Beer]},2),([Measures].[Store Sales])>1)'

--
Posted via http://dbforums.com

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

Default MDX Query - logical AND - fastest way - 07-03-2003 , 12:28 PM






You can define a named set with the required definition. a
named set can then be queried just as you query a
dimension.

Quote:
-----Original Message-----

Does anyone know the fastest (best!) way to answer the
following
question:

Give me all Customers who spent more than 2$ on Good
Imported Beer AND
more than 3$ on Good Light Beer?

Here's my attempt:

'Filter(NonEmptyCrossjoin(Extract(Filter(NonEmptyC rossjoin
({[Customers]-
.[Name].Members},{[Product].[Product Name].[Good Imported
Beer]},2),([Measures].[Store Sales])>3),Customers),
{[Product].[Product
Name].[Good Light Beer]},2),([Measures].[Store Sales])>1)'

--
Posted via http://dbforums.com
.


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

Default Re: MDX Query - logical AND - fastest way - 07-03-2003 , 02:40 PM




True .... That's a good idea but the query needs to be completely
dynamic, i.e. give me all of the Customers who spent more (or less,
or whatever) than N$ on product A AND more than X$ on product B ....
etc. etc....

I just want to be sure that I'm doing queries of this type in the most
efficient way possible.



Originally posted by Gs
Quote:
You can define a named set with the required definition. a
named set can then be queried just as you query a
dimension.

-----Original Message-----
Does anyone know the fastest (best!) way to answer the
following
question:
Give me all Customers who spent more than 2$ on Good
Imported Beer AND
more than 3$ on Good Light Beer?
Here's my attempt:
'Filter(NonEmptyCrossjoin(Extract(Filter(NonEmptyC rossjoin
({[Customers]-
.[Name].Members},{[Product].[Product Name].[Good Imported
Beer]},2),([Measures].[Store Sales])>3),Customers),
{[Product].[Product
Name].[Good Light Beer]},2),([Measures].[Store Sales])>1)'
--
Posted via
http://dbforums.com/http://dbforums.com
.
--
Posted via http://dbforums.com


Reply With Quote
  #4  
Old   
GS
 
Posts: n/a

Default Re: MDX Query - logical AND - fastest way - 07-05-2003 , 08:46 AM



am not sure, but you can try somethign like this:

MyNamedSet:
filter(crossjoin({[customers].members},
{[product].members}), measures > N)

Your query should be something like:

select
{StrToSet("[MyNamedSet]")} on columns
from <cube1>

HTH


Quote:
-----Original Message-----

True .... That's a good idea but the query needs to be
completely
dynamic, i.e. give me all of the Customers who spent more
(or less,
or whatever) than N$ on product A AND more than X$ on
product B ....
etc. etc....

I just want to be sure that I'm doing queries of this
type in the most
efficient way possible.



Originally posted by Gs
You can define a named set with the required
definition. a
named set can then be queried just as you query a
dimension.

-----Original Message-----
Does anyone know the fastest (best!) way to answer the
following
question:
Give me all Customers who spent more than 2$ on Good
Imported Beer AND
more than 3$ on Good Light Beer?
Here's my attempt:
'Filter(NonEmptyCrossjoin(Extract(Filter
(NonEmptyCrossjoin
({[Customers]-
.[Name].Members},{[Product].[Product Name].[Good
Imported
Beer]},2),([Measures].[Store Sales])>3),Customers),
{[Product].[Product
Name].[Good Light Beer]},2),([Measures].[Store Sales])
1)'
--
Posted via
http://dbforums.com/http://dbforums.com
.

--
Posted via http://dbforums.com
.


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.