as far as i&#39;ve been able to build one, I have not been able to use a SQL query in the fact table. You know: it is not the same theory than real live... I&#39;m sorry, but i can&#39;t help you more. <br><br><div><span class="gmail_quote">
2007/10/30, Eduardo Andrade &lt;<a href="mailto:eduardofandrade@gmail.com">eduardofandrade@gmail.com</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello, i&#39;m trying to build a cube that has 3 dimensions related to workers : Professional Category, Sex and Age. In the database we don&#39;t have the age but instead we have is date of birth, so i&#39;m using this to compute his age. Besides that, we would like to group people by age, so i built the following cube :
<br><br><br><font size="1"><font size="2"><span style="font-family: arial,sans-serif;">&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt;</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">

&lt;Schema name=&quot;Quadro21191519310000&quot;&gt;</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &lt;Cube name=&quot;Quadro2&quot; caption=&quot;Quadro2&quot; cache=&quot;true&quot; enabled=&quot;true&quot;&gt;
</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;View alias=&quot;SITUACAOPROFISSIONAL&quot;&gt;</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;SQL&gt;&lt;![CDATA[SELECT A4448X1_.DTNASCIMENTO AS IPDTNASCIMENTO, A4449X2_.CHVP AS IPCCHVP, A4448X1_.SEXO AS IPSEXO, THIS_.CHVEIDPESSOAL AS SPCHVEIDPESSOAL, A4450X3_.DESIGGRUPOPESSOAL AS IPCGPDESIGGRUPOPESSOAL, THIS_.CHVP AS SPCHVP, A4450X3_.CHVP AS IPCGPCHVP, A4448X1_.CHVP AS IPCHVP, A4449X2_.CHVEGRUPOPESSOAL AS IPCCHVEGRUPOPESSOAL FROM SITUACAOPROFISSIONAL THIS_ LEFT OUTER JOIN IDPESSOALCARREIRA A4449X2_ ON THIS_.CHVEIDPESSOALCARREIRA=A4449X2_.CHVP LEFT OUTER JOIN GRUPOPESSOAL A4450X3_ ON A4449X2_.CHVEGRUPOPESSOAL=A4450X3_.CHVP LEFT OUTER JOIN IDPESSOAL A4448X1_ ON THIS_.CHVEIDPESSOAL=A4448X1_.CHVP]]&gt;&lt;/SQL&gt;
</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/View&gt;</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;Dimension name=&quot;Grupos&quot; foreignKey=&quot;IPCCHVEGRUPOPESSOAL&quot;&gt;
</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;Hierarchy name=&quot;Total Grupos&quot; allMemberName=&quot;Total Grupos&quot; hasAll=&quot;true&quot; primaryKey=&quot;CHVP&quot; primaryKeyTable=&quot;GRUPOPESSOAL&quot;&gt;
</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;Table name=&quot;GRUPOPESSOAL&quot; alias=&quot;GRUPOPESSOAL131&quot; /&gt;</span><br style="font-family: arial,sans-serif;">

<span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;Level name=&quot;Grupos Profissionais&quot; table=&quot;GRUPOPESSOAL131&quot; column=&quot;DESIGGRUPOPESSOAL&quot; uniqueMembers=&quot;false&quot; /&gt;</span>

<br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/Hierarchy&gt;</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/Dimension&gt;
</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;Dimension name=&quot;Sexos&quot; foreignKey=&quot;SPCHVEIDPESSOAL&quot;&gt;</span><br style="font-family: arial,sans-serif;">

<span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;Hierarchy name=&quot;Total Sexos&quot; allMemberName=&quot;Total Sexos&quot; hasAll=&quot;true&quot; primaryKey=&quot;CHVP&quot; primaryKeyTable=&quot;IDPESSOAL&quot;&gt;
</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;Table name=&quot;IDPESSOAL&quot; alias=&quot;IDPESSOAL127&quot; /&gt;</span><br style="font-family: arial,sans-serif;">

<span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;Level name=&quot;Sexo&quot; table=&quot;IDPESSOAL127&quot; column=&quot;SEXO&quot; uniqueMembers=&quot;false&quot;&gt;</span><br style="font-family: arial,sans-serif;">

<span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;NameExpression&gt;</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;SQL&gt;</span>

<br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;![CDATA[CASE WHEN SEXO=1 THEN &#39;M&#39;</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WHEN SEXO=2 THEN &#39;F&#39;</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ELSE &#39;vazio&#39;
</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; END</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ]]&gt;</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/SQL&gt;</span><br style="font-family: arial,sans-serif;">

<span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/NameExpression&gt;</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/Level&gt;</span>
<br style="font-family: arial,sans-serif;">
<span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/Hierarchy&gt;</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/Dimension&gt;</span><br style="font-family: arial,sans-serif;">

<span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;Dimension name=&quot;Idades&quot; foreignKey=&quot;SPCHVEIDPESSOAL&quot;&gt;</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;Hierarchy name=&quot;Total Idades&quot; allMemberName=&quot;Total Idades&quot; hasAll=&quot;true&quot; primaryKey=&quot;CHVP&quot; primaryKeyTable=&quot;IDPESSOAL&quot;&gt;</span><br style="font-family: arial,sans-serif;">

