我对查询两个日期之间记录的 MDX 有疑问,比如 DateFrom 和 DateTo。
这是我的 MDX 查询(在 pentaho 中):
WITH
SET [metrics] AS ${myType}
SET [dates] AS (
[Date].[${DateFrom,date,"yyyy"}].[${DateFrom,date,"M"}].[${DateFrom,date,"d"}]
:
[Date].[${DateTo,date,"yyyy"}].[${DateTo,date,"M"}].[${DateTo,date,"d"}]
)
SELECT
NON EMPTY [metrics] ON COLUMNS,
NON EMPTY [dates] ON ROWS
FROM
${ActivityList}
WHERE
([Product].[${Product}],[Subscription].[${Subscription}], [Operator].[${Carrier}].[${Distributor}], [Instance].[${Instance}])
这是 mondrian xml 文件部分:
<Dimension type="TimeDimension" highCardinality="false" name="Date">
<Hierarchy hasAll="false">
<Level name="Year" column="TS_YEAR" type="Numeric" uniqueMembers="false" levelType="TimeYears" hideMemberIf="Never">
</Level>
<Level name="Month" column="TS_MONTH" type="Numeric" uniqueMembers="false" levelType="TimeMonths" hideMemberIf="Never">
</Level>
<Level name="Day" column="TS_DAY" type="Numeric" uniqueMembers="false" levelType="TimeDays" hideMemberIf="Never">
</Level>
</Hierarchy>
</Dimension>
当我在用户界面中选择 DateFrom 和 DateTo 时,即使数据库中这两个日期之间有一些记录,它也没有显示任何结果。任何想法?