Solved

MDX Sum Filter

Posted on 2009-03-31
2
1,971 Views
Last Modified: 2012-05-06
I have the following MDX query.  I am trying to select members with sum totals greater than $500 for a quarter.  I tried adding a filter without the sum and > than 500, that worked.  When I added the sum and greater than sign, I got the error: Query (26, 2) The > function expects a string or numeric expression for the 1 argument. A tuple set expression was used.

I am new to MDX and so I'm not sure what I need to change.  Please let me know.
--works fine
select {[Party Role].[Beneficiary].[Beneficiary Role].&[Host]} ON COLUMNS,
{Filter ([Year Quarter Desc].Members, [Measures].[Total Spend Amount]> 500)} ON ROWS
FROM Spends
 
--doing a sum and greater than does not work
select {[Party Role].[Beneficiary].[Beneficiary Role].&[Host]} ON COLUMNS,
{Filter ([Year Quarter Desc].Members, sum([Measures].[Total Spend Amount])) > 500} ON ROWS
FROM Spends

Open in new window

0
Comment
Question by:Kaporch
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Accepted Solution

by:
Kaporch earned 0 total points
ID: 24038485
I think I might have found the answer on my own, below.
WITH MEMBER Measures.Year AS SUM
	([Year Quarter Desc].&[2008/Q1], [Measures].[Total Spend Amount])
	select [Activity Start Date].[Date] ON COLUMNS,
	{Filter ([Year Quarter Desc].&[2008/Q1], [Measures].[Year] > 500), 
	Filter([Year Quarter Desc].&[2008/Q2], [Measures].[Year] > 500)} ON ROWS
	from spends
WHERE {[Party Role].[Beneficiary].[Beneficiary Role].&[Host]}

Open in new window

0
 

Expert Comment

by:neasar
ID: 33625529
Thanks :) very handy indeed.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

752 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