<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><br><span style="font-family: '.HelveticaNeueUI'; font-size: 15px; line-height: 19px; white-space: nowrap; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); -webkit-text-size-adjust: none; "><a href="http://lbsackett.typepad.com/larry_sackett/2008/07/where-clause-in-mdx-query.html">http://lbsackett.typepad.com/larry_sackett/2008/07/where-clause-in-mdx-query.html</a></span><br>Sent from my iPhone</div><div><br>On Jan 25, 2013, at 11:30 AM, Julian Hyde &lt;<a href="mailto:jhyde@pentaho.com">jhyde@pentaho.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><span>You've read the tutorial and you still think you can put a boolean expression in the WHERE clause? Read it again.</span><br><span></span><br><span>Julian</span><br><span></span><br><span></span><br><span>On Jan 25, 2013, at 10:30 AM, Kleyson Rios &lt;<a href="mailto:kleyson.rios@saude.go.gov.br">kleyson.rios@saude.go.gov.br</a>&gt; wrote:</span><br><span></span><br><blockquote type="cite"><span>I Julian,</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Thanks for the answer.</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>I've already read the tutorial.</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>I am asking because in Microsoft website I saw an example using CASE/WHEN for select.</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>I need to use the same idea for the WHERE.</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Can you give me a way in how to do that ?</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Thanks in advance.</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Kleyson Rios.</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>----- Mensagem original -----</span><br></blockquote><blockquote type="cite"><span>De: "Julian Hyde" &lt;<a href="mailto:jhyde@pentaho.com">jhyde@pentaho.com</a>&gt;</span><br></blockquote><blockquote type="cite"><span>Para: "Mondrian developer mailing list" &lt;<a href="mailto:mondrian@pentaho.org">mondrian@pentaho.org</a>&gt;</span><br></blockquote><blockquote type="cite"><span>Enviadas: Sexta-feira, 25 de Janeiro de 2013 16:14:45</span><br></blockquote><blockquote type="cite"><span>Assunto: Re: [Mondrian] CASE/WHEN Statement in Where clause</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>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.</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Julian</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>On Jan 25, 2013, at 10:12 AM, Kleyson Rios &lt;<a href="mailto:kleyson.rios@saude.go.gov.br">kleyson.rios@saude.go.gov.br</a>&gt; wrote:</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>Hi,</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>Is it possible use CASE/WHEN in Where clause ?</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>For example:</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>select NON EMPTY {[Measures].[ConstStr]} ON COLUMNS,</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>NON EMPTY Order({[Convenio].[Todos convenios].Children}, [Measures].[Porcentagem], DESC) ON ROWS</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>from [Fatur]</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>where </span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> CASE WHEN 'All' = 'All' then {[Tempo].[2011]}</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ELSE Crossjoin({[Tempo].[2011]}, {[Tipo Despesa].[Honorario]})</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span> END </span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>Thanks in advance.</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>Kleyson Rios.</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>_______________________________________________</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span>Mondrian mailing list</span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span><a href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a></span><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><span><a href="http://lists.pentaho.org/mailman/listinfo/mondrian">http://lists.pentaho.org/mailman/listinfo/mondrian</a></span><br></blockquote></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>_______________________________________________</span><br></blockquote><blockquote type="cite"><span>Mondrian mailing list</span><br></blockquote><blockquote type="cite"><span><a href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a></span><br></blockquote><blockquote type="cite"><span><a href="http://lists.pentaho.org/mailman/listinfo/mondrian">http://lists.pentaho.org/mailman/listinfo/mondrian</a></span><br></blockquote><blockquote type="cite"><span>_______________________________________________</span><br></blockquote><blockquote type="cite"><span>Mondrian mailing list</span><br></blockquote><blockquote type="cite"><span><a href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a></span><br></blockquote><blockquote type="cite"><span><a href="http://lists.pentaho.org/mailman/listinfo/mondrian">http://lists.pentaho.org/mailman/listinfo/mondrian</a></span><br></blockquote><span></span><br><span>_______________________________________________</span><br><span>Mondrian mailing list</span><br><span><a href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a></span><br><span><a href="http://lists.pentaho.org/mailman/listinfo/mondrian">http://lists.pentaho.org/mailman/listinfo/mondrian</a></span><br></div></blockquote></body></html>