简体   繁体   English

使用日期计算新列

[英]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'.我从spotfire开始,我有一个包含以下列的数据连接器,我想创建一个新列,指示是否在“LSTOR”设备中找到的 object 稍后在“LSTOR”以外的另一个设备中找到'。

Thanks for your help谢谢你的帮助

TimeStamp时间戳 Equipement设备 Object Object
10/09/2021 2021 年 10 月 9 日 LSTOR LSTOR A一个
11/09/2021 2021 年 11 月 9 日 MUN3 MUN3 C C
14/09/2021 2021 年 9 月 14 日 MUN3 MUN3 F F
12/09/2021 2021 年 12 月 9 日 MUN3 MUN3 A一个

I could do it for your sample dataset defining first a column LSTOR_TS as:我可以为您的示例数据集执行此操作,首先将列 LSTOR_TS 定义为:

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.当没有 LSTOR 值时,SN(..) 在那里迎合。

This solution would return False if there were LSTOR and another equipment on the same day.如果同一天有 LSTOR 和另一台设备,此解决方案将返回 False。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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