简体   繁体   English

tibco spotfire 中的月末/年末数据

[英]end of month/year data in tibco spotfire

I have the following dataset in tibco spotfire:我在 tibco spotfire 中有以下数据集:

Original data原始数据

I want to bring the amount of item in the beginning of each month for each row and get the following result:我想为每一行带来每个月初的项目数量并得到以下结果:

Image图片

Any suggestions?有什么建议么?

I could do it via an intermediate column (as Spotfire's OVER does not accept expressions).我可以通过一个中间列来做到这一点(因为 Spotfire 的 OVER 不接受表达式)。

First calculate the year and month like this: (assuming the format of your date is known and stable) [YearMonth] is:首先像这样计算年份和月份:(假设您的日期格式已知且稳定)[YearMonth] 为:

Integer(Concatenate(Substring(String([Date]),7,4),Substring(String([Date]),4,2)))

then your [Previous Month] is:那么您的 [上个月] 是:

Max([Amount]) over (Intersect(Previous([YearMonth]),[BRANCH],[CLASS]))

and your [Diff] is:你的 [Diff] 是:

[Amount] - [Previous Month]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM