我正在使用pentaho仪表板试图生成报告,以便在两个日期之间获得每天的交易计数。我是初学者mdx查询下面的查询显示只有两个日期事务计数我想要的是范围之间。我知道如何在简单的查询
上做到这一点SQL工作查询
SELECT
DATE(modified) AS trndate,
COUNT(id)
FROM
log.transaction
WHERE DATE(modified) BETWEEN DATE(${from_date}) AND DATE(${to_date})
GROUP BY
trndate
MDX查询只显示两个日期交易,而我想要两个日期之间的范围
WITH
SET [~ROWS] AS
{[created].[2014-10-01 12:01:53.507787], [created].[2014-10-01 20:34:14.410064]}
SELECT
NON EMPTY {[Measures].[id]} ON COLUMNS,
NON EMPTY [~ROWS] ON ROWS
FROM [transaction]
答案 0 :(得分:0)
通常可以使用冒号指定范围
WITH
SET [~ROWS] AS
{[created].[2014-10-01 12:01:53.507787]:[created].[2014-10-01 20:34:14.410064]}
SELECT
NON EMPTY {[Measures].[id]} ON COLUMNS,
NON EMPTY [~ROWS] ON ROWS
FROM [transaction]