Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Sort Date and Time

Arnsen
7 - Meteor

Hello All,

 

I have a dataset in which I want to sort date and time associated with it in ascending order. 

I have attached a sample dataset to it.

5 REPLIES 5
JosephSerpis
17 - Castor
17 - Castor

Hi @Arnsen I mocked up a workflow let me know what you think?

LordNeilLord
15 - Aurora

Hey @Arnsen 

 

If you convert your date into an Alteryx DateTime first using a formula: DateTimeParse([Date Time], "%m/%d/%Y %H:%M")

 

Then you will be able to sort it using the standard sort tool

Arnsen
7 - Meteor

Great !!

 

 

Thank You

GiuseppeC
Alteryx
Alteryx

Hi @Arnsen

 

the Sort tool (in the Preparation category) should give you what you want. In your sample file the type of your 'Date time' field is DateTime, which is the correct one for the Sort tool to sort the data correctly in this case, but if the type in your workflow is String, you can use the DateTime tool from the Parse category to convert types.

 

(To check the data type click on the Metadata tab in the Results window).

 

Hope this helps!

Giuseppe

mmueller7337
8 - Asteroid

Good to know that Date cannot be sorted via typical means (Sort tool) but Date Time can! I hadn't picked up on this tidbit before.

Labels
Top Solution Authors