Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I have a column (Date_Time) in a csv file which has a date and time entered in the following format 2022-05-17 15:48:34. I'm trying to split the time into 5 minute intervals and create a new column with the time in 5 minute intervals and the date removed. In the data load editor I've used the following line
Timestamp(floor([Date_Time],5/(24*60))) as [Time_5min]
However this then displays the date and time in 5 minute intervals as below
Date_Time | Time_5min |
17/05/2022 15:48 | 17/05/2022 15:45:00 |
2022-06-30 09:38:53 | 30/06/2022 9:35:00 |
2022-06-30 09:42:29 | 30/06/2022 9:40:00 |
2022-07-01 07:28:35 | 01/07/2022 7:25:00 |
2022-07-01 07:34:56 | 01/07/2022 7:30:00 |
2022-07-01 07:35:36 | 01/07/2022 7:35:00 |
2022-07-01 07:56:28 | 01/07/2022 7:55:00 |
2022-07-01 07:56:33 | 01/07/2022 7:55:00 |
2022-07-01 07:56:35 | 01/07/2022 7:55:00 |
Is it possible to remove the date so just the time is entered into the new column (Time_5Min), the same as the table below?
Date_Time | Time_5min |
17/05/2022 15:48 | 15:45:00 |
2022-06-30 09:38:53 | 9:35:00 |
2022-06-30 09:42:29 | 9:40:00 |
2022-07-01 07:28:35 | 7:25:00 |
2022-07-01 07:34:56 | 7:30:00 |
2022-07-01 07:35:36 | 7:35:00 |
2022-07-01 07:56:28 | 7:55:00 |
2022-07-01 07:56:33 | 7:55:00 |
2022-07-01 07:56:35 | 7:55:00 |
Any help would be much appreciated.
Thanks
Paul
yes.
try below
Time(Frac(floor([Date_Time],5/(24*60)))) as time,
Regards,
Hi,
try below
Time(Frac(Time_5min)) as time;
Regards,
Prashant Sangle
Hi
Thank you @PrashantSangle for your response.
Is it possible to include the expression to split the date and time into my original expression which splits the time into 5 minute intervals?
Timestamp(floor([Date_Time],5/(24*60))) as [Time_5min]
The Time_5min column is only created once the load editor has run and it would be easier to create the Time_5min column using one expression if possible.
Thanks
Paul
yes.
try below
Time(Frac(floor([Date_Time],5/(24*60)))) as time,
Regards,
Thank you @PrashantSangle Time(Frac(floor([Date_Time],5/(24*60)))) as time, worked and split the time out into the new Time-5min column.
Thanks for your help
Paul