I have a virtual dimension. Results are right when I query cube, but when I query trhough virtual cube, members are not showed.
Queries:
--From cube:
SELECT
NON EMPTY {Hierarchize({[Measures].[MyMeasure]})} ON COLUMNS,
NON EMPTY {Hierarchize({{[MyVirtualDim Usage 0.New Hierarchy 0].[All MyVirtualDim Usage 0.New Hierarchy 0s]}, {[MyVirtualDim Usage 0.New Hierarchy 0].[New Level 0].Members}, {[MyVirtualDim Usage 0.New Hierarchy 0].[curs].Members}})} ON ROWS
FROM [MyCube]
--From virtual cube:
SELECT
NON EMPTY {Hierarchize({[Measures].[MyMeasure]})} ON COLUMNS,
NON EMPTY {Hierarchize({{[MyVirtualDim.New Hierarchy 0].[All MyVirtualDim.New Hierarchy 0s]}, {[MyVirtualDim.New Hierarchy 0].[New Level 0].Members}, {[MyVirtualDim.New Hierarchy 0].[curs].Members}})} ON ROWS
FROM [MyVirtualCube]
Results:
--from cube (right)
Axis #0:
{}
Axis #1:
{[Measures].[MyMeasure]}
Axis #2:
{[MyVirtualDim Usage 0.New Hierarchy 0].[All MyVirtualDim Usage 0.New Hierarchy 0s]}
{[MyVirtualDim Usage 0.New Hierarchy 0].[1]}
{[MyVirtualDim Usage 0.New Hierarchy 0].[1].[1]}
{[MyVirtualDim Usage 0.New Hierarchy 0].[1].[2]}
Row #0: 5
Row #1: 5
Row #2: 3
Row #3: 2
--from virtual cube (bad)
Axis #0:
{}
Axis #1:
{[Measures].[MyMeasure]}
Axis #2:
{[MyVirtualDim.New Hierarchy 0].[All MyVirtualDim.New Hierarchy 0s]}
Row #0: 5
Here schema definition:
<Schema name="New Schema1">
<Dimension visible="true" name="MyVirtualDim">
<Hierarchy name="New Hierarchy 0" visible="true" hasAll="true">
<Table name="dim2" schema="public" alias="">
</Table>
<Level name="New Level 0" visible="true" table="dim2" column="id_nivell" nameColumn="id_nivell" type="Integer" internalType="int" uniqueMembers="false" levelType="Regular" caption="nivell" captionColumn="nom_nivell">
<Property name="nivell" column="nom_nivell" type="String" description="nivell">
</Property>
</Level>
<Level name="curs" visible="true" table="dim2" column="id_curs" nameColumn="id_curs" type="Integer" internalType="int" uniqueMembers="false" levelType="Regular" captionColumn="nom_curs">
<Property name="curs" column="nom_curs" type="String" description="curs">
</Property>
</Level>
</Hierarchy>
</Dimension>
<Cube name="MyCube" visible="true" cache="true" enabled="true">
<Table name="facts" schema="public">
</Table>
<DimensionUsage source="MyVirtualDim" name="MyVirtualDim Usage 0" visible="true" foreignKey="fk_dim2" >
</DimensionUsage>
<Measure name="MyMeasure" column="id" datatype="Integer" aggregator="count" visible="true">
</Measure>
</Cube>
<VirtualCube enabled="true" name="MyVirtualCube" visible="true">
<CubeUsages>
<CubeUsage cubeName="MyCube" >
</CubeUsage>
</CubeUsages>
<VirtualCubeDimension visible="true" name="MyVirtualDim">
</VirtualCubeDimension>
<VirtualCubeMeasure cubeName="MyCube" name="[Measures].[MyMeasure]" visible="true">
</VirtualCubeMeasure>
</VirtualCube>
</Schema>
Somebody can see where the issue is?
Solved,
Virtual dimensions and virtual cubes runs as expected. To solve my issue it is enough to change dimension name:
<Cube name="MyCube" visible="true" cache="true" enabled="true">
<Table name="facts" schema="public">
</Table>
<DimensionUsage source="MyVirtualDim" name="MyVirtualDim Usage 0" <--here!
Should be named: MyVirtualDim
instead MyVirtualDim Usage 0
because is the name of the dimension in the cube.