Apply formula to new columns based on old columns' data
Jun 20, 2016 9:45 AM(8746 views)
I am completely new to JMP scripting.
I am trying to create a script that will go to each character column in a table, find all its values (PASS, FAIL, etc..), and create new columns suffixed with "_CODED" using assigned values (1, 2, 3, 4, 5) based on the aforementioned ones.
Here's the script I have right now, that works, but only takes into account a single column. Is there a way I can insert a variable in place of that column name so all columns are accounted for?
dt = Data Table("datatable.jmp");
cols = dt << get column names(Character); //List all character columns
Basically, I'd like to know if there is a way to have the script go through with each Character column in a table instead of only Level 1. I have tried to use cols as a variable in place of Level 1, but this caused the script to not run because quotation marks were needed, or the script would look for a column named "Level 1", which is not the objective.
I took pieces of other scripts and tried to apply them to this one, so please also let me know if there is anything redundant. Thanks a lot.