Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
Rajat
Level IV

Remove Year from date column

I have data column with numerica data type with format (m/d/y). I want to remove the year and it to format (m/d) only. Can anybody help how I can do it?

I tried it by changing it to character data type but I want data type of column as Numeric only with date format.

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
txnelson
Super User

Re: Remove Year from date column

There is not a format in JMP that will do what you want.  However you can use Custome Format to do what you want. All you have to do, is to go to the Column Info fo r your date column, click on the Format and select "Custom".  And use the following for the format

Char( Month( value ) ) || "/" || Char( Day( value ) ) )

Below is an example in JSL that will show you the end results

New Table( "Example",
	Add Rows( 1 ),
	New Column( "Date",
		Numeric,
		"Continuous",
		Format(
			"Custom",
			Formula( Char( Month( value ) ) || "/" || Char( Day( value ) ) ),
			12
		),
		Input Format( "m/d/y" ),
		Set Selected,
		Set Values( [3650572800] )
	)
)

 

Jim

View solution in original post

2 REPLIES 2
Highlighted
txnelson
Super User

Re: Remove Year from date column

There is not a format in JMP that will do what you want.  However you can use Custome Format to do what you want. All you have to do, is to go to the Column Info fo r your date column, click on the Format and select "Custom".  And use the following for the format

Char( Month( value ) ) || "/" || Char( Day( value ) ) )

Below is an example in JSL that will show you the end results

New Table( "Example",
	Add Rows( 1 ),
	New Column( "Date",
		Numeric,
		"Continuous",
		Format(
			"Custom",
			Formula( Char( Month( value ) ) || "/" || Char( Day( value ) ) ),
			12
		),
		Input Format( "m/d/y" ),
		Set Selected,
		Set Values( [3650572800] )
	)
)

 

Jim

View solution in original post

Highlighted
Rajat
Level IV

Re: Remove Year from date column

Thanks @txnelson
Appreciate your help
Article Labels

    There are no labels assigned to this post.