I'm using Mondrian as the Olap Server to my application written in Java.
So, I have a XML schema with a couple of Cubes.
<mon:Schema name="TechServiceDataCtrl" ...... >
...
...
...
<Cube name="ExclusiveUseEquipmentCtrl" defaultMeasure="ObjectCount">
<Table name="DATA_CTRL_EU$EU" schema="TS_DATA_CTRL" />
<DimensionUsage name="Region" source="Region" caption="Region" foreignKey="REGION_ID" />
<Dimension name="EquipmentType" caption="EquipmentType" foreignKey="EQUIPMENT_TYPE">
<Hierarchy primaryKey="EQUIPMENT_TYPE" hasAll="false" caption="EQUIPMENT_TYPE">
<Table name="DATA_CTRL_EU$EU" schema="TS_DATA_CTRL" />
<Level name="EquipmentType" column="EQUIPMENT_TYPE" table="DATA_CTRL_EU$EU"
approxRowCount="10" caption="EQUIPMENT_TYPE" type="String">
</Level>
</Hierarchy>
</Dimension>
<Dimension name="EquipmentTypeGroup" caption="EquipmentTypeGroup" foreignKey="TYPE_GROUP">
<Hierarchy primaryKey="TYPE_GROUP" caption="TYPE_GROUP" hasAll="false">
<Table name="DATA_CTRL_EU$EU" schema="TS_DATA_CTRL" />
<Level name="EquipmentTypeGroup" column="TYPE_GROUP" table="DATA_CTRL_EU$EU"
approxRowCount="2" caption="EquipmentTypeGroup" type="String" />
</Hierarchy>
</Dimension>
<Measure name="ObjectCount" column="COUNT" aggregator="sum" caption="ObjectCount"
formatString="####0">
<Annotations>
<Annotation name="drillThroughHandlerClass">ru.argustelecom.techservice.networksummary.datactrl.drillthrough.ExclusiveUseEquipmentDrillThroughHandler</Annotation>
<Annotation name="factKey">REGION_ID</Annotation>
</Annotations>
</Measure>
</Cube>
</mon:Schema>
Also I have a XML describing report forms for these Cubes. According XML text:
<ns:group name="ReportModule" catalogName="olap/TechServiceDataCtrl">
...
...
...
<ns:group name="ClientEquipment" securityRole="TechServiceDataCtrl_ClientEquipment">
<ns:summaryReport title="report title">
<olapQuery objectName="title" dwhSolutionName="DATA_CTRL_AF">
<mdx><![CDATA[
SELECT
{[Measures].[ObjectCount]}
ON COLUMNS,
NonEmptyCrossJoin (
Parameter("REGION_TREE", [Region], { [Region].DefaultMember }),
CrossJoin (
[EquipmentTypeGroup].Members,
[EquipmentType].Members
)
)
ON ROWS
FROM [ExclusiveUseEquipmentCtrl]
]]></mdx>
</olapQuery>
</ns:summaryReport>
</ns:group>
</ns:group>
And in this case, in ObjectCount, when we expand Regions, we can have empty cells, if there is no data in some groups.
I wanted to set Zeroes instead of empty cells, and wrote a CalculatedMember "ObjectCount" (and renamed an existing Measure to "ObjCount")
<CalculatedMember name="ObjectCount" dimension="Measures" caption="ObjectCountCalc" formatString="####0">
<Formula>
IIf([Measures].[ObjCount] = 0 OR ISEMPTY([Measures].[ObjCount]),0,[Measures].[ObjCount])
</Formula>
<!--<CalculatedMemberProperty name="FORMAT_STRING" value="####0"/>-->
</CalculatedMember>
But there became a problem: my every value became non-clickable (lost DrillThrough action because of making value-column calculated).
How can I solve this problem?
I tried to create members with COALESCEEMPTY() check in olapQuery but no result...
Or maybe I can write Zeroes in cells any other way, without adding a CalculatedMember?
Thanks!