# Get Timestamp for each Ranked Value

**URL:** <https://forum.knime.com/t/get-timestamp-for-each-ranked-value/21638>\
**Category:** KNIME Analytics Platform\
**Created:** [March 10, 2020, 1:22pm UTC](https://forum.knime.com/t/get-timestamp-for-each-ranked-value/21638 "2020-03-10T13:22:44Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![buechertasche123](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/b/3da27b/32.png) [@buechertasche123](https://forum.knime.com/u/buechertasche123)\
**Post date:** [March 10, 2020, 1:22pm UTC](https://forum.knime.com/t/get-timestamp-for-each-ranked-value/21638/1 "2020-03-10T13:22:44Z")

</div>

Dear all,

I am having a question regarding to the workflow from post 2 in that [thread](https://forum.knime.com/t/values-before-and-after-a-value/20855)  
is it possible to get a new timestamp every time, when the values changes from Loiter to Auto?  
Perhaps I can use [Lag Column](https://nodepit.com/node/org.knime.base.node.preproc.columnlag.LagColumnNodeFactory) and [moving Agrregation](https://nodepit.com/node/org.knime.timeseries.node.movagg.MovingAggregationNodeFactory). For that purpose? But if so… I haven’t found a way doing so

thanks a lot!!

---

<div class="post-metadata">

**Author:** ![Iris](https://forum-cdn.knime.com/user_avatar/forum.knime.com/iris/32/14_2.png) [@Iris](https://forum.knime.com/u/Iris)\
**Post date:** [March 13, 2020, 2:39pm UTC](https://forum.knime.com/t/get-timestamp-for-each-ranked-value/21638/2 "2020-03-13T14:39:28Z")

</div>

Hi @buechertasche123

this sounds like you would need to loop this. Can you make me an example where you have the loiter/Auto column and how you want to have those timestamps assigned than?

---

<div class="post-metadata">

**Author:** ![buechertasche123](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/b/3da27b/32.png) [@buechertasche123](https://forum.knime.com/u/buechertasche123)\
**Post date:** [March 17, 2020, 2:26pm UTC](https://forum.knime.com/t/get-timestamp-for-each-ranked-value/21638/3 "2020-03-17T14:26:39Z")

</div>

Hi Iris,

super thanks for your help and I am very sorry for my late response! Please find attached a picture how I would like to have the solution. The timestamp should use milliseconds and append in a new column.

Thank you very much!

 ![time](https://forum-cdn.knime.com/uploads/default/original/2X/6/63efac962571314bc99454872a96b5fe4c0812df.jpeg)

---

<div class="post-metadata">

**Author:** ![ipazin](https://forum-cdn.knime.com/user_avatar/forum.knime.com/ipazin/32/806_2.png) [@ipazin](https://forum.knime.com/u/ipazin)\
**Post date:** [March 18, 2020, 8:10am UTC](https://forum.knime.com/t/get-timestamp-for-each-ranked-value/21638/4 "2020-03-18T08:10:46Z")

</div>

Hi there @buechertasche123,

Not sure I understand. You want create artificial timestamp when change occurs? And within same auto/loiter group have same timestamp value? Your picture is a bit confusing…

Br,  
Ivan

---

<div class="post-metadata">

**Author:** ![buechertasche123](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/b/3da27b/32.png) [@buechertasche123](https://forum.knime.com/u/buechertasche123)\
**Post date:** [March 19, 2020, 8:37am UTC](https://forum.knime.com/t/get-timestamp-for-each-ranked-value/21638/5 "2020-03-19T08:37:26Z")

</div>

Dear @ipazin ,

I am very sorry for the confusion. Let me explain.

I am reading Log Files from a Drone and use these files for Deep Learning. The Drone is creating – every time when LiPo gets plugged in a Timestamp. That timestamp starts, when the Drone has a 3D Fix Position.

For the Deep learning approach, I only need the Timestamp for some maneuvers and not for the hole flight. That means that every time when the Values in Column Batch changes from loiter\*\* to Auto\*\* it should generate a new Timestamp in milliseconds.

Super thanks for your help!  
regards

---

<div class="post-metadata">

**Author:** ![ipazin](https://forum-cdn.knime.com/user_avatar/forum.knime.com/ipazin/32/806_2.png) [@ipazin](https://forum.knime.com/u/ipazin)\
**Post date:** [March 19, 2020, 12:02pm UTC](https://forum.knime.com/t/get-timestamp-for-each-ranked-value/21638/6 "2020-03-19T12:02:30Z")

</div>

Hi there @buechertasche123,

If I got you right here is modified workflow from @HansS where I used [Column Expressions](https://kni.me/n/2_0ji_xeG-SudFu-) to create artificial timestamp when change occurs.

[before after value\_ipazin.knwf](https://forum.knime.com/uploads/short-url/s2MKESVd8yCqLXAk8V7dr2lQAWb.knwf) (53.5 KB)

Hope this helps!

Br,  
Ivan

---

<div class="post-metadata">

**Author:** ![buechertasche123](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/b/3da27b/32.png) [@buechertasche123](https://forum.knime.com/u/buechertasche123)\
**Post date:** [March 19, 2020, 4:45pm UTC](https://forum.knime.com/t/get-timestamp-for-each-ranked-value/21638/7 "2020-03-19T16:45:01Z")

</div>

Dear @ipazin

Thank you very much!  
This is almost that what I am looking for, but the Timestamp is supposed to continue until the value has changed.

Loiter 000  
? 001  
? 002  
? 003  
Auto 000  
? 001  
? 002  
? 003  
Loiter 000  
? 001  
? 002  
Auto 001  
? 002

I know that the Timestamp is supposed to be unique. But for Decision Trees and some other Algorithm’s, I perhaps get better results, when the training-data knows, how long one maneuverer has been taken. I tried to implement that with moving aggration and lag column, but I was unlucky.

Super thanks for your help so far!!

---

<div class="post-metadata">

**Author:** ![ipazin](https://forum-cdn.knime.com/user_avatar/forum.knime.com/ipazin/32/806_2.png) [@ipazin](https://forum.knime.com/u/ipazin)\
**Post date:** [March 20, 2020, 8:33am UTC](https://forum.knime.com/t/get-timestamp-for-each-ranked-value/21638/8 "2020-03-20T08:33:16Z")

</div>

Hi there @buechertasche123,

ok. Not sure what you are doing. Creating Timestamps to calculate maneuver duration? You really need timestamp or duration in some unit is sufficient (millisecond for example)? Anyways can you give example with timestamps? So “08-05-1988 12:00:00.001” and not 001,002,003…

Br,  
Ivan

---

<div class="post-metadata">

**Author:** ![buechertasche123](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/b/3da27b/32.png) [@buechertasche123](https://forum.knime.com/u/buechertasche123)\
**Post date:** [March 22, 2020, 1:13pm UTC](https://forum.knime.com/t/get-timestamp-for-each-ranked-value/21638/9 "2020-03-22T13:13:42Z")

</div>

Dear @ipazin

> [@ipazin](#):
>
> Creating Timestamps to calculate maneuver duration?

Indeed

> [@ipazin](#):
>
> Anyways can you give example with timestamps

timestamp for joining: Like IMU and GPS readings (already done)  
Duration for the maneuver

> [@ipazin](#):
>
> Anyways can you give example with timestamps? So “08-05-1988 12:00:00.001” and not 001,002,003…

Yes. 001 was just not the correct writing. 08-05-1988 12:00:00.001 will work fine

The only thing is…  
Your workflow continuous with the timestamp, even the values in column batch has been changed. What I want is, that when the value is changing – then creating a new timestamp. So that I can see for instance: auto 1 took 20 seconds, auto 2 took 5 Seconds.

super thanks!!

---

<div class="post-metadata">

**Author:** ![ipazin](https://forum-cdn.knime.com/user_avatar/forum.knime.com/ipazin/32/806_2.png) [@ipazin](https://forum.knime.com/u/ipazin)\
**Post date:** [March 27, 2020, 2:53pm UTC](https://forum.knime.com/t/get-timestamp-for-each-ranked-value/21638/10 "2020-03-27T14:53:33Z")

</div>

Hi there @buechertasche123,

here is modified workflow. Used [Group Loop Start](https://kni.me/n/7a8fxq51Z1jrgXeM) to get desired output. Probably there are other ways to determine maneuver duration and sure there is way to optimize process but leave that to you.

[before after value\_ipazin2.knwf](https://forum.knime.com/uploads/short-url/rdVsl5tOHLJVB6qgwXFZCbPYl7X.knwf) (66.6 KB)

Hope I got it this time 🙂

Br,  
Ivan

---

<div class="post-metadata">

**Author:** ![buechertasche123](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/b/3da27b/32.png) [@buechertasche123](https://forum.knime.com/u/buechertasche123)\
**Post date:** [March 31, 2020, 6:09pm UTC](https://forum.knime.com/t/get-timestamp-for-each-ranked-value/21638/11 "2020-03-31T18:09:30Z")

</div>

Dear @ipazin,

Thank you very much! Have a nice week 🙂

kind reagrds

---

<div class="post-metadata">

**Author:** ![ipazin](https://forum-cdn.knime.com/user_avatar/forum.knime.com/ipazin/32/806_2.png) [@ipazin](https://forum.knime.com/u/ipazin)\
**Post date:** [April 1, 2020, 8:43am UTC](https://forum.knime.com/t/get-timestamp-for-each-ranked-value/21638/12 "2020-04-01T08:43:26Z")

</div>

Hi @buechertasche123,

glad I helped.

Tnx and you too,  
Ivan

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [April 8, 2020, 8:43am UTC](https://forum.knime.com/t/get-timestamp-for-each-ranked-value/21638/13 "2020-04-08T08:43:29Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
