cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
Get the free JMP Student Edition for qualified students and instructors at degree granting institutions.
Choose Language Hide Translation Bar
View Original Published Thread

Recode a value in a column with a formula instead of a static value

Phil_Nash
Level II

The original value that is in the table that I want to recode will always be 01/01/1900.  I want to recode that to today's date.  This only returns a blank, and not today's date.  Any idea what I need to change?

 

Thanks!

 

Transfers << Begin Data Update;
Transfers << Recode Column(
	Transfers:OrderDate,
	{Map Value( _rcOrig, {-126144000, short date(today())}, Unmatched( _rcNow ) )},
	Update Properties( 1 ),
	Target Column( :OrderDate )
);
Transfers << End Data Update;
1 REPLY 1


Re: Recode a value in a column with a formula instead of a static value

I am not sure that the source column and the destination column can be the same data column. Here is the example from the scripting index:

 

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
col = New Column( :age );
col << Data Type( "Character" );
dt << Recode Column(
	:age,
	{If(
		_rcNow >= 17, "Older",
		_rcNow >= 15, "Middle",
		"Younger"
	)},
	Target Column( col )
);