Derived measure in crosstab - BIRT 2.2
Hi,<br />
<br />
another week, another crosstab question ;-)<br />
<br />
I know there have been several improvements for crosstabs in later releases of BIRT, especially in BIRT 2.5, particularly the ability to add derived measures, but unfortunately, I am stuck with BIRT 2.2 on this project.<br />
<br />
My dataset is structured as follows:<br />
|DATECREATED|CLAIMTYPE|STATUS|<br />
<br />
Each of these columns is a dimension of my crosstab, and the measure is a count of the number of claims per type (row), per quarter (column lvl1), per status (column lvl2).<br />
<br />
So far, nothing fancy. Now, what I'd like to display is a derived measure: closing ratio, calculated as closed*100/new<br />
<br />
So I've added a computed column to the dataset, closeRatio, with value 0. This computed column is then added as a measure in the cube.<br />
<br />
But when I drop this column in the crosstab, I then get a close ratio column per type, quarter and status. Obviously, what I need is just a column per type and quarter only.<br />
<br />
The 1st thought that came to mind is to hide the column, but make it visible in the sub-total per quarter, and override its expression with the calculation described above. But somehow, I think if the measure is hidden in the column, it wont appear in the sub-total. Unless there's a way to do this that I don't know about.<br />
<br />
So the 2nd option, which is not very elegant but *should* solve my problem, would be to do a SQL joint as follows:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
select DATECREATED, CLAIMTYPE, STATUS
from CLAIMS
joint
select DATECREATED, CLAIMTYPE, 'Ratio'
from CLAIMS
</pre>
<br />
In this case, I will get a new 'status' named 'Ratio' and I can simply override its expression with my calculation, but the major drawback is that it will double the number of rows returned, incurring a performance hit which I'd rather avoid if possible.<br />
<br />
Any ideas? (apart from upgrading to BIRT 2.5 :rolleyes: )<br />
<br />
Rgds,<br />
Cedric