Reputation: 24005
IF [Sales].[Retail] > 0 OR [Sales].[Reseller] > 0 SELECT [Measures].[Revenue] on 0 FROM [Cube] ELSE Return nothing
The above is a pseudo code representation for the type of behavior that I want. Is there a way to conditionally select in MDX based on an IF X OR Y boolean expression? I've looked at an if/else statement and case statements, but all the examples I have seen have used constants and I have struggled with mixing these functions and select statements (from the MSDN article, I am not sure it is possible).
Upvotes: 0
Views: 274
Reputation: 5588
select (case when ([Sales].[Retail] > 0 OR [Sales].[Reseller] > 0)
then [Measures].[Revenue] else 'nothing' end) as 'Revenue' from [Cube]
Upvotes: 1
Reputation: 9375
How about :
SELECT
IIF( [Sales].[Retail] > 0 OR [Sales].[Reseller] > 0 , { [Measures].[Revenue] } , {} ) on 0
FROM [Cube]
Upvotes: 1