簡體   English   中英

從Spotfire中的另一行檢索值

[英]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將不適合您。

你可以嘗試一些解決方法:

1.每個Cumulative Bronze Widgets單獨列

如果你只想要幾個Cumulative Bronze Widgets

  • “累積青銅小工具 - 1”:
    Min(IF([Cumulative Bronze Widgets]=1,[Sales Month],Null))
  • “累積青銅小部件 - 2”:
    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

2.創建一個新表

  • 為Bronze小部件與銷售月創建新的交叉表可視化
  • 將此新可視化保存為新表
  • 在舊表和新表之間創建一個鏈接([原始表]。[gold widgets] = [new table]。[bronze widgets]
  • 您現在可以通過過濾新表來過濾原始表; 遺憾的是,您可以在同一個可視化中包含多個表中的數據。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM