[Mondrian] CASE/WHEN Statement in Where clause

Julian Hyde jhyde at pentaho.com
Fri Jan 25 13:14:45 EST 2013


You are making a mistake that many people make when learning MDX. You are assuming that the MDX WHERE clause has the same purpose as the SQL WHERE clause. MDX WHERE clause does not contain a boolean expression. I suggest that you read a tutorial on MDX.

Julian


On Jan 25, 2013, at 10:12 AM, Kleyson Rios <kleyson.rios at saude.go.gov.br> wrote:

> 
> Hi,
> 
> Is it possible use CASE/WHEN in Where clause ?
> 
> For example:
> 
> select NON EMPTY {[Measures].[ConstStr]} ON COLUMNS,
>  NON EMPTY Order({[Convenio].[Todos convenios].Children}, [Measures].[Porcentagem], DESC) ON ROWS
> from [Fatur]
> where 
>   CASE WHEN 'All' = 'All' then {[Tempo].[2011]}
>        ELSE Crossjoin({[Tempo].[2011]}, {[Tipo Despesa].[Honorario]})
>   END 
> 
> Thanks in advance.
> 
> Kleyson Rios.
> _______________________________________________
> Mondrian mailing list
> Mondrian at pentaho.org
> http://lists.pentaho.org/mailman/listinfo/mondrian



More information about the Mondrian mailing list