cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
NetflixCrow956
Level III

transform column

Hello everyone, I have a problem when I want to transform this column into a date. I transform it in Numeric then in date but when I transform it in date the year becomes 1904 and I don't know why?

 

NetflixCrow956_0-1653470819096.pngNetflixCrow956_1-1653470859498.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: transform column

Create new formula with the formula I provided earlier, you should end up with something like this:

jthi_0-1653549256927.png

Then change the Format to what fits you best

jthi_1-1653549295302.png

You can do this in place, but I would suggest:

  1. Creating new formula column
  2. Changing Format
  3. Verifying everything works as you want to
  4. Deleting old column if you don't need it
  5. Renaming new column

If you have to do this often, then I would look into using JSL and scripting it (I think Activity Recorder/Enhanced Log in JMP16 can record all of these steps to make scripting very simple).

-Jarmo

View solution in original post

6 REPLIES 6
jthi
Super User

Re: transform column

You could try creating a formula column with Informat() and then format that as you want. If the start value isn't character add Char() around the column reference

Informat("20210408", "YYYYMMDD");
Informat(Char(:ColumnToConvert), "YYYYMMDD");
-Jarmo
NetflixCrow956
Level III

Re: transform column

I know but when I do,  nothing happens

NetflixCrow956_0-1653490814997.png

NetflixCrow956_1-1653490855178.png

 

txnelson
Super User

Re: transform column

Try

column(dt, "Operation Start Date" ) << Input Format( "yyyymmdd");
Jim
jthi
Super User

Re: transform column

Create new formula with the formula I provided earlier, you should end up with something like this:

jthi_0-1653549256927.png

Then change the Format to what fits you best

jthi_1-1653549295302.png

You can do this in place, but I would suggest:

  1. Creating new formula column
  2. Changing Format
  3. Verifying everything works as you want to
  4. Deleting old column if you don't need it
  5. Renaming new column

If you have to do this often, then I would look into using JSL and scripting it (I think Activity Recorder/Enhanced Log in JMP16 can record all of these steps to make scripting very simple).

-Jarmo

Re: transform column

The reason is that JMP uses seconds since 12:00 AM January 1, 1904, as its base for time values. Your numbers are integers that code the year, month, and day. JMP has many built-in functions for working with date and time values. That is why @jthi's solution is so simple.

Jeff_Perkinson
Community Manager Community Manager

Re: transform column

@jthi and @Mark_Bailey have given you some good information. If you'd like to know more about how JMP handles dates see: Using dates, times, datetimes and durations in JMP 

-Jeff