Forum Discussion

TimHoare's avatar
TimHoare
Frequent Visitor
6 years ago
Solved

Date-time ties not sorting correctly

I have some data that represents an occurence of one object changing between 'stages', and the time that each change occured. The data appears in reverse-chronological order:

 

TimestampOldStageNewStageOrder
2020-03-03T20:12:37Stage 4Stage 55
2020-02-29T12:22:56Stage 2Stage 44
2020-02-13T09:39:10Stage 1Stage 23
2020-02-13T09:39:10Stage 2Stage 12
2020-02-11T17:18:25Stage 1Stage 21

 

The data shows a single journey from Stage 1 to 5 at every step - Starting at 1, moving to 2, then back to 1 and so on. I have a record of when these changes occured in the form of a date-time timestamp. Unfortunately, on occasion there are duplicate timestamps, when it appears the object moves forwards then quickly backwards again (or vice versa). Thankfully I know for a fact the order that the data appears is the order that it occured, so am able to add an 'order' column to sort by. 

 

What I would like to do is to plot the data almost as-is in a table, but without the order column. When I try to do this, and sort by the timestamp column, often it will sort the ties in the wrong order (here the 2nd and 3rd rows should be reversed):

 

I have tried to sort the Timestamp column by the Order column I created, but this is not permitted:

 

I guess my question is: Is there a way that I can order the timestamp column in my table so that the ties are always ordered correctly, without having to include my order column and sort by that?

 
 
 

 

  • if you sort where there is a duplicate value you will not be able to sort, you will either need to clean up your data or provide  a value to your COLUMN colum that has a one to one relationship with the column you want to sort.  

1 Reply

  • vanessafvg's avatar
    vanessafvg
    Community Champion

    if you sort where there is a duplicate value you will not be able to sort, you will either need to clean up your data or provide  a value to your COLUMN colum that has a one to one relationship with the column you want to sort.