Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
Search instead for
Did you mean:
Our World Statistics Day conversations have been a great reminder of how much statistics can inform our lives. Do you have an example of how statistics has made a difference in your life? Share your story with the Community!
Apply formula to new columns based on old columns' data
Jun 20, 2016 9:45 AM(8820 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.