最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Get the value of previous row in spotfire - Stack Overflow

programmeradmin3浏览0评论

I need to get the previous row value over "ID" column. I am trying to get the "Last status change date" by adding a calculated column in spotfire. Help me to add this in spotfire. I have multiple IDs, My resultant calculated column should be having previous "Status Change Date"

below is the sample data

I need to get the previous row value over "ID" column. I am trying to get the "Last status change date" by adding a calculated column in spotfire. Help me to add this in spotfire. I have multiple IDs, My resultant calculated column should be having previous "Status Change Date"

below is the sample data

Share Improve this question asked Mar 17 at 7:20 ParthaSarathiParthaSarathi 3051 silver badge9 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 0

I am not clear why you do not expect every row to have a Last Status Change Date.

This would give you a value for every row:

First create a [Row_ID] column as RowId(). Unfortunately Spotfire does not allow you to call a function after an OVER expression, so you need the column, unless you already have a row identifier.

Then use it to calculate your Last Status Change Date as:

Max([Status_Change_Date]) over (intersect(AllPrevious([Row_ID]),[ID]))

I have got the answer by doing this,

First I inserted rank of my status change by ID

 If([Status Change Date] is not NULL,Rank(RowId(),"asc",[ID]))```

then I inserted onw more calculated column to get the last status change date using rank

Last([Status Change Date]) OVER (Intersect([task_id],Previous([Rank of Status Change Date])))

This gave me the Last Status Change Date

发布评论

评论列表(0)

  1. 暂无评论