[英]Retrieving Value from Another Row in Spotfire
I am attempting to reference a value in another row for a particular column of data in Spotfire. 我试图在Spotfire中为特定的数据列引用另一行中的值。 As an example, I would like to reference the sales month where the quantity of sales of bronze widgets was equal to the number of Gold Widgets.
举个例子,我想参考销售月份,其中青铜小工具的销售数量等于黄金小工具的数量。 I've included a column below to show the data I need, "Month Where Bronze Sales = Gold Sales"
我在下面列了一个列,以显示我需要的数据,“铜销售月份=黄金销售额”
Sales Month Cumulative Bronze Widgets Cumulative Gold Widgets Month Where Bronze Sales = Gold Sales
1/1/2017 0 1 2/1/2017
2/1/2017 1 2 4/1/2017
3/1/2017 1 2 4/1/2017
4/1/2017 2 3 5/1/2017
5/1/2017 3 3 5/1/2017
6/1/2017 4 3 5/1/2017
I need to accomplish this with an expression without using a script or inserting another table. 我需要使用表达式来完成此操作而不使用脚本或插入另一个表。 Is this possible?
这可能吗? I've tried the following and other "Over" functions without success for "Month Where Bronze Sales = Gold Sales"
我已经尝试过以下和其他“结束”功能但没有成功“青铜销售=黄金销售的月份”
Case When Max([Cumulative Bronze Widgets]) over ([Sales Month])= [Cumulative Gold Widgets] Then Max([Sales Month]) Over ([Cumulative Bronze Widgets]) else NULL End
Spotfire supports getting data from another rows through OVER
formulas. Spotfire支持通过
OVER
公式从其他行获取数据。 That requires a common value in the SAME COLUMN of the current row and the one where you get the data from. 这需要当前行的SAME COLUMN中的公共值以及从中获取数据的公共值。
You need to match values in different columns, so OVER
won't work for you. 您需要匹配不同列中的值,因此
OVER
将不适合您。
You can try some workarounds: 你可以尝试一些解决方法:
Cumulative Bronze Widgets
Cumulative Bronze Widgets
单独列 This works if you expect only a few numbers of Cumulative Bronze Widgets
: 如果你只想要几个
Cumulative Bronze Widgets
:
Min(IF([Cumulative Bronze Widgets]=1,[Sales Month],Null))
Min(IF([Cumulative Bronze Widgets]=2,[Sales Month],Null))
Case When [Cumulative Gold Widgets] then [Cumulative Bronze Widgets - 1]
When [Cumulative Gold Widgets] then [Cumulative Bronze Widgets - 1]
....
End
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.