<span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;Table name=&quot;IDPESSOAL&quot; alias=&quot;IDPESSOAL129&quot; /&gt;</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;Level name=&quot;Idade&quot; table=&quot;IDPESSOAL129&quot; column=&quot;DTNASCIMENTO&quot; uniqueMembers=&quot;true&quot;&gt;</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;KeyExpression&gt;</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;SQL&gt;</span><br style="font-family: arial,sans-serif;">

<span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;![CDATA[CASE WHEN ((SELECT EXTRACT(YEAR FROM CURRENT_DATE) FROM DUAL) - extract(YEAR FROM DTNASCIMENTO)) &lt; 18 THEN &#39;ate 18 anos&#39;</span>

<br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WHEN ((SELECT EXTRACT(YEAR FROM CURRENT_DATE) FROM DUAL) - extract(YEAR FROM DTNASCIMENTO)) &lt; 25 THEN &#39;18-24&#39;
</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WHEN ((SELECT EXTRACT(YEAR FROM CURRENT_DATE) FROM DUAL) - extract(YEAR FROM DTNASCIMENTO)) &lt; 30 THEN &#39;25-29&#39;
</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WHEN ((SELECT EXTRACT(YEAR FROM CURRENT_DATE) FROM DUAL) - extract(YEAR FROM DTNASCIMENTO)) &lt; 35 THEN &#39;30-34&#39;
</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WHEN ((SELECT EXTRACT(YEAR FROM CURRENT_DATE) FROM DUAL) - extract(YEAR FROM DTNASCIMENTO)) &lt; 40 THEN &#39;35-39&#39;
</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WHEN ((SELECT EXTRACT(YEAR FROM CURRENT_DATE) FROM DUAL) - extract(YEAR FROM DTNASCIMENTO)) &lt; 45 THEN &#39;40-44&#39;
</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WHEN ((SELECT EXTRACT(YEAR FROM CURRENT_DATE) FROM DUAL) - extract(YEAR FROM DTNASCIMENTO)) &lt; 50 THEN &#39;45-49&#39;
</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WHEN ((SELECT EXTRACT(YEAR FROM CURRENT_DATE) FROM DUAL) - extract(YEAR FROM DTNASCIMENTO)) &lt; 55 THEN &#39;50-54&#39;
</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WHEN ((SELECT EXTRACT(YEAR FROM CURRENT_DATE) FROM DUAL) - extract(YEAR FROM DTNASCIMENTO)) &lt; 60 THEN &#39;55-59&#39;
</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WHEN ((SELECT EXTRACT(YEAR FROM CURRENT_DATE) FROM DUAL) - extract(YEAR FROM DTNASCIMENTO)) &lt; 65 THEN &#39;60-64&#39;
</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WHEN ((SELECT EXTRACT(YEAR FROM CURRENT_DATE) FROM DUAL) - extract(YEAR FROM DTNASCIMENTO)) &lt; 70 THEN &#39;65-69&#39;
</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WHEN ((SELECT EXTRACT(YEAR FROM CURRENT_DATE) FROM DUAL) - extract(YEAR FROM DTNASCIMENTO)) &gt; 70 THEN &#39;70 ou mais&#39;
</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ELSE &#39;vazio&#39;</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; END</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ]]&gt;</span><br style="font-family: arial,sans-serif;">

<span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/SQL&gt;</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/KeyExpression&gt;</span>

<br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/Level&gt;</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/Hierarchy&gt;
</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/Dimension&gt;</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;Measure column=&quot;SPCHVP&quot; name=&quot;chvP&quot; aggregator=&quot;count&quot; formatString=&quot;###,##0&quot; /&gt;
</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">&nbsp;&nbsp;&nbsp; &lt;/Cube&gt;</span><br style="font-family: arial,sans-serif;"><span style="font-family: arial,sans-serif;">&lt;/Schema&gt;
</span></font><br style="font-family: courier new,monospace;"></font><br>This generates a SQL with a group by clause that contains all the CASE expression, therefore giving a SQL ERROR. Is there a way to achieve what I want ?
<br><br>Thank you,<br>Edaurdo Andrade<br><span class="sg"><br>-- <br>Eduardo Andrade<br><a href="mailto:eduardofandrade@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">eduardofandrade@gmail.com
</a>
</span><br>_______________________________________________<br>Mondrian mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://lists.pentaho.org/mailman/listinfo/mondrian" target="_blank">
http://lists.pentaho.org/mailman/listinfo/mondrian</a><br><br></blockquote></div><br><br clear="all"><br>-- <br>Agustín Campos Muñoz<br><a href="http://www.acampos.net">http://www.acampos.net</a><br><br>Email: aguscamposENgmailPUNTOcom
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; acamposENiiesPUNTOes<br>MSN Messenger: acampozENhotmailPUNTOcom<br>Skype: acamposnet