[英]Retrieving Value from Another Row in Spotfire
我試圖在Spotfire中為特定的數據列引用另一行中的值。 舉個例子,我想參考銷售月份,其中青銅小工具的銷售數量等於黃金小工具的數量。 我在下面列了一個列,以顯示我需要的數據,“銅銷售月份=黃金銷售額”
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
我需要使用表達式來完成此操作而不使用腳本或插入另一個表。 這可能嗎? 我已經嘗試過以下和其他“結束”功能但沒有成功“青銅銷售=黃金銷售的月份”
Case When Max([Cumulative Bronze Widgets]) over ([Sales Month])= [Cumulative Gold Widgets] Then Max([Sales Month]) Over ([Cumulative Bronze Widgets]) else NULL End
Spotfire支持通過OVER
公式從其他行獲取數據。 這需要當前行的SAME COLUMN中的公共值以及從中獲取數據的公共值。
您需要匹配不同列中的值,因此OVER
將不適合您。
你可以嘗試一些解決方法:
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.