spotfiretibcospotfire-analystspotfire-webplayer

Calculate new Column using date


I'm starting with spotfire, I have a dataconector which contains the following columns, I would like to create a new column which indicates if an object found in an 'LSTOR' device is found at a later date in another device other than 'LSTOR'.

Thanks for your help

TimeStamp Equipement Object
10/09/2021 LSTOR A
11/09/2021 MUN3 C
14/09/2021 MUN3 F
12/09/2021 MUN3 A

Solution

  • I could do it for your sample dataset defining first a column LSTOR_TS as:

    case  when [Equipement]='LSTOR' then Min([TimeStamp]) over ([Object]) end
    

    then defining the target column as:

    SN(case  when Max([LSTOR_TS]) over ([Object])<Max([TimeStamp]) over ([Object]) then True else False end,False)
    

    the SN(..) being there to cater when there is no LSTOR value.

    This solution would return False if there were LSTOR and another equipment on the same day.