Hello,
I'm trying to create a new column (PRR_Level) that groups data from a continuous numeric column (PRR_Score) into 2 categories. The code generated from using the recode function and mapping by value works by creating a map for each value in PRR_Score, but I want something more concise I can use for repeat analyses.
This script generates no errors but all values in the new column are null. Does anyone have any ideas what I am doing wrong?
//PRR_Level
Names Default To Here( 1 );
dt = Current Data Table();
dt << Begin Data Update;
dt << New Column( "PRR_Level",
For Each Row(
:PRR_Level = If(
:PRR_Score >= 75, "Preferred Fit",
:PRR_Score < 75, "Potential Risk",
)
);
);
dt << Move Selected Column( to last );
dt << End Data Update;