累积总和|从计算中排除属性 [英] Cumulative Sum | Exclude attribute from calculation

查看:113
本文介绍了累积总和|从计算中排除属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用下面的函数执行累积和/运行总计,以便用户可以使用任何日期级别,但要求是忽略来自的一些属性计算。


使用的函数:


SUM NULL Axis (1)。项目(0)。项目(1)。项目(0)。计数 -1)。 层次结​​构 CurrentMember
[Measures]。[门票数])

SUM(NULL:Axis(1).Item(0).Item(Axis(1).Item(0).Count-1).Hierarchy.CurrentMember, [Measures].[ Number of Ticket])

 

示例:

下表显示了预期的累积总和

程序名称

程序

子程序

日期

Number_Ticket

累计Number_Ticket

测试

85

267

2018-08-31


0


0

 

 

 

2018-10-26


2


2

 

 

 

2018-10-30


1


3

 

 

 

2018-11-06


71


74

 

 

 

2018-11-07


6


80

 

 

 

2018-11-08


4


84

 

 

 

2018-11-10


6


90

 

此处,添加其他属性,Program Remaining,如下所示,它会更改累积行为,因为Excel会将该属性添加到分组中,以便重置累计总和:

Here, by adding another attribute, Program Remaining, as shown below, it changes the Cumulative behavior, Because Excel will add that attribute to the grouping so it reset the cumulative sum:

程序名称

程序

子程序

日期

程序剩余

Number_Ticket

累计Number_Ticket

测试

85

267

2018-08-31

85000


0


0

 

 

 

2018-10-26

84829


2


2

 

 

 

2018-10-30

84829


1


1

 

 

 

2018-11-06

84761


71


71

 

 

 

2018-11-07

84761


6


6

 

 

 

2018-11-08

84760


4


4

 

 

 

2018-11-10

84760


6


6

 

有没有办法可以从计算中排除Program Remaining属性(我有另外4个我希望排除的属性),即使添加这些属性,也可以像第一个表一样增加累积。

Is there a way that I can exclude the Program Remaining attribute from the calculation (I have another 4 attributes that I want to exclude) so that the cumulative can be increased just like the first table even with adding these attribute.

推荐答案

你好Mik_2018

Hi Mik_2018

我在我的电子环境中测试一下,它会运行良好

I test this in my e environment, it will work well

sum( null:
		Axis(1).Item(0).Item(Axis(1).Item(0).count-1).Hierarchy.CurrentMember,
		IIf(
			[Measures].[Internet Sales Count] = 0,
			NULL,
			[Measures].[Internet Sales Count] 
		)
	)




我不确定哪一部分会导致这个问题,如果可能,请告知我更多详情?


I am not sure which part cause this problem, if possible, could you please inform me more details?


这篇关于累积总和|从计算中排除属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