iccube - 使用多级层次结构生成月份范围

标签 iccube iccube-reporting

我想通过仅选择从 [ComptaPlanId].[ComptaDateDebut][ComptaPlanId].[ 的月份来过滤 [ComptaEcriture Date] 的月份。 ComptaDateFin],但自从 [ComptaDateDebut][ComptaDateFin][ComptaEcriture Date].[ComptaEcriture Date].[ 不是来自同一级别,机器人也不是来自同一维度。月],我不知道如何实现这一点。

如果我能生成一系列月份那就太好了。我的尺寸如下:

My dimensions

最佳答案

假设您正在测试 PlanId 不是 All 成员,则可以使用 isAll MDX+ 函数用于此。

对于该集合,我们将组合 Filter functionDeclared function ,即使我们可以将所有代码放入过滤器中。它看起来像:

WITH
  FUNCTION inRange(Value _date,Value _start, Value _end) AS _start <= _date AND _date <= _end
  SET myDates as  Filter( [Date].[Date].[Month] as t, inRange(t.current.key, DateTime(2015,6,1), DateTime(2017,1,1)  ) )
SELECT
 myDates on 0
FROM [Cube]

并使用紧凑且更快的版本:

SELECT
 Filter( [Date].[Date].[Month] as t, DateTime(2015,6,1) <= t.current.key AND t.current.key <= DateTime(2017,1,1) ) on 0
FROM [Cube]

使用成员:

WITH
  FUNCTION inRange(Value _date,Value _start, Value _end) AS _start <= _date AND _date <= _end
  SET myDates as  Filter( [Date].[Date].[Month] as t, 
                    inRange(t.current.key, [ComptaDateDebut].currentmember.key, [ComptaDateFin].currentmember.key  ) 
                  )
SELECT
 myDates on 0
FROM [Cube]

您可以使用contextMember而不是在切片器中检查的 currentMember (FILTER BY 或子选择)

关于iccube - 使用多级层次结构生成月份范围,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47452875/

相关文章:

icCube 报告 - 使用事件的标签 : Formatting and Syntax

amcharts - IcCube Reporting,如何格式化 amCharts 气泡轴?

amcharts - IcCube,如何更改 AMChart 小部件中的图例标签?

iccube - 如何在 iccube Reporting 6 中创建组合图表?

jodatime - joda.time在icCube中的使用

javascript - iccube 从自定义小部件 (JS) 设置过滤器选择

pivot - IcCube - 数据透视表中的叶子

IcCube - OLAP 时间维度,范围仅链接到开始日期

iccube - 如何在 Iccube 6 报告中的表格内创建链接?