Extracting data for a specific time range from Datatime
Data8
Registered Posts: 4 âœâœâœ
Hi.
I want to extract data from 7 AM to 10 AM, regardless of the date, in Datetime, but I don't know how to do it.
Thank you.
Tagged:
Best Answer
-
Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,113 Neuron
You said 7AM initially not 7:30AM so you have changed your requirements. 😉
You can use datePart() in a formula to extract the hours and minutes, joined together and filter for records in the 730 to 1000 range:
(datePart(Time_parsed, "hours")*100)+datePart(Time_parsed, "minutes")
Answers
-
Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,113 Neuron
In a Prepare recipe use the Extract Date Components processor to extract the hour:
https://doc.dataiku.com/dss/latest/preparation/dates.html#extracting-date-components
-
Thank you. I used that method for filtering as well. However, with this method, it's not possible to filter time range like 7:30 AM to 10 AM. So I'm searching for another solution.
-
Thank you. I solved issue.