Solved

MDX 2 Filters Connected By Or Keyword

Posted on 2009-04-02
1
546 Views
Last Modified: 2012-05-06
I have the requirement that a schedule should be completed for any people with a one-time spend greater than $50, or an aggregate spend greater than $250.  Below I have the individual queries.  Is it possible to combine these conditions using an 'OR' into 1 query?  I don't want any overlap -- in other words, people selected from the 1st query should not also be selected from the 2nd query.

Code samples appreciated.
-- Query 1
select 
([Measures].[Spend Count].Children, [Beneficiary].[Address].Children, [Activity Start Date].[Date]) ON COLUMNS,
{Filter ([Year Quarter Desc].Members, [Measures].[Total Spend Amount] > 50)} ON ROWS
FROM Spends
WHERE [Party Role].[Beneficiary].[Beneficiary Role].&[Caterer]
 
--Query 2
WITH MEMBER Measures.Year AS SUM
	({[Year Quarter Desc].&[2008/Q1], [Year Quarter Desc].&[2008/Q2]},[Measures].[Total Spend Amount])
	select [Beneficiary].[Full Name] ON COLUMNS,
	{Filter ([Year Quarter Desc].&[2008/Q1], [Measures].[Year] > 250), 
	Filter([Year Quarter Desc].&[2008/Q2], [Measures].[Year] > 250)} ON ROWS
	from spends

Open in new window

0
Comment
Question by:Kaporch
1 Comment
 

Accepted Solution

by:
Kaporch earned 0 total points
ID: 24060004
Another question that I think I found my own answer to below.
WITH MEMBER Measures.TotalVendorSpending AS SUM
	({[Year Quarter Desc].&[2008/Q1], [Year Quarter Desc].&[2008/Q2]},[Measures].[Total Spend Amount]) 
	select [Beneficiary].[Full Name] ON COLUMNS,
	IIF([Measures].[TotalVendorSpending] > 250, [Measures].[TotalVendorSpending], {Filter ([Year Quarter Desc].Members, [Measures].[Total Spend Amount] > 50)}) ON ROWS
	from spends
	WHERE [Party Role].[Beneficiary].[Beneficiary Role].&[Caterer]

Open in new window

0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SQL replication over high latency link 10 60
T-SQL 10 35
SQL R 21 28
Msg 8114, Level 16, State 5, Line 1 Error converting data type varchar to numeric. 11 14
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to shrink a transaction log file down to a reasonable size.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question