Recode numerical days into Monday, Tuesday, Wednesday etcHi, I have a column that is indicated as days, in ordinal data.
How can I recode it, such that they are (Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday)?
Currently:
1 = Wednesday
2 = Thursday
3 = Friday
4 = Saturday
5 = Sunday
6 = Monday
7 = Tuesday
9 =Wednesday
.....
416 = Friday
417 = Saturday
418 = Sunday
Is there a way to recode it without me having to type Mon - Sun all the way from 1 to 418?
Data TableScriptingRe: Recode numerical days into Monday, Tuesday, Wednesday etcThank you so much!!Re: Recode numerical days into Monday, Tuesday, Wednesday etcSelect the column with the current values (1..7). Select Cols > Column Info. Select Column Properties > Value Labels. Define the character string label for each data value.
Re: Recode numerical days into Monday, Tuesday, Wednesday etcBuilding on @txnelson's solution, you can use a Formula column with the Modulo() function that he showed, along with the Value Labels property.

The attached data table has this example.
Re: Recode numerical days into Monday, Tuesday, Wednesday etcThank you so much. However, if I may ask, how do I do it, such that the new column is inside my existing table?
For instance, my existing table name is transaction_data.
Which are the field that I needed to change to "transaction_data" above, without the need to create a new table?Re: Recode numerical days into Monday, Tuesday, Wednesday etcHere is an example of a script that will create a new column with the desired values
Names Default To Here( 1 );
// Create an Example data table
dt = New Table( "Example", add rows( 418 ), New Column( "weekday", set each value( Row() ) ) );
// Create a new column Using a script
dt << New Column( "Weekday 2",
character,
set each value(
theList = {"Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday", "Monday"};
theList[Mod( :weekday, 7 ) + 1];
)
);