本文介绍了如何在mdx查询上应用分组依据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

工作中的pentaho仪表板试图生成报告以获取两个日期之间每天/每周/每月的交易计数.

Working pentaho dashboard trying to generate report to get transaction count per day/Week/Month between two date.

由于创建的"不是分组依据,因此在MDX查询返回交易计数1以下

WITH
SET [~COLUMNS] AS Filter([created].DefaultMember.Children, [created].CurrentMember.name >= "2014-10-01" AND Left([created].CurrentMember.Name, 10) <= "2014-10-02")
SET [~ROWS] AS
    {[markup].[markup].Members}
SELECT
NON EMPTY CrossJoin([~COLUMNS], {[Measures].[Transaction Count]}) ON COLUMNS,
NON EMPTY [~ROWS] ON ROWS
FROM [transaction]

我如何将列"[创建]"分组

How to i can group column '[created]'

推荐答案

为什么不只是将度量移动到WHERE子句中?

Why not just move the measure into the WHERE clause:

WITH
SET [~COLUMNS] AS Filter([created].DefaultMember.Children, [created].CurrentMember.name >= "2014-10-01" AND Left([created].CurrentMember.Name, 10) <= "2014-10-02")
SET [~ROWS] AS
    {[markup].[markup].Members}
SELECT
NON EMPTY [~COLUMNS] ON COLUMNS,
NON EMPTY [~ROWS] ON ROWS
FROM [transaction]
WHERE [Measures].[Transaction Count]

这篇关于如何在mdx查询上应用分组依据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-17 02:40
查看更多