使用另一列spotfire中的先前值填充列

时间:2017-10-06 12:47:00

标签: spotfire

我正在尝试插入一个计算列,以便在T1 = CMP 1 Stops timestampT1 = CMP 1 starts'复制timestamp T1 Calculated Expected 5/1/2017 14:00 5/1/2017 14:15 5/1/2017 14:30 CMP 1 Starts 5/1/2017 14:45 CMP 1 Stops 5/1/2017 14:30 5/1/2017 14:30 5/1/2017 15:00 5/1/2017 15:15 5/1/2017 15:30 5/1/2017 15:45 5/1/2017 16:00 5/1/2017 16:15 5/1/2017 16:30 CMP 1 Starts 5/1/2017 16:45 CMP 1 ON 5/1/2017 17:00 CMP 1 Stops 5/1/2017 16:45 5/1/2017 16:30 5/1/2017 17:15 5/1/2017 17:30 5/1/2017 17:45 5/1/2017 18:00 5/1/2017 18:15 5/1/2017 18:30 5/1/2017 18:45 CMP 1 Starts 5/1/2017 19:00 CMP 1 ON 5/1/2017 19:15 CMP 1 Stops 5/1/2017 19:00 5/1/2017 18:45 5/1/2017 19:30 5/1/2017 19:45

Expected

示例:1=CMP 1 Stops

注意:在T null values时,它不一定要填充同一行,即使它T1=CMP 1 Starts填充所有/_layouts/home.html 它对我来说也是如此

1 个答案:

答案 0 :(得分:1)

您需要的第一个表达式是:

If((Trim([T1])="CMP 1 Stops") or (Trim([T1])="CMP 1 Starts"),Max([timestamp]) over (PreviousPeriod([timestamp]))) as [YourNewColumn]

然后,如果你想将它限制在[T1] =" CMP 1 Stops"只需添加另一个计算列:

case when [T1] = "CMP 1 Stops" then [YourNewColumn] end as [YourFinalColumn]