Forum Discussion
mamatea1218
1 year agoNew Member
split or extract?
Hi, I have a column including datetime that the format is 2025-07-07 at 12:40. Which one solution is better? "split by using delimiter at" or "apply a tramsform to extract the column first 11 cha...
- 1 year ago
mamatea1218 If format is constant then extracting first 11 characters is good because Extracting a fixed number of characters is generally faster and less error-prone and It is straightforward if the date part is always exactly 11 characters long.
If there is any possibility of variation in the format, splitting by delimiter might be a safer choice.
Omid_Motamedise
Super User
1 year agoHi mamatea1218
both methods work, but the preferred one often depends on clarity, flexibility, and intent.
Splitting is clear and the resul reach in one step (without considering changing type step at following), but it is dependend to "at" and is also case sensitive.
second option is based on the assumption of fixed length and the fomrat should be consistent and also lelss readable.