cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
saitcopuroglu
Level IV

How to convert character formats to date format

Dear All,

I receive data in excel with Date columns in various format (defined as character)

31.02.2015

31.2.2015

Feb 31 2015

.

.

.

and many more..

Trying in excel to format them but does not work for excel import wizard (mac)

How will I convert them to one valid Date Column in JMP?

Thank you in advance for your support.

1 ACCEPTED SOLUTION

Accepted Solutions
ron_horne
Super User (Alumni)

Re: How to convert character formats to date format

11 REPLIES 11
saitcopuroglu
Level IV

Re: How to convert character formats to date format

Any idea?

ron_horne
Super User (Alumni)

Re: How to convert character formats to date format

perhaps this can work for you:

https://www.youtube.com/watch?v=9nRaDwsYB28

ron

Steven_Moore
Level VI

Re: How to convert character formats to date format

I have also struggled with date formats importing to JMP.  What I do is this:  In Excel, I format my date column as "short date", i.e, 6/23/15.  Then, after importing the spreadsheet into a JMP data sheet, I then double click at the top of the date column and change the data type to Numeric and then change the modeling type to "Continuous".  Next click "Input Format" and click "Date" in the drop down menu.  You can then select the date format you wish to see in your JMP data table.

Steve

Re: How to convert character formats to date format

Try this out (see the formula column in the attached data table)...You can expand for the different date formats you encounter.

Best,

M

Re: How to convert character formats to date format

Looking at my example and ron_horne​'s example... they are basically the same concept... Use the informal() function.

The part that I didn't know, that the video indicates, is that if you leave out the second option of the informat() function, usually informal(<striing column>, <string format>), it will actually do that same thing as what I was proposing, but with a lot less coding. 


So, make a function in your data table that contains "Informat(<date column>)" and it should have you set.


Please be sure to mark ron_horne's answer as the correct one if that helps you out as it is the more elegant of the two solutions.


Best,


M

saitcopuroglu
Level IV

Re: How to convert character formats to date format

Thank you for all the input!

After trying several weird character date formats imported as character through excel import wizard (mac), the informat function with deleting the secondary argument can handle most of the process (12 of 14 different char formats).

Once again many thanks to JMP community!

saitcopuroglu
Level IV

Re: How to convert character formats to date format

One of the two char formats which informat function is unable to resolve is as screenshotted.

The function can resolve only the month of "May", I guess because it is the only 3 char month as its own and equals to abbreviated month char.

Recoding all months except May or Finding and Replacing all months to 3 char abbr. ones would be a solution of course but none of them would be that "elegant".

Any idea would be appreciated:

10204_Screen Shot 2015-10-15 at 16.20.07.png

Re: How to convert character formats to date format

Two options off the top of my head. Use the Recode Utility to change them all at once. Or you could use the nested Informat() arguments I proposed. You could build in a Match() argument into the logic to translate the long form month names into something JMP expects.

Best,

M

Sent from my iPhone

glenn_maxey0
Level I

Re: How to convert character formats to date format

I'm talking out of turn here. If this is a one-time conversion, then sometimes it is easier to write VBA macros to get the data in the source to conform to some standard before exporting and then importing into JMP. YMMV.