calculation the difference for same column for the specific rows in Spotfire

后端 未结 2 1493
粉色の甜心
粉色の甜心 2021-01-03 13:16

I have a problem about the difference calculation for the rows using calculated column in Spotfire.

I am wondering if it is possible to create a calculated column th

2条回答
  •  一整个雨季
    2021-01-03 14:08

    @ZAWD - Another way of solving this:

    Step 1: Inserted a calculated column 'RowID' using the expression RowId()

    Step 2: Inserted a calculated column 'test0' using the expression below

    sum([Value]) over (Intersect(next([RowID]),Previous([Type])))
    

    Step 3: Inserted a calculated column 'test' using the expression below

    [Value] - sum([test0]) over (Next([RowID]))
    

    Step 4: Inserted a calculated column 'myresult' using the expression below

    Abs(If((Sum([Type]) over ([RowID])=1) and (Sum([Type]) over (Next([RowID]))=1),[test],[Value] - [test0]))
    

    Note: 'test0' and 'test' columns run in the background. They need not be included in the main table

    Final table looks like below:

    Also, this solution works fine in whichever order the values are in. I have tested this solution with different scenarios and seems to be working fine.

提交回复
热议问题