views:

253

answers:

2

Hi, i'm having problem restricting a query in mdx, using except function at where clause. i need to retrieved a set of data but which not in an specific set. Then i created the next query:

select {[Measures].[Amount], [Measures].[Transaction Cost], [Measures].[Transaction Number]} ON COLUMNS,{[ManualProcessing].[All ManualProcessings].[MAGNETICSTRIPE], ManualProcessing].[All ManualProcessings].[MANUAL]} ON ROWS 
FROM [Transactions]
where except([Product].[All Products].Children,{[Product].[All Products].[Debit})

apparently this works fine, but when i try to add another restriction to slicer, i got this error: No function matches signature (Set,Member).

I'm currently working on mondrian 3.1

Is it possible to add multiple restriction to slicer when im sing the except funtion ? are there any other way to get this ?

thanks in advance.

+2  A: 

The Except function only works with sets. But you can use n dimensions on your where:

select {[Measures].[Amount], [Measures].[Transaction Cost], [Measures].[Transaction Number]} ON COLUMNS,{[ManualProcessing].[All ManualProcessings].[MAGNETICSTRIPE], ManualProcessing].[All ManualProcessings].[MANUAL]} ON ROWS 
FROM [Transactions]
where 
   (
      except([Product].[All Products].Children,{[Product].[All Products].[Debit}),
      except([Set],[Set to exclude])
   )

This works in Analysis Services 2005, it should work in Mondrian

santiiiii
A: 

Apparently this cant be done on mondrian because there is a bug that doesnt allow compound slicers, so i found a nice solutions using Mondrian OLAP Server and its creating a member which exclude the set that i didnt want. it look like this.

With member [Product].[Except] as ([Product].[All  Products]) - 
([Product].[All Products].[Debit]) 
select {[Measures].[Amount],[Measures].[Transaction Cost], [Measures].[Transaction Number]} ON COLUMNS,
{[ManualProcessing].[All ManualProcessings].[MAGNETICSTRIPE],[ManualProcessing].[All ManualProcessings].[MANUAL]} ON ROWS 
FROM [Transactions] 
where[Product].[Except]
rfders