所以我有这个问题,我们想在每个班次中找出哪台机器最后开始工作。即哪台机器是最后注册负载的。所以这
max(aggr(min({<ACTIVITY={'Loading'}>}[RECORD START TIME]),
[CYCLE RECORD SHIFT],[CYCLE PRIMARY MACHINE]))
给了我正确的时间,但现在我也希望能够返回机器名称。
这是一个数据样本
load * inline [
ACTIVITY,CYCLE PRIMARY MACHINE,CYCLE RECORD SHIFT,CYCLE SHIFT START TIME,RECORD START TIME
Loading,DT90015,2016/02/25.0,25/02/2016 07:00:00,25/02/2016 11:45:17
Loading,DT90015,2016/02/25.0,25/02/2016 07:00:00,25/02/2016 12:02:14
Loading,DT90015,2016/02/25.0,25/02/2016 07:00:00,25/02/2016 12:21:32
Loading,DT90023,2016/02/25.0,25/02/2016 07:00:00,25/02/2016 08:12:48
Loading,DT90023,2016/02/25.0,25/02/2016 07:00:00,25/02/2016 08:50:43
Loading,DT90023,2016/02/25.0,25/02/2016 07:00:00,25/02/2016 09:17:27
Loading,DT90023,2016/02/25.0,25/02/2016 07:00:00,25/02/2016 09:53:19
Loading,DT90023,2016/02/25.0,25/02/2016 07:00:00,25/02/2016 11:51:52
Loading,DT90023,2016/02/25.0,25/02/2016 07:00:00,25/02/2016 12:07:09
Loading,DT90023,2016/02/25.0,25/02/2016 07:00:00,25/02/2016 12:29:23
Loading,DT90024,2016/02/25.0,25/02/2016 07:00:00,25/02/2016 08:08:54
Loading,DT90024,2016/02/25.0,25/02/2016 07:00:00,25/02/2016 08:24:51
Loading,DT90024,2016/02/25.0,25/02/2016 07:00:00,25/02/2016 08:40:15
Loading,DT90024,2016/02/25.0,25/02/2016 07:00:00,25/02/2016 09:02:07
Loading,DT90024,2016/02/25.0,25/02/2016 07:00:00,25/02/2016 09:25:59
Loading,DT90024,2016/02/25.0,25/02/2016 07:00:00,25/02/2016 09:57:36
Loading,DT90024,2016/02/25.0,25/02/2016 07:00:00,25/02/2016 12:37:09
];
感谢 Eldad 的建议,但返回的是:
我可能应该在我的原始问题中包含我想要创建的表