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

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

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 )
);