我有以下方面:
<Dimension type="StandardDimension" visible="true" foreignKey="ID_CATEGORIE" highCardinality="false" name="DIMENSION_CATEGORIE">
<Hierarchy name="HIERARCHY_CATEGORIE" visible="true" hasAll="true" primaryKey="ID_CATEGORIE">
<Table name="CATEGORIE_TICKET" schema="RAPPORT">
</Table>
<Level name="CATEGORIE" visible="true" table="CATEGORIE_TICKET" column="ID_CATEGORIE" nameColumn="CATEGORIE" type="String" uniqueMembers="true" levelType="Regular" hideMemberIf="Never">
</Level>
</Hierarchy>
</Dimension>
MDX查询:
select {[Measures].[COUNT_TICKET]} ON COLUMNS,
NON EMPTY {[DIMENSION_CATEGORIE.HIERARCHY_CATEGORIE].Children} ON ROWS
from [CUBE_TICKETS_DEPOSES]
返回以下数据:
Mesures
HIERARCHY_CATEGORIE COUNT_TICKET
Name1 20
Name2 30
...
问题:是否可以修改MDX查询以输出每个CATEGORIE
列的ID,如下所示:
Mesures
ID HIERARCHY_CATEGORIE COUNT_TICKET
id1 Name1 20
id2 Name2 30
...
吗
我的CATEGORIE_TICKET
表是:
ID_CATEGORIE CATEGORIE
id1 Name1
id2 Name2
....
答案 0 :(得分:2)
找到它:
WITH
MEMBER [Measures].[Key] AS
[DIMENSION_CATEGORIE.HIERARCHY_CATEGORIE].CurrentMember.PROPERTIES("KEY")
select {[Measures].Members, [Measures].[Key] } ON COLUMNS,
{[DIMENSION_CATEGORIE.HIERARCHY_CATEGORIE].children} ON ROWS
from [CUBE_TICKETS_DEPOSES]
给出了:
Mesures
HIERARCHY_CATEGORIE COUNT_TICKET KEY
Name1 20 id1
Name2 30 id2
...