简体   繁体   中英

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM