cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
jearls11
Level III

Date column not sorting as it is a character

I have a dataset and trying to sort by date.
I am having issues I have tried to informat the column as it been read in as a character.

But with no success. Have attached the dataset without the informat

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Date column not sorting as it is a character

I would suggest checking out Data Table Tools Add-in by @brady_brady 

 

jthi_0-1613158377502.png

 

jthi_1-1613158402829.png

 

 

-Jarmo

View solution in original post

3 REPLIES 3
jthi
Super User

Re: Date column not sorting as it is a character

I would suggest checking out Data Table Tools Add-in by @brady_brady 

 

jthi_0-1613158377502.png

 

jthi_1-1613158402829.png

 

 

-Jarmo
txnelson
Super User

Re: Date column not sorting as it is a character

To turn this into  proper JMP Date/Time numeric value:

  1. Right click on the column header and select "Column Info"
  2. Change the Data Type from Character to Numeric
  3. Change the Modeling Type from Nominal to Continuous
  4. Select from the Format..........Time=>m/d/y h:m:s
  5. Click OK
Jim
Georg
Level VII

Re: Date column not sorting as it is a character

Please screenshot,

as @txnelson pointed out, you have to convert it to a proper continuous time value to work with it.

 

The display format is not important, it is only how the internally stored datetime is displayed.

But it is essential how the given string is interpreted, in your case you need to specify the appropriate informat, see screenshot and table script.

In that case I copied the column, because after conversion the original string is lost. In my case I had also to switch to JMP locales under preferences, Window specific, to see the proper datetime format (I have german windows system).

 

New Table( "time_sort",
	Add Rows( 5 ),
	New Column( "Proc Time",
		Character,
		"Nominal",
		Set Values(
			{"1/12/2021 11:44:32 AM", "1/12/2021 11:44:32 AM",
			"1/12/2021 11:44:32 AM", "1/12/2021 11:44:32 AM",
			"1/12/2021 11:44:32 AM"}
		),
		Set Display Width( 177 )
	),
	New Column( "copy_date",
		Numeric,
		"Continuous",
		Format( "Locale Date Time h:m:s", 23, 0 ),
		Input Format( "m/d/y h:m:s", 0 ),
		Set Selected,
		Set Values( [3693296672, 3693296672, 3693296672, 3693296672, 3693296672] ),
		Set Display Width( 183 )
	)
)

 

Georg